OpenGL: Remove Q_WS_ defines.
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>
Mon, 17 Oct 2011 10:05:57 +0000 (12:05 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 18 Oct 2011 06:21:19 +0000 (08:21 +0200)
Change-Id: I351a910968ff7f46550af5b3742959cb0cab540d
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
src/opengl/qgl.h
src/opengl/qgl_p.h
src/opengl/qglextensions_p.h
src/opengl/qglfunctions.h

index e6a12cd..b6168d6 100644 (file)
 
 QT_BEGIN_NAMESPACE
 
-#if defined(Q_WS_WIN)
-extern Q_GUI_EXPORT bool qt_cleartype_enabled;
-#endif
 
-#ifdef Q_WS_MAC
-extern bool qt_applefontsmoothing_enabled;
-#endif
 
 Q_GUI_EXPORT QImage qt_imageForBrush(int brushStyle, bool invert);
 
@@ -1560,13 +1554,6 @@ namespace {
 
 }
 
-#if defined(Q_WS_WIN)
-static bool fontSmoothingApproximately(qreal target)
-{
-    extern Q_GUI_EXPORT qreal qt_fontsmoothing_gamma; // qapplication_win.cpp
-    return (qAbs(qt_fontsmoothing_gamma - target) < 0.2);
-}
-#endif
 
 // #define QT_OPENGL_DRAWCACHEDGLYPHS_INDEX_ARRAY_VBO
 
@@ -1830,19 +1817,6 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp
     }
 
     bool srgbFrameBufferEnabled = false;
-    if (ctx->d_ptr->extension_flags & QGLExtensions::SRGBFrameBuffer) {
-#if defined(Q_WS_MAC)
-        if (glyphType == QFontEngineGlyphCache::Raster_RGBMask)
-#elif defined(Q_WS_WIN)
-        if (glyphType != QFontEngineGlyphCache::Raster_RGBMask || fontSmoothingApproximately(2.1))
-#else
-        if (false)
-#endif
-        {
-            glEnable(FRAMEBUFFER_SRGB_EXT);
-            srgbFrameBufferEnabled = true;
-        }
-    }
 
 #if defined(QT_OPENGL_DRAWCACHEDGLYPHS_INDEX_ARRAY_VBO)
     glDrawElements(GL_TRIANGLE_STRIP, 6 * numGlyphs, GL_UNSIGNED_SHORT, 0);
@@ -2024,13 +1998,6 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
     d->glyphCacheType = QFontEngineGlyphCache::Raster_A8;
 
 #if !defined(QT_OPENGL_ES_2)
-#if defined(Q_WS_WIN)
-    if (qt_cleartype_enabled
-        && (fontSmoothingApproximately(1.0) || fontSmoothingApproximately(2.1)))
-#endif
-#if defined(Q_WS_MAC)
-    if (qt_applefontsmoothing_enabled)
-#endif
         d->glyphCacheType = QFontEngineGlyphCache::Raster_RGBMask;
 #endif
 
index af6cb53..a6f7f67 100644 (file)
@@ -45,9 +45,6 @@
 
 QT_BEGIN_NAMESPACE
 
-#ifdef Q_WS_WIN
-extern Q_GUI_EXPORT bool qt_cleartype_enabled;
-#endif
 
 QBasicAtomicInt qgltextureglyphcache_serial_number = Q_BASIC_ATOMIC_INITIALIZER(1);
 
index 863e590..5f16444 100644 (file)
@@ -83,9 +83,6 @@ QT_BEGIN_NAMESPACE
 QT_MODULE(OpenGL)
 
 
-#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
-class QGLCmap;
-#endif
 
 class QPixmap;
 class QGLWidgetPrivate;
@@ -371,13 +368,6 @@ private:
     friend class QGLExtensions;
     friend class QGLTexture;
     friend QGLFormat::OpenGLVersionFlags QGLFormat::openGLVersionFlags();
-#ifdef Q_WS_MAC
-public:
-    void updatePaintDevice();
-private:
-    friend class QMacGLWindowChangeEvent;
-    friend QGLContextPrivate *qt_phonon_get_dptr(const QGLContext *);
-#endif
     friend class QGLFramebufferObject;
     friend class QGLFramebufferObjectPrivate;
     friend class QGLFBOGLPaintDevice;
@@ -493,9 +483,6 @@ protected:
 private:
     Q_DISABLE_COPY(QGLWidget)
 
-#ifdef Q_WS_MAC
-    friend class QMacGLWindowChangeEvent;
-#endif
     friend class QGLDrawable;
     friend class QGLPixelBuffer;
     friend class QGLPixelBufferPrivate;
index 148cd68..2f8b677 100644 (file)
@@ -72,20 +72,6 @@ QT_BEGIN_NAMESPACE
 class QGLContext;
 class QGLOverlayWidget;
 class QPixmap;
-#ifdef Q_WS_MAC
-# ifdef qDebug
-#   define old_qDebug qDebug
-#   undef qDebug
-# endif
-QT_BEGIN_INCLUDE_NAMESPACE
-QT_END_INCLUDE_NAMESPACE
-# ifdef old_qDebug
-#   undef qDebug
-#   define qDebug QT_NO_QDEBUG_MACRO
-#   undef old_qDebug
-# endif
-class QMacWindowChangeEvent;
-#endif
 
 QT_BEGIN_INCLUDE_NAMESPACE
 #include <QtOpenGL/private/qglextensions_p.h>
index 991fbba..d391a99 100644 (file)
@@ -54,7 +54,6 @@
 //
 
 // extension prototypes
-#ifndef Q_WS_MAC
 # ifndef APIENTRYP
 #   ifdef APIENTRY
 #     define APIENTRYP APIENTRY *
 #     define APIENTRYP *
 #   endif
 # endif
-#else
-# define APIENTRY
-# define APIENTRYP *
-#endif
 
 #include <QtCore/qglobal.h>
 
index e789d40..3b50a1c 100644 (file)
@@ -59,11 +59,7 @@ QT_MODULE(OpenGL)
 typedef ptrdiff_t qgl_GLintptr;
 typedef ptrdiff_t qgl_GLsizeiptr;
 
-#ifdef Q_WS_WIN
-#    define QGLF_APIENTRY APIENTRY
-#endif
 
-#ifndef Q_WS_MAC
 # ifndef QGLF_APIENTRYP
 #   ifdef QGLF_APIENTRY
 #     define QGLF_APIENTRYP QGLF_APIENTRY *
@@ -72,10 +68,6 @@ typedef ptrdiff_t qgl_GLsizeiptr;
 #     define QGLF_APIENTRYP *
 #   endif
 # endif
-#else
-# define QGLF_APIENTRY
-# define QGLF_APIENTRYP *
-#endif
 
 struct QGLFunctionsPrivate;