| 758 | } |
| 759 | |
| 760 | void |
| 761 | ViewerGL::Implementation::drawCheckerboardTexture(const RectD& rod) |
| 762 | { |
| 763 | // Re-use drawCheckerboardTexture(const QPolygonF& polygon). |
| 764 | // Another solution would be to use glScissor, but: |
| 765 | // - glScissor is not used often in OpenGL, and often has bugs in OpenGL implementations. |
| 766 | // - glScissor seems to have a bug, at least on macOS Catalina and Big Sur (10.15/11.x). |
| 767 | // See: |
| 768 | // - https://discuss.pixls.us/t/checker-mask-offset-issue/24784 |
| 769 | // - https://github.com/NatronGitHub/Natron/issues/614 |
| 770 | // glScissor-based implementation available from: |
| 771 | // https://github.com/NatronGitHub/Natron/blob/c8e931817493afaf44bac0ca8f78c982b4c50a31/Gui/ViewerGLPrivate.cpp#L735 |
| 772 | |
| 773 | QPolygonF polygon; |
| 774 | polygon << QPointF(rod.x1, rod.y1) << QPointF(rod.x2, rod.y1) << QPointF(rod.x2, rod.y2) << QPointF(rod.x1, rod.y2); |
| 775 | drawCheckerboardTexture(polygon); |
| 776 | } |
| 777 | |
| 778 | void |
| 779 | ViewerGL::Implementation::drawCheckerboardTexture(const QPolygonF& polygon) |