Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/opengl/qgraphicssystem_gl.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4141
    4242#include "qgraphicssystem_gl_p.h"
     43#include <QGraphicsView>
    4344
    4445#include "private/qpixmap_raster_p.h"
     
    4849#include <private/qwindowsurface_raster_p.h>
    4950
    50 #if defined(Q_WS_X11) && defined(QT_OPENGL_ES)
     51#if defined(Q_WS_X11) && !defined(QT_NO_EGL)
    5152#include "private/qpixmapdata_x11gl_p.h"
    5253#include "private/qwindowsurface_x11gl_p.h"
     
    5960QPixmapData *QGLGraphicsSystem::createPixmapData(QPixmapData::PixelType type) const
    6061{
    61 #if defined(Q_WS_X11) && defined(QT_OPENGL_ES)
    62     if (type == QPixmapData::PixmapType && QX11GLPixmapData::hasX11GLPixmaps())
    63         return new QX11GLPixmapData();
    64 #endif
    65 
    6662    return new QGLPixmapData(type);
    6763}
     
    7773#endif
    7874
    79 #if defined(Q_WS_X11) && defined(QT_OPENGL_ES)
    80     if (QX11GLPixmapData::hasX11GLPixmaps())
    81         return new QX11GLWindowSurface(widget);
     75#if defined(Q_WS_X11) && !defined(QT_NO_EGL)
     76    if (m_useX11GL && QX11GLPixmapData::hasX11GLPixmaps()) {
     77        // If the widget is a QGraphicsView which will be re-drawing the entire
     78        // scene each frame anyway, we should use QGLWindowSurface as this may
     79        // provide proper buffer flipping, which should be faster than QX11GL's
     80        // blitting approach:
     81        QGraphicsView* qgv = qobject_cast<QGraphicsView*>(widget);
     82        if (qgv && qgv->viewportUpdateMode() == QGraphicsView::FullViewportUpdate)
     83            return new QGLWindowSurface(widget);
     84        else
     85            return new QX11GLWindowSurface(widget);
     86    }
    8287#endif
    8388
Note: See TracChangeset for help on using the changeset viewer.