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/qglpaintdevice.cpp

    r769 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)
     
    4949#endif
    5050
    51 #if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
     51#if !defined(QT_OPENGL_ES_1)
    5252#include <private/qpixmapdata_gl_p.h>
    53 #endif
    54 
    55 #if defined(QT_OPENGL_ES_1_CL)
    56 #include "qgl_cl_p.h"
    5753#endif
    5854
     
    6864}
    6965
     66int QGLPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const
     67{
     68    switch(metric) {
     69    case PdmWidth:
     70        return size().width();
     71    case PdmHeight:
     72        return size().height();
     73    case PdmDepth: {
     74        const QGLFormat f = format();
     75        return f.redBufferSize() + f.greenBufferSize() + f.blueBufferSize() + f.alphaBufferSize();
     76    }
     77    default:
     78        qWarning("QGLPaintDevice::metric() - metric %d not known", metric);
     79        return 0;
     80    }
     81}
    7082
    7183void QGLPaintDevice::beginPaint()
     
    164176            glClearColor(c.redF() * alpha, c.greenF() * alpha, c.blueF() * alpha, alpha);
    165177        }
    166         glClear(GL_COLOR_BUFFER_BIT);
     178        if (context()->d_func()->workaround_needsFullClearOnEveryFrame)
     179            glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
     180        else
     181            glClear(GL_COLOR_BUFFER_BIT);
    167182    }
    168183}
     
    204219            break;
    205220        case QInternal::Pixmap: {
    206 #if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
     221#if !defined(QT_OPENGL_ES_1)
    207222            QPixmapData* pmd = static_cast<QPixmap*>(pd)->pixmapData();
    208223            if (pmd->classId() == QPixmapData::OpenGLClass)
Note: See TracChangeset for help on using the changeset viewer.