summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-05-26 08:58:30 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-05-27 10:43:18 (GMT)
commit855022d6108f6b3c90832e742217c50550af717d (patch)
tree8cf799d7c939ee7cb9434cf1d3a100e898af6ce6 /src/opengl/qgl.cpp
parent15c8f565973592c9929cdd6fc83d61641aa63afa (diff)
downloadQt-855022d6108f6b3c90832e742217c50550af717d.zip
Qt-855022d6108f6b3c90832e742217c50550af717d.tar.gz
Qt-855022d6108f6b3c90832e742217c50550af717d.tar.bz2
Avoided expensive image upload for GL pixmap backend for QPixmap::fill.
In the fill case we can simply set a flag saying the pixmap needs to be filled, and then when painting on the pixmap we start by filling the background using glClear via the existing QGLDrawable::autoFillBackground interface.
Diffstat (limited to 'src/opengl/qgl.cpp')
-rw-r--r--src/opengl/qgl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 62a592a..0be70d7 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -4525,6 +4525,8 @@ QColor QGLDrawable::backgroundColor() const
{
if (widget)
return widget->palette().brush(widget->backgroundRole()).color();
+ else if (pixmapData)
+ return pixmapData->fillColor();
return QApplication::palette().brush(QPalette::Background).color();
}
@@ -4547,6 +4549,8 @@ bool QGLDrawable::autoFillBackground() const
{
if (widget)
return widget->autoFillBackground();
+ else if (pixmapData)
+ return pixmapData->needsFill();
else
return false;
}