Ignore:
Timestamp:
Mar 8, 2010, 12:52:58 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.2 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/opengl/qpixmapdata_x11gl_egl.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4040****************************************************************************/
    4141
     42#include <QDebug>
     43
    4244#include <private/qgl_p.h>
    4345#include <private/qegl_p.h>
    4446#include <private/qeglproperties_p.h>
     47
     48#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
    4549#include <private/qpaintengineex_opengl2_p.h>
     50#endif
     51
     52#ifndef QT_OPENGL_ES_2
     53#include <private/qpaintengine_opengl_p.h>
     54#endif
    4655
    4756#include "qpixmapdata_x11gl_p.h"
     
    188197}
    189198
    190 static QGL2PaintEngineEx* qt_gl2_engine_for_pixmaps = 0;
     199#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
     200Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_gl_pixmap_2_engine)
     201#endif
     202
     203#ifndef QT_OPENGL_ES_2
     204Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_gl_pixmap_engine)
     205#endif
     206
    191207
    192208QPaintEngine* QX11GLPixmapData::paintEngine() const
     
    203219    }
    204220
    205     if (!qt_gl2_engine_for_pixmaps)
    206         qt_gl2_engine_for_pixmaps = new QGL2PaintEngineEx();
     221    QPaintEngine* engine;
     222
     223#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL)
     224    engine = qt_gl_pixmap_engine();
     225#elif defined(QT_OPENGL_ES_2)
     226    engine = qt_gl_pixmap_2_engine();
     227#else
     228    if (qt_gl_preferGL2Engine())
     229        engine = qt_gl_pixmap_2_engine();
     230    else
     231        engine = qt_gl_pixmap_engine();
     232#endif
     233
     234
    207235
    208236    // Support multiple painters on multiple pixmaps simultaniously
    209     if (qt_gl2_engine_for_pixmaps->isActive()) {
     237    if (engine->isActive()) {
    210238        qWarning("Pixmap paint engine already active");
    211         QPaintEngine* engine = new QGL2PaintEngineEx();
     239
     240#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL)
     241        engine = new QOpenGLPaintEngine;
     242#elif defined(QT_OPENGL_ES_2)
     243        engine = new QGL2PaintEngineEx;
     244#else
     245        if (qt_gl_preferGL2Engine())
     246            engine = new QGL2PaintEngineEx;
     247        else
     248            engine = new QOpenGLPaintEngine;
     249#endif
     250
    212251        engine->setAutoDestruct(true);
    213252        return engine;
    214253    }
    215254
    216     return qt_gl2_engine_for_pixmaps;
     255    return engine;
    217256}
    218257
Note: See TracChangeset for help on using the changeset viewer.