diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-05-20 19:45:38 +0200 |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-05-20 19:46:19 +0200 |
commit | d671acd5b296b83440db9836a92189c501c87ff3 (patch) | |
tree | bd9c1a000e17c70124c207666cfb3276b5518ffd /src/opengl/qwindowsurface_gl.cpp | |
parent | 42f5786104f9eef9542df2c7469a03324978281d (diff) | |
parent | 4f2138ecfbdc58e5cb5b0c7d762197ef69752957 (diff) |
Merge remote branch 'staging/master' into refactor
Conflicts:
src/opengl/qgl_qpa.cpp
src/plugins/platforms/glxconvenience/qglxconvenience.cpp
src/plugins/platforms/platforms.pro
src/plugins/platforms/wayland/qwaylandwindow.cpp
src/plugins/platforms/xcb/qxcbwindow.cpp
src/plugins/platforms/xcb/qxcbwindow.h
src/plugins/platforms/xcb/qxcbwindowsurface.cpp
src/widgets/kernel/qwidget_qpa.cpp
tests/auto/qvariant/tst_qvariant.cpp
Diffstat (limited to 'src/opengl/qwindowsurface_gl.cpp')
-rw-r--r-- | src/opengl/qwindowsurface_gl.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index 62a631855f..4f194327ad 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -485,19 +485,30 @@ void QGLWindowSurface::beginPaint(const QRegion &) d_ptr->did_paint = true; updateGeometry(); - if (!context()) - return; - int clearFlags = 0; - if (context()->d_func()->workaround_needsFullClearOnEveryFrame) +#if 0 + QGLContext *ctx = reinterpret_cast<QGLContext *>(window()->d_func()->extraData()->glContext); +#endif + const QGLContext *ctx = QGLContext::currentContext(); + + if (!ctx) + return; + + if (ctx->d_func()->workaround_needsFullClearOnEveryFrame) clearFlags = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT; - else if (context()->format().alpha()) + else if (ctx->format().alpha()) clearFlags = GL_COLOR_BUFFER_BIT; if (clearFlags) { + if (d_ptr->fbo) + d_ptr->fbo->bind(); + glClearColor(0.0, 0.0, 0.0, 0.0); glClear(clearFlags); + + if (d_ptr->fbo) + d_ptr->fbo->release(); } } |