Get rid of deprecated functionality in QtOpenGL.

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>
This commit is contained in:
Samuel Rødal 2012-11-22 08:35:48 +01:00 committed by The Qt Project
parent c8c1604e88
commit cc736c6858
5 changed files with 9 additions and 90 deletions

5
dist/changes-5.0.0 vendored
View File

@ -653,6 +653,11 @@ QtOpenGL
* The default major version of QGLFormat has been changed to 2 to be aligned * 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 with QSurfaceFormat. Applications that want to use a different version should
explicitly request it using QGLFormat::setVersion(). 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 QtScript
-------- --------

View File

@ -3226,17 +3226,6 @@ void QGLContextPrivate::setCurrentContext(QGLContext *context)
\sa QGLContext::QGLContext() \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 QGLWidget implementation
@ -4240,67 +4229,6 @@ QImage QGLWidget::convertToGLFormat(const QImage& img)
\sa colormap() \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 #ifndef QT_OPENGL_ES
static void qt_save_gl_state() 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), use the glColor() call (or the qglColor() convenience function),
just before the renderText() call. 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 clears the stencil buffer.
\note This function is not supported on OpenGL/ES systems. \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. \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 #ifndef QT_OPENGL_ES
Q_D(QGLWidget); 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. \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 #ifndef QT_OPENGL_ES
Q_D(QGLWidget); Q_D(QGLWidget);

View File

@ -343,7 +343,6 @@ protected:
void setWindowCreated(bool on); void setWindowCreated(bool on);
bool initialized() const; bool initialized() const;
void setInitialized(bool on); void setInitialized(bool on);
void generateFontDisplayLists(const QFont & fnt, int listBase);
uint colorIndex(const QColor& c) const; uint colorIndex(const QColor& c) const;
void setValid(bool valid); void setValid(bool valid);
@ -430,9 +429,9 @@ public:
void setColormap(const QGLColormap & map); void setColormap(const QGLColormap & map);
void renderText(int x, int y, const QString & str, 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, 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; QPaintEngine *paintEngine() const;
GLuint bindTexture(const QImage &image, GLenum target, GLint format, GLuint bindTexture(const QImage &image, GLenum target, GLint format,
@ -474,7 +473,6 @@ protected:
virtual void glInit(); virtual void glInit();
virtual void glDraw(); virtual void glDraw();
int fontDisplayListBase(const QFont & fnt, int listBase = 2000);
QGLWidget(QGLWidgetPrivate &dd, QGLWidget(QGLWidgetPrivate &dd,
const QGLFormat &format = QGLFormat(), const QGLFormat &format = QGLFormat(),

View File

@ -150,9 +150,6 @@ public:
bool autoSwap; bool autoSwap;
QGLColormap cmap; QGLColormap cmap;
#ifndef QT_OPENGL_ES
QMap<QString, int> displayListCache;
#endif
bool disable_clear_on_painter_begin; bool disable_clear_on_painter_begin;
}; };

View File

@ -284,12 +284,6 @@ uint QGLContext::colorIndex(const QColor&) const
return 0; return 0;
} }
void QGLContext::generateFontDisplayLists(const QFont & fnt, int listBase)
{
Q_UNUSED(fnt);
Q_UNUSED(listBase);
}
/* /*
QGLTemporaryContext implementation QGLTemporaryContext implementation
*/ */