42 #include <private/qglpaintdevice_p.h> 43 #include <private/qgl_p.h> 44 #include <private/qglpixelbuffer_p.h> 45 #include <private/qglframebufferobject_p.h> 47 #include <private/qpixmapdata_x11gl_p.h> 50 #if !defined(QT_OPENGL_ES_1) 51 #include <private/qpixmapdata_gl_p.h> 52 #include <private/qwindowsurface_gl_p.h> 78 qWarning(
"QGLPaintDevice::metric() - metric %d not known", metric);
145 return context()->d_func()->reqFormat.alpha();
161 return glWidget->paintEngine();
172 if (!glWidget->d_func()->disable_clear_on_painter_begin && glWidget->autoFillBackground()) {
174 glClearColor(0.0, 0.0, 0.0, 0.0);
176 const QColor &
c = glWidget->palette().brush(glWidget->backgroundRole()).color();
178 glClearColor(c.
redF() * alpha, c.
greenF() * alpha, c.
blueF() * alpha, alpha);
180 if (
context()->d_func()->workaround_needsFullClearOnEveryFrame)
189 if (glWidget->autoBufferSwap())
190 glWidget->swapBuffers();
197 return glWidget->size();
202 return const_cast<QGLContext*
>(glWidget->context());
213 Q_ASSERT(qobject_cast<QGLWidget*>(static_cast<QWidget*>(pd)));
214 glpd = &(
static_cast<QGLWidget*
>(pd)->d_func()->glDevice);
223 #if !defined(QT_OPENGL_ES_1) 226 glpd = static_cast<QGLPixmapData*>(pmd)->glDevice();
229 glpd = static_cast<QX11GLPixmapData*>(pmd);
232 qWarning(
"Pixmap type not supported for GL rendering");
234 qWarning(
"Pixmap render targets not supported on OpenGL ES 1.x");
239 qWarning(
"QGLPaintDevice::getDevice() - Unknown device type %d", pd->
devType());
virtual QGLFormat format() const
The QColor class provides colors based on RGB, HSV or CMYK values.
QScopedPointer< QGLContextPrivate > d_ptr
qreal alphaF() const
Returns the alpha color component of this color.
#define QT_END_NAMESPACE
This macro expands to.
qreal greenF() const
Returns the green color component of this color.
The QGLFramebufferObject class encapsulates an OpenGL framebuffer object.
#define GL_STENCIL_BUFFER_BIT
virtual ~QGLPaintDevice()
#define GL_FRAMEBUFFER_EXT
virtual QSize size() const =0
#define glBindFramebuffer
virtual int devType() const
virtual QGLContext * context() const =0
int metric(QPaintDevice::PaintDeviceMetric metric) const
static const QGLContext * currentContext()
Returns the current context, i.e.
virtual bool alphaRequested() const
int width() const
Returns the width.
#define QT_BEGIN_NAMESPACE
This macro expands to.
virtual void ensureActiveTarget()
QGLFormat format() const
Returns the frame buffer format that was obtained (this may be a subset of what was requested)...
The QGLContext class encapsulates an OpenGL rendering context.
Q_CORE_EXPORT void qWarning(const char *,...)
#define GL_COLOR_BUFFER_BIT
The QGLPixelBuffer class encapsulates an OpenGL pbuffer.
The QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a g...
#define GL_DEPTH_BUFFER_BIT
virtual bool isFlipped() const
virtual void beginPaint()
qreal redF() const
Returns the red color component of this color.
int height() const
Returns the height.
qreal blueF() const
Returns the blue color component of this color.
virtual void makeCurrent()
Makes this context the current OpenGL rendering context.
The QPixmap class is an off-screen image representation that can be used as a paint device...
The QSize class defines the size of a two-dimensional object using integer point precision.
static QGLPaintDevice * getDevice(QPaintDevice *)