diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-04-23 09:08:16 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-28 18:19:34 +0200 |
commit | 33d0a8d753883e6b33ba8610c52f7fee42d6d9f1 (patch) | |
tree | 8452d09194c35e0c3c94b7ccd6f16000af0b396b /src/opengl/qglpaintdevice.cpp | |
parent | 8f443ad0b96af1c3b07ca8faeba139091c7276a8 (diff) |
Remove direct OpenGL calls from QtOpenGL
Task-number: QTBUG-36483
Change-Id: I96dea5649c0a49a11cd2ff31da659cd2067e769d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/opengl/qglpaintdevice.cpp')
-rw-r--r-- | src/opengl/qglpaintdevice.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/opengl/qglpaintdevice.cpp b/src/opengl/qglpaintdevice.cpp index 6a8d5c042e..1af4762e6a 100644 --- a/src/opengl/qglpaintdevice.cpp +++ b/src/opengl/qglpaintdevice.cpp @@ -164,18 +164,19 @@ void QGLWidgetGLPaintDevice::setWidget(QGLWidget* w) void QGLWidgetGLPaintDevice::beginPaint() { QGLPaintDevice::beginPaint(); + QOpenGLFunctions *funcs = QOpenGLContext::currentContext()->functions(); if (!glWidget->d_func()->disable_clear_on_painter_begin && glWidget->autoFillBackground()) { if (glWidget->testAttribute(Qt::WA_TranslucentBackground)) - glClearColor(0.0, 0.0, 0.0, 0.0); + funcs->glClearColor(0.0, 0.0, 0.0, 0.0); else { const QColor &c = glWidget->palette().brush(glWidget->backgroundRole()).color(); float alpha = c.alphaF(); - glClearColor(c.redF() * alpha, c.greenF() * alpha, c.blueF() * alpha, alpha); + funcs->glClearColor(c.redF() * alpha, c.greenF() * alpha, c.blueF() * alpha, alpha); } if (context()->d_func()->workaround_needsFullClearOnEveryFrame) - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); + funcs->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); else - glClear(GL_COLOR_BUFFER_BIT); + funcs->glClear(GL_COLOR_BUFFER_BIT); } } |