| 604 | } |
| 605 | |
| 606 | void |
| 607 | ViewerGL::drawOverlay(unsigned int mipMapLevel) |
| 608 | { |
| 609 | // always running in the main thread |
| 610 | assert( qApp && qApp->thread() == QThread::currentThread() ); |
| 611 | assert( QOpenGLContext::currentContext() == context() ); |
| 612 | |
| 613 | glCheckError(); |
| 614 | |
| 615 | double screenPixelRatio = getScreenPixelRatio(); |
| 616 | |
| 617 | { |
| 618 | GLProtectAttrib a(GL_COLOR_BUFFER_BIT | GL_LINE_BIT | GL_CURRENT_BIT | GL_ENABLE_BIT); |
| 619 | |
| 620 | glDisable(GL_BLEND); |
| 621 | glLineWidth(1. * screenPixelRatio); |
| 622 | |
| 623 | int activeInputs[2]; |
| 624 | getInternalNode()->getActiveInputs(activeInputs[0], activeInputs[1]); |
| 625 | for (int i = 0; i < 2; ++i) { |
| 626 | |
| 627 | if ( (i == 1) && (_imp->viewerTab->getCompositingOperator() == eViewerCompositingOperatorNone) ) { |
| 628 | break; |
| 629 | } |
| 630 | RectD canonicalFormat = getCanonicalFormat(i); |
| 631 | |
| 632 | // Draw format |
| 633 | { |
| 634 | assert(_imp->_textFont); |
| 635 | renderText(canonicalFormat.right(), canonicalFormat.bottom(), _imp->currentViewerInfo_resolutionOverlay[i], _imp->textRenderingColor, *_imp->_textFont); |
| 636 | |
| 637 | |
| 638 | QPoint topRight( canonicalFormat.right(), canonicalFormat.top() ); |
| 639 | QPoint topLeft( canonicalFormat.left(), canonicalFormat.top() ); |
| 640 | QPoint btmLeft( canonicalFormat.left(), canonicalFormat.bottom() ); |
| 641 | QPoint btmRight( canonicalFormat.right(), canonicalFormat.bottom() ); |
| 642 | |
| 643 | glLineWidth(1. * screenPixelRatio); |
| 644 | glBegin(GL_LINES); |
| 645 | |
| 646 | glColor4f( _imp->displayWindowOverlayColor.redF(), |
| 647 | _imp->displayWindowOverlayColor.greenF(), |
| 648 | _imp->displayWindowOverlayColor.blueF(), |
| 649 | _imp->displayWindowOverlayColor.alphaF() ); |
| 650 | glVertex3f(btmRight.x(), btmRight.y(), 1); |
| 651 | glVertex3f(btmLeft.x(), btmLeft.y(), 1); |
| 652 | |
| 653 | glVertex3f(btmLeft.x(), btmLeft.y(), 1); |
| 654 | glVertex3f(topLeft.x(), topLeft.y(), 1); |
| 655 | |
| 656 | glVertex3f(topLeft.x(), topLeft.y(), 1); |
| 657 | glVertex3f(topRight.x(), topRight.y(), 1); |
| 658 | |
| 659 | glVertex3f(topRight.x(), topRight.y(), 1); |
| 660 | glVertex3f(btmRight.x(), btmRight.y(), 1); |
| 661 | |
| 662 | glEnd(); |
| 663 | glCheckErrorIgnoreOSXBug(); |
nothing calls this directly
no test coverage detected