MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / checkIfViewPortRoIValidOrRenderForInput

Method checkIfViewPortRoIValidOrRenderForInput

Gui/ViewerGL.cpp:2749–2767  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2747}
2748
2749bool
2750ViewerGL::checkIfViewPortRoIValidOrRenderForInput(int texIndex)
2751{
2752
2753 unsigned int mipMapLevel = (unsigned int)std::max((int)getInternalNode()->getMipMapLevelFromZoomFactor(), (int)getInternalNode()->getViewerMipMapLevel());
2754 int closestPo2 = 1 << mipMapLevel;
2755 if (closestPo2 != _imp->displayTextures[texIndex].texture->getTextureRect().closestPo2) {
2756 return false;
2757 }
2758 RectI roiNotRounded;
2759 RectI roi = getImageRectangleDisplayedRoundedToTileSize(texIndex, _imp->displayTextures[texIndex].rod, _imp->displayTextures[texIndex].texture->getTextureRect().par, mipMapLevel, 0, 0, 0, &roiNotRounded);
2760 const RectI& currentTexRoi = _imp->displayTextures[texIndex].texture->getTextureRect();
2761 if (!currentTexRoi.contains(roi)) {
2762 return false;
2763 }
2764 _imp->displayTextures[texIndex].roiNotRoundedToTileSize.set(roiNotRounded);
2765
2766 return true;
2767}
2768
2769void
2770ViewerGL::checkIfViewPortRoIValidOrRender()

Callers

nothing calls this directly

Calls 5

maxFunction · 0.85
getViewerMipMapLevelMethod · 0.80
containsMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected