src/opengl/qglframebufferobject.cpp
changeset 30 5dc02b23752f
parent 18 2f34d5167611
child 33 3e2da88830cd
equal deleted inserted replaced
29:b72c6db6890b 30:5dc02b23752f
    42 #include "qglframebufferobject.h"
    42 #include "qglframebufferobject.h"
    43 #include "qglframebufferobject_p.h"
    43 #include "qglframebufferobject_p.h"
    44 
    44 
    45 #include <qdebug.h>
    45 #include <qdebug.h>
    46 #include <private/qgl_p.h>
    46 #include <private/qgl_p.h>
    47 #if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
    47 #if !defined(QT_OPENGL_ES_1)
    48 #include <private/qpaintengineex_opengl2_p.h>
    48 #include <private/qpaintengineex_opengl2_p.h>
    49 #endif
    49 #endif
    50 
    50 
    51 #ifndef QT_OPENGL_ES_2
    51 #ifndef QT_OPENGL_ES_2
    52 #include <private/qpaintengine_opengl_p.h>
    52 #include <private/qpaintengine_opengl_p.h>
    53 #endif
    53 #endif
    54 
    54 
    55 #include <qglframebufferobject.h>
    55 #include <qglframebufferobject.h>
    56 #include <qlibrary.h>
    56 #include <qlibrary.h>
    57 #include <qimage.h>
    57 #include <qimage.h>
    58 
       
    59 #ifdef QT_OPENGL_ES_1_CL
       
    60 #include "qgl_cl_p.h"
       
    61 #endif
       
    62 
    58 
    63 QT_BEGIN_NAMESPACE
    59 QT_BEGIN_NAMESPACE
    64 
    60 
    65 extern QImage qt_gl_read_framebuffer(const QSize&, bool, bool);
    61 extern QImage qt_gl_read_framebuffer(const QSize&, bool, bool);
    66 
    62 
   130 
   126 
   131     By default the format specifies a non-multisample framebuffer object with no
   127     By default the format specifies a non-multisample framebuffer object with no
   132     attachments, texture target \c GL_TEXTURE_2D, and internal format \c GL_RGBA8.
   128     attachments, texture target \c GL_TEXTURE_2D, and internal format \c GL_RGBA8.
   133     On OpenGL/ES systems, the default internal format is \c GL_RGBA.
   129     On OpenGL/ES systems, the default internal format is \c GL_RGBA.
   134 
   130 
   135     \sa samples(), attachment(), target(), internalTextureFormat()
   131     \sa samples(), attachment(), internalTextureFormat()
   136 */
   132 */
   137 
   133 
   138 QGLFramebufferObjectFormat::QGLFramebufferObjectFormat()
   134 QGLFramebufferObjectFormat::QGLFramebufferObjectFormat()
   139 {
   135 {
   140     d = new QGLFramebufferObjectFormatPrivate;
   136     d = new QGLFramebufferObjectFormatPrivate;
   985         const_cast<QGLFramebufferObject *>(this)->release();
   981         const_cast<QGLFramebufferObject *>(this)->release();
   986 
   982 
   987     return image;
   983     return image;
   988 }
   984 }
   989 
   985 
   990 #if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
   986 #if !defined(QT_OPENGL_ES_1)
   991 Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_buffer_2_engine)
   987 Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_buffer_2_engine)
   992 #endif
   988 #endif
   993 
   989 
   994 #ifndef QT_OPENGL_ES_2
   990 #ifndef QT_OPENGL_ES_2
   995 Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_buffer_engine)
   991 Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_buffer_engine)
  1000 {
   996 {
  1001     Q_D(const QGLFramebufferObject);
   997     Q_D(const QGLFramebufferObject);
  1002     if (d->engine)
   998     if (d->engine)
  1003         return d->engine;
   999         return d->engine;
  1004 
  1000 
  1005 #if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
  1001 #if !defined(QT_OPENGL_ES_1)
  1006 #if !defined (QT_OPENGL_ES_2)
  1002 #if !defined (QT_OPENGL_ES_2)
  1007     if (qt_gl_preferGL2Engine()) {
  1003     if (qt_gl_preferGL2Engine()) {
  1008 #endif
  1004 #endif
  1009         QPaintEngine *engine = qt_buffer_2_engine();
  1005         QPaintEngine *engine = qt_buffer_2_engine();
  1010         if (engine->isActive() && engine->paintDevice() != this) {
  1006         if (engine->isActive() && engine->paintDevice() != this) {