Get rid of deprecated functionality in QtOpenGL.
authorSamuel Rødal <samuel.rodal@digia.com>
Thu, 22 Nov 2012 07:35:48 +0000 (08:35 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 22 Nov 2012 21:58:10 +0000 (22:58 +0100)
We will in any case not be able to support this in Qt 5, so best to just
remove it to not give any false impressions.

Change-Id: Ib52e86007b9e6483bd973f13502b078792a9fa40
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
dist/changes-5.0.0
src/opengl/qgl.cpp
src/opengl/qgl.h
src/opengl/qgl_p.h
src/opengl/qgl_qpa.cpp

index 50c9cb9..d64d46e 100644 (file)
@@ -653,6 +653,11 @@ QtOpenGL
 * The default major version of QGLFormat has been changed to 2 to be aligned
   with QSurfaceFormat. Applications that want to use a different version should
   explicitly request it using QGLFormat::setVersion().
+* void QGLContext::generateFontDisplayLists(const QFont& font, int listBase)
+  and int QGLWidget::fontDisplayListBase(const QFont & fnt, int listBase)
+  which were deprecated in Qt 4 have been removed.
+* Previously deprecated default value listBase parameter has been removed from
+  both QGLWidget::renderText() functions.
 
 QtScript
 --------
index e440d5b..accfcae 100644 (file)
@@ -3226,17 +3226,6 @@ void QGLContextPrivate::setCurrentContext(QGLContext *context)
     \sa QGLContext::QGLContext()
 */
 
-/*!
-    \obsolete
-    \fn void QGLContext::generateFontDisplayLists(const QFont& font, int listBase)
-
-    Generates a set of 256 display lists for the 256 first characters
-    in the font \a font. The first list will start at index \a listBase.
-
-    \sa QGLWidget::renderText()
-*/
-
-
 
 /*****************************************************************************
   QGLWidget implementation
@@ -4240,67 +4229,6 @@ QImage QGLWidget::convertToGLFormat(const QImage& img)
     \sa colormap()
 */
 
-
-/*!
-    \obsolete
-
-    Returns the value of the first display list that is generated for
-    the characters in the given \a font. \a listBase indicates the base
-    value used when generating the display lists for the font. The
-    default value is 2000.
-
-    \note This function is not supported on OpenGL/ES systems.
-*/
-int QGLWidget::fontDisplayListBase(const QFont & font, int listBase)
-{
-#ifndef QT_OPENGL_ES
-    Q_D(QGLWidget);
-    int base;
-
-    if (!d->glcx) { // this can't happen unless we run out of mem
-        return 0;
-    }
-
-    // always regenerate font disp. lists for pixmaps - hw accelerated
-    // contexts can't handle this otherwise
-    bool regenerate = d->glcx->deviceIsPixmap();
-#ifndef QT_NO_FONTCONFIG
-    // font color needs to be part of the font cache key when using
-    // antialiased fonts since one set of glyphs needs to be generated
-    // for each font color
-    QString color_key;
-    if (font.styleStrategy() != QFont::NoAntialias) {
-        GLfloat color[4];
-        glGetFloatv(GL_CURRENT_COLOR, color);
-        color_key.sprintf("%f_%f_%f",color[0], color[1], color[2]);
-    }
-    QString key = font.key() + color_key + QString::number((int) regenerate);
-#else
-    QString key = font.key() + QString::number((int) regenerate);
-#endif
-    if (!regenerate && (d->displayListCache.find(key) != d->displayListCache.end())) {
-        base = d->displayListCache[key];
-    } else {
-        int maxBase = listBase - 256;
-        QMap<QString,int>::ConstIterator it;
-        for (it = d->displayListCache.constBegin(); it != d->displayListCache.constEnd(); ++it) {
-            if (maxBase < it.value()) {
-                maxBase = it.value();
-            }
-        }
-        maxBase += 256;
-        d->glcx->generateFontDisplayLists(font, maxBase);
-        d->displayListCache[key] = maxBase;
-        base = maxBase;
-    }
-    return base;
-#else // QT_OPENGL_ES
-    Q_UNUSED(font);
-    Q_UNUSED(listBase);
-    return 0;
-#endif
-}
-
 #ifndef QT_OPENGL_ES
 
 static void qt_save_gl_state()
@@ -4367,9 +4295,6 @@ static void qt_gl_draw_text(QPainter *p, int x, int y, const QString &str,
    use the glColor() call (or the qglColor() convenience function),
    just before the renderText() call.
 
-   The \a listBase parameter is obsolete and will be removed in a
-   future version of Qt.
-
    \note This function clears the stencil buffer.
 
    \note This function is not supported on OpenGL/ES systems.
@@ -4384,7 +4309,7 @@ static void qt_gl_draw_text(QPainter *p, int x, int y, const QString &str,
    \l{Overpainting Example}{Overpaint} with QPainter::drawText() instead.
 */
 
-void QGLWidget::renderText(int x, int y, const QString &str, const QFont &font, int)
+void QGLWidget::renderText(int x, int y, const QString &str, const QFont &font)
 {
 #ifndef QT_OPENGL_ES
     Q_D(QGLWidget);
@@ -4476,7 +4401,7 @@ void QGLWidget::renderText(int x, int y, const QString &str, const QFont &font,
 
     \l{Overpainting Example}{Overpaint} with QPainter::drawText() instead.
 */
-void QGLWidget::renderText(double x, double y, double z, const QString &str, const QFont &font, int)
+void QGLWidget::renderText(double x, double y, double z, const QString &str, const QFont &font)
 {
 #ifndef QT_OPENGL_ES
     Q_D(QGLWidget);
index 53a775b..ab2fd8d 100644 (file)
@@ -343,7 +343,6 @@ protected:
     void setWindowCreated(bool on);
     bool initialized() const;
     void setInitialized(bool on);
-    void generateFontDisplayLists(const QFont & fnt, int listBase);
 
     uint colorIndex(const QColor& c) const;
     void setValid(bool valid);
@@ -430,9 +429,9 @@ public:
     void  setColormap(const QGLColormap & map);
 
     void renderText(int x, int y, const QString & str,
-                     const QFont & fnt = QFont(), int listBase = 2000);
+                    const QFont & fnt = QFont());
     void renderText(double x, double y, double z, const QString & str,
-                     const QFont & fnt = QFont(), int listBase = 2000);
+                    const QFont & fnt = QFont());
     QPaintEngine *paintEngine() const;
 
     GLuint bindTexture(const QImage &image, GLenum target, GLint format,
@@ -474,7 +473,6 @@ protected:
 
     virtual void glInit();
     virtual void glDraw();
-    int fontDisplayListBase(const QFont & fnt, int listBase = 2000);
 
     QGLWidget(QGLWidgetPrivate &dd,
               const QGLFormat &format = QGLFormat(),
index 6ef4eda..58f6a94 100644 (file)
@@ -150,9 +150,6 @@ public:
     bool autoSwap;
 
     QGLColormap cmap;
-#ifndef QT_OPENGL_ES
-    QMap<QString, int> displayListCache;
-#endif
 
     bool disable_clear_on_painter_begin;
 };
index 594d2b1..f52bece 100644 (file)
@@ -284,12 +284,6 @@ uint QGLContext::colorIndex(const QColor&) const
     return 0;
 }
 
-void QGLContext::generateFontDisplayLists(const QFont & fnt, int listBase)
-{
-    Q_UNUSED(fnt);
-    Q_UNUSED(listBase);
-}
-
 /*
     QGLTemporaryContext implementation
 */