summaryrefslogtreecommitdiffstats
path: root/src/opengl/qglpaintdevice.cpp
diff options
context:
space:
mode:
authorTom Cooksey <thomas.cooksey@nokia.com>2010-04-20 09:09:32 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2010-04-22 14:33:03 (GMT)
commit4cb45486f952f5d9df7a2d954073bdbc5c5ee893 (patch)
tree41b9ffc39e7fae36b7912d3eabbae5f9d438c5e5 /src/opengl/qglpaintdevice.cpp
parente602ea2a7eee7ec427ba3faa7c450a29a75fb98b (diff)
downloadQt-4cb45486f952f5d9df7a2d954073bdbc5c5ee893.zip
Qt-4cb45486f952f5d9df7a2d954073bdbc5c5ee893.tar.gz
Qt-4cb45486f952f5d9df7a2d954073bdbc5c5ee893.tar.bz2
Implement QGLPaintDevice::metric()
Reviewed-By: TrustMe
Diffstat (limited to 'src/opengl/qglpaintdevice.cpp')
-rw-r--r--src/opengl/qglpaintdevice.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/opengl/qglpaintdevice.cpp b/src/opengl/qglpaintdevice.cpp
index 2d82222..e874e85 100644
--- a/src/opengl/qglpaintdevice.cpp
+++ b/src/opengl/qglpaintdevice.cpp
@@ -63,6 +63,22 @@ QGLPaintDevice::~QGLPaintDevice()
{
}
+int QGLPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const
+{
+ switch(metric) {
+ case PdmWidth:
+ return size().width();
+ case PdmHeight:
+ return size().height();
+ case PdmDepth: {
+ const QGLFormat f = format();
+ return f.redBufferSize() + f.greenBufferSize() + f.blueBufferSize() + f.alphaBufferSize();
+ }
+ default:
+ qWarning("QGLPaintDevice::metric() - metric %d not known", metric);
+ return 0;
+ }
+}
void QGLPaintDevice::beginPaint()
{