summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl.h
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-09-07 00:18:46 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-09-07 00:18:46 (GMT)
commit6d908473ec1a8c72f4bbb9d772e801024c3a62a0 (patch)
tree235c45a19bbc22d0885ad2eb9b6978731e78569d /src/opengl/qgl.h
parent203158b2444c9eb98714292d057c0c87a037ce3b (diff)
downloadQt-6d908473ec1a8c72f4bbb9d772e801024c3a62a0.zip
Qt-6d908473ec1a8c72f4bbb9d772e801024c3a62a0.tar.gz
Qt-6d908473ec1a8c72f4bbb9d772e801024c3a62a0.tar.bz2
Performance: Convert QGLFormat to use implicit sharing
QGLFormat was being deep-copied many times per frame because of code like this: if (context()->format().doubleBuffer()) { ... This change modifies QGLFormat to use implicit sharing to reduce the overhead of the above type of checks. Reviewed-by: Sarah Smith
Diffstat (limited to 'src/opengl/qgl.h')
-rw-r--r--src/opengl/qgl.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h
index 89f1676..0d72469 100644
--- a/src/opengl/qgl.h
+++ b/src/opengl/qgl.h
@@ -255,6 +255,8 @@ public:
private:
QGLFormatPrivate *d;
+ void detach();
+
friend Q_OPENGL_EXPORT bool operator==(const QGLFormat&, const QGLFormat&);
friend Q_OPENGL_EXPORT bool operator!=(const QGLFormat&, const QGLFormat&);
};
@@ -277,7 +279,6 @@ public:
bool isSharing() const;
void reset();
- // ### Qt 5: make format() return a const ref instead
QGLFormat format() const;
QGLFormat requestedFormat() const;
void setFormat(const QGLFormat& format);
@@ -443,7 +444,6 @@ public:
bool doubleBuffer() const;
void swapBuffers();
- // ### Qt 5: make format() return a const ref instead
QGLFormat format() const;
void setFormat(const QGLFormat& format);