// #include "qbezier_p.h"
#include "qoutlinemapper_p.h"
-#if defined(Q_WS_WIN)
+#if defined(Q_OS_WIN)
# include <qt_windows.h>
# include <qvarlengtharray.h>
# include <private/qfontengine_p.h>
# include <private/qfontengine_ft_p.h>
#endif
-#if defined(Q_WS_WIN64)
+#if defined(Q_OS_WIN64)
# include <malloc.h>
#endif
#include <limits.h>
// 4 pixels.
#define int_dim(pos, dim) (int(pos+dim) - int(pos))
-#ifdef Q_WS_WIN
-extern bool qt_cleartype_enabled;
-#endif
+#ifdef Q_OS_WIN
+
+static inline bool winClearTypeFontsEnabled()
+{
+ UINT result = 0;
+ SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &result, 0);
+ return result == FE_FONTSMOOTHINGCLEARTYPE;
+}
+
+bool QRasterPaintEngine::clearTypeFontsEnabled()
+{
+ static const bool result = winClearTypeFontsEnabled();
+ return result;
+}
+
+#endif // Q_OS_WIN
#ifdef Q_WS_MAC
extern bool qt_applefontsmoothing_enabled;
Q_D(QRasterPaintEngine);
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
d->hdc = 0;
#endif
}
#endif
-#if defined(Q_WS_WIN)
+#if defined(Q_OS_WIN)
d->isPlain45DegreeRotation = true;
#endif
if (d->mono_surface)
d->glyphCacheType = QFontEngineGlyphCache::Raster_Mono;
-#if defined(Q_WS_WIN)
- else if (qt_cleartype_enabled)
+#if defined(Q_OS_WIN)
+ else if (clearTypeFontsEnabled())
#elif defined (Q_WS_MAC)
else if (qt_applefontsmoothing_enabled)
#else
ensureOutlineMapper();
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
Q_D(QRasterPaintEngine);
d->isPlain45DegreeRotation = false;
if (txop >= QTransform::TxRotate) {
ensurePen();
ensureState();
-#if defined (Q_WS_WIN) || defined(Q_WS_MAC)
+#if defined (Q_OS_WIN) || defined(Q_WS_MAC)
bool drawCached = true;
// ### cases we should delegate painting to the font engine
// ### directly...
-#if defined(Q_WS_WIN) && !defined(Q_WS_WINCE)
- QFontEngine::Type fontEngineType = ti.fontEngine->type();
+/*
+ #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+ conQFontEngine::Type fontEngineType = ti.fontEngine->type();
// qDebug() << "type" << fontEngineType << s->matrix.type();
if ((fontEngineType == QFontEngine::Win && !((QFontEngineWin *) ti.fontEngine)->ttf && s->matrix.type() > QTransform::TxTranslate)
|| (s->matrix.type() <= QTransform::TxTranslate
drawCached = false;
}
#else
+*/
if (s->matrix.type() > QTransform::TxTranslate)
drawCached = false;
-#endif
+// #endif
if (drawCached) {
QRasterPaintEngineState *s = state();
return;
}
-#elif defined (Q_OS_SYMBIAN) && defined(QT_NO_FREETYPE) // Q_WS_WIN || Q_WS_MAC
+#elif defined (Q_OS_SYMBIAN) && defined(QT_NO_FREETYPE) // Q_OS_WIN || Q_WS_MAC
if (s->matrix.type() <= QTransform::TxTranslate
|| (s->matrix.type() == QTransform::TxScale
&& (qFuzzyCompare(s->matrix.m11(), s->matrix.m22())))) {
drawGlyphsS60(p, ti);
return;
}
-#else // Q_WS_WIN || Q_WS_MAC
+#else // Q_OS_WIN || Q_WS_MAC
QFontEngine *fontEngine = ti.fontEngine;
}
#endif
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
/*!
\internal
*/
const int rasterPoolInitialSize = MINIMUM_POOL_SIZE;
int rasterPoolSize = rasterPoolInitialSize;
unsigned char *rasterPoolBase;
-#if defined(Q_WS_WIN64)
+#if defined(Q_OS_WIN64)
rasterPoolBase =
// We make use of setjmp and longjmp in qgrayraster.c which requires
// 16-byte alignment, hence we hardcode this requirement here..
rendered_spans += q_gray_rendered_spans(*grayRaster.data());
-#if defined(Q_WS_WIN64)
+#if defined(Q_OS_WIN64)
_aligned_free(rasterPoolBase);
#else
if (rasterPoolBase != rasterPoolOnStack) // initially on the stack
rasterPoolSize = new_size;
rasterPoolBase =
-#if defined(Q_WS_WIN64)
+#if defined(Q_OS_WIN64)
// We make use of setjmp and longjmp in qgrayraster.c which requires
// 16-byte alignment, hence we hardcode this requirement here..
(unsigned char *) _aligned_malloc(rasterPoolSize, sizeof(void*) * 2);
}
}
-#if defined(Q_WS_WIN64)
+#if defined(Q_OS_WIN64)
_aligned_free(rasterPoolBase);
#else
if (rasterPoolBase != rasterPoolOnStack) // initially on the stack