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

Method paintGL

Gui/DopeSheetView.cpp:3267–3341  ·  view source on GitHub ↗

* @brief DopeSheetView::paintGL * * */

Source from the content-addressed store, hash-verified

3265 *
3266 */
3267void
3268DopeSheetView::paintGL()
3269{
3270 running_in_main_thread_and_context(this);
3271
3272 if ( !appPTR->isOpenGLLoaded() ) {
3273 return;
3274 }
3275
3276
3277 glCheckError();
3278
3279 if (_imp->zoomContext.factor() <= 0) {
3280 return;
3281 }
3282
3283 {
3284 double screenPixelRatio = getScreenPixelRatio();
3285 if (screenPixelRatio != _imp->_screenPixelRatio) {
3286 _imp->_screenPixelRatio = screenPixelRatio;
3287 _imp->_textFont.reset(new QFont(appFont, appFontSize * screenPixelRatio));
3288 }
3289 }
3290 assert(_imp->_textFont);
3291
3292 double zoomLeft, zoomRight, zoomBottom, zoomTop;
3293 zoomLeft = _imp->zoomContext.left();
3294 zoomRight = _imp->zoomContext.right();
3295 zoomBottom = _imp->zoomContext.bottom();
3296 zoomTop = _imp->zoomContext.top();
3297
3298 // Retrieve the appropriate settings for drawing
3299 SettingsPtr settings = appPTR->getCurrentSettings();
3300 double bgR, bgG, bgB;
3301 settings->getDopeSheetEditorBackgroundColor(&bgR, &bgG, &bgB);
3302
3303 if ( (zoomLeft == zoomRight) || (zoomTop == zoomBottom) ) {
3304 glClearColor(bgR, bgG, bgB, 1.);
3305 glClear(GL_COLOR_BUFFER_BIT);
3306
3307 return;
3308 }
3309
3310 {
3311 GLProtectAttrib a(GL_TRANSFORM_BIT | GL_COLOR_BUFFER_BIT);
3312 GLProtectMatrix p(GL_PROJECTION);
3313
3314 glLoadIdentity();
3315 glOrtho(zoomLeft, zoomRight, zoomBottom, zoomTop, 1, -1);
3316
3317 GLProtectMatrix m(GL_MODELVIEW);
3318
3319 glLoadIdentity();
3320
3321 glCheckError();
3322
3323 glClearColor(bgR, bgG, bgB, 1.);
3324 glClear(GL_COLOR_BUFFER_BIT);

Callers

nothing calls this directly

Calls 15

isOpenGLLoadedMethod · 0.80
getCurrentSettingsMethod · 0.80
drawProjectBoundsMethod · 0.80
drawRowsMethod · 0.80
drawSelectionRectMethod · 0.80
drawSelectedKeysBRectMethod · 0.80
resetMethod · 0.45
leftMethod · 0.45
rightMethod · 0.45

Tested by

no test coverage detected