diff -r b72c6db6890b -r 5dc02b23752f src/opengl/qglpaintdevice.cpp --- a/src/opengl/qglpaintdevice.cpp Wed Jun 23 19:07:03 2010 +0300 +++ b/src/opengl/qglpaintdevice.cpp Tue Jul 06 15:10:48 2010 +0300 @@ -48,14 +48,10 @@ #include #endif -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) #include #endif -#if defined(QT_OPENGL_ES_1_CL) -#include "qgl_cl_p.h" -#endif - QT_BEGIN_NAMESPACE QGLPaintDevice::QGLPaintDevice() @@ -67,6 +63,22 @@ { } +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() { @@ -163,7 +175,10 @@ float alpha = c.alphaF(); glClearColor(c.redF() * alpha, c.greenF() * alpha, c.blueF() * alpha, alpha); } - glClear(GL_COLOR_BUFFER_BIT); + if (context()->d_func()->workaround_needsFullClearOnEveryFrame) + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); + else + glClear(GL_COLOR_BUFFER_BIT); } } @@ -203,7 +218,7 @@ glpd = &(static_cast(pd)->d_func()->glDevice); break; case QInternal::Pixmap: { -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) QPixmapData* pmd = static_cast(pd)->pixmapData(); if (pmd->classId() == QPixmapData::OpenGLClass) glpd = static_cast(pmd)->glDevice();