diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-03-29 09:09:39 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-03-29 09:09:39 (GMT) |
commit | a73af692412630e9a25ae1ddb403413f3d8a1de6 (patch) | |
tree | 21ba754816f65e1f6077060483ad6dc60a43154c /src/opengl | |
parent | 269b61dd08b7e37445f40e3a1d0854bcf85f445b (diff) | |
download | Qt-a73af692412630e9a25ae1ddb403413f3d8a1de6.zip Qt-a73af692412630e9a25ae1ddb403413f3d8a1de6.tar.gz Qt-a73af692412630e9a25ae1ddb403413f3d8a1de6.tar.bz2 |
Added WindowSurfaceFeature enum to QWindowSurface.
Now that we've added hasPreservedContents() it's cleaner to convert the
various features to feature flags, which is also more extensible in case
more flags are needed in the future.
Reviewed-by: Bjørn Erik Nilsen
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/qwindowsurface_gl.cpp | 14 | ||||
-rw-r--r-- | src/opengl/qwindowsurface_gl_p.h | 3 |
2 files changed, 8 insertions, 9 deletions
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index 4682d0d..3815f7b 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -1154,14 +1154,14 @@ QImage *QGLWindowSurface::buffer(const QWidget *widget) return &d_ptr->buffers.last(); } -bool QGLWindowSurface::hasPartialUpdateSupport() const +QWindowSurface::WindowSurfaceFeatures QGLWindowSurface::features() const { - return !d_ptr->destructive_swap_buffers || d_ptr->swap_region_support; -} - -bool QGLWindowSurface::hasPreservedContents() const -{ - return !d_ptr->destructive_swap_buffers; + WindowSurfaceFeatures features = 0; + if (!d_ptr->destructive_swap_buffers || d_ptr->swap_region_support) + features |= PartialUpdates; + if (!d_ptr->destructive_swap_buffers) + features |= PreservedContents; + return features; } QT_END_NAMESPACE diff --git a/src/opengl/qwindowsurface_gl_p.h b/src/opengl/qwindowsurface_gl_p.h index cabb35a..4ad8339 100644 --- a/src/opengl/qwindowsurface_gl_p.h +++ b/src/opengl/qwindowsurface_gl_p.h @@ -108,8 +108,7 @@ public: QImage *buffer(const QWidget *widget); - bool hasPartialUpdateSupport() const; - bool hasPreservedContents() const; + WindowSurfaceFeatures features() const; QGLContext *context() const; |