diff options
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qbrush.h | 3 | ||||
-rw-r--r-- | src/gui/painting/qdrawhelper.cpp | 21 | ||||
-rw-r--r-- | src/gui/painting/qdrawhelper_arm_simd.cpp | 217 | ||||
-rw-r--r-- | src/gui/painting/qpaintdevice.cpp | 7 | ||||
-rw-r--r-- | src/gui/painting/qpaintdevice.h | 3 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine.cpp | 26 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine.h | 11 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 115 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_raster_p.h | 7 | ||||
-rw-r--r-- | src/gui/painting/qpaintengineex.cpp | 9 | ||||
-rw-r--r-- | src/gui/painting/qpainter.cpp | 6 | ||||
-rw-r--r-- | src/gui/painting/qpainterpath.cpp | 3 | ||||
-rw-r--r-- | src/gui/painting/qpdf.cpp | 12 | ||||
-rw-r--r-- | src/gui/painting/qrasterizer_p.h | 3 | ||||
-rw-r--r-- | src/gui/painting/qregion.cpp | 63 | ||||
-rw-r--r-- | src/gui/painting/qregion.h | 42 | ||||
-rw-r--r-- | src/gui/painting/qtextureglyphcache.cpp | 40 |
17 files changed, 2 insertions, 586 deletions
diff --git a/src/gui/painting/qbrush.h b/src/gui/painting/qbrush.h index edb092c035..80d9b43f1f 100644 --- a/src/gui/painting/qbrush.h +++ b/src/gui/painting/qbrush.h @@ -127,9 +127,6 @@ public: inline bool operator!=(const QBrush &b) const { return !(operator==(b)); } private: -#if defined(Q_WS_X11) - friend class QX11PaintEngine; -#endif friend class QRasterPaintEngine; friend class QRasterPaintEnginePrivate; friend struct QSpanData; diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index cfd9934e9b..c4c5846ed9 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -6557,29 +6557,12 @@ static void qt_alphamapblit_quint16(QRasterBuffer *rasterBuffer, void qt_build_pow_tables() { qreal smoothing = qreal(1.7); -#ifdef Q_WS_MAC - // decided by testing a few things on an iMac, should probably get this from the - // system... - smoothing = qreal(2.0); -#endif -#ifdef Q_WS_WIN - extern qreal qt_fontsmoothing_gamma; // qapplication_win.cpp - smoothing = qt_fontsmoothing_gamma; -#endif -#ifdef Q_WS_X11 - Q_UNUSED(smoothing); - for (int i=0; i<256; ++i) { - qt_pow_rgb_gamma[i] = uchar(i); - qt_pow_rgb_invgamma[i] = uchar(i); - } -#else for (int i=0; i<256; ++i) { qt_pow_rgb_gamma[i] = uchar(qRound(qPow(i / qreal(255.0), smoothing) * 255)); qt_pow_rgb_invgamma[i] = uchar(qRound(qPow(i / qreal(255.), 1 / smoothing) * 255)); } -#endif #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) const qreal gray_gamma = 2.31; @@ -6599,10 +6582,6 @@ static inline void rgbBlendPixel(quint32 *dst, int coverage, int sr, int sg, int int db = qBlue(*dst); if (da != 255 -#if defined (Q_WS_WIN) - // Work around GDI messing up alpha channel - && qRed(*dst) <= da && qBlue(*dst) <= da && qGreen(*dst) <= da -#endif ) { int a = qGray(coverage); diff --git a/src/gui/painting/qdrawhelper_arm_simd.cpp b/src/gui/painting/qdrawhelper_arm_simd.cpp index 7c664372c3..48b67f4020 100644 --- a/src/gui/painting/qdrawhelper_arm_simd.cpp +++ b/src/gui/painting/qdrawhelper_arm_simd.cpp @@ -46,223 +46,7 @@ #ifdef QT_HAVE_ARM_SIMD -#if defined(Q_OS_SYMBIAN) -#if !defined(__SWITCH_TO_ARM) -#ifdef __MARM_THUMB__ -#ifndef __ARMCC__ -#define __SWITCH_TO_ARM asm("push {r0} ");\ - asm("add r0, pc, #4 ");\ - asm("bx r0 ");\ - asm("nop ");\ - asm(".align 2 ");\ - asm(".code 32 ");\ - asm("ldr r0, [sp], #4 ") -#define __END_ARM asm(".code 16 ") -#else -#define __SWITCH_TO_ARM asm(".code 32 "); -#define __END_ARM -#endif // __ARMCC__ -#else -#define __SWITCH_TO_ARM -#define __END_ARM -#endif //__MARM_THUMB__ -#endif -#endif -#if defined(Q_OS_SYMBIAN) && defined(Q_CC_RVCT) -__asm void qt_blend_argb32_on_argb32_arm_simd(uchar *destPixels, int dbpl, - const uchar *srcPixels, int sbpl, - int w, int h, - int const_alpha) -{ -#ifndef __ARMCC__ - __SWITCH_TO_ARM; -#else - CODE32 -#endif // __ARMCC__ - - stmfd sp!, {r4-r12, r14} - - // read arguments off the stack - add r8, sp, #10 * 4 - ldmia r8, {r4-r6} - - // adjust dbpl and sbpl - mov r14, #4 - mul r14, r4, r14 - sub r1, r1, r14 - sub r3, r3, r14 - - // load 0xFF00FF00 to r12 - mov r12, #0xFF000000 - add r12, r12, #0xFF00 - - // load 0x800080 to r14 - mov r14, #0x800000 - add r14, r14, #0x80 - - /* - Registers: - r0 dst - r1 dbpl - r2 src - r3 sbpl - r4 w - r5 h - r6 const_alpha - r12 0xFF0000 - r14 0x800080 - */ - - cmp r6, #256 //test if we have fully opaque constant alpha value - bne argb32constalpha // branch if not - -argb32_next_row - - mov r7, r4 - -argb32_next_pixel - - ldr r8, [r2], #4 // load src pixel - - // Negate r8 and extract src alpha - mvn r11, r8 // bitwise not - uxtb r11, r11, ror #24 - - cmp r11, #0 // test for full src opacity (negated) - beq argb32_no_blend - - cmp r11, #255 // test for full src transparency (negated) - addeq r0, #4 - beq argb32_nop - - ldr r9, [r0] // load dst pixel - - // blend - uxtb16 r10, r9 - uxtb16 r6, r9, ror #8 - mla r10, r11, r10, r14 - mla r9, r6, r11, r14 - uxtab16 r10, r10, r10, ror #8 - uxtab16 r9, r9, r9, ror #8 - and r9, r9, r12 - uxtab16 r10, r9, r10, ror #8 - - uqadd8 r8, r10, r8 - -argb32_no_blend - - str r8, [r0], #4 - -argb32_nop - - subs r7, r7, #1 - bgt argb32_next_pixel - - add r0, r0, r1 // dest = dest + dbpl - add r2, r2, r3 // src = src + sbpl - - subs r5, r5, #1 - bgt argb32_next_row - - b argb32_blend_exit - -argb32constalpha - - cmp r6, #0 - beq argb32_blend_exit - - ; const_alpha = (const_alpha * 255) >> 8; - mov r11, #255 - mul r6, r6, r11 - mov r11, r6, lsr #8 - -argb32constalpha_next_row - - mov r7, r4 - -argb32constalpha_next_pixel - - ldr r9, [r2], #4 // load src pixel - - // blend - uxtb16 r10, r9 - uxtb16 r6, r9, ror #8 - mla r10, r11, r10, r14 - mla r9, r6, r11, r14 - uxtab16 r10, r10, r10, ror #8 - uxtab16 r9, r9, r9, ror #8 - and r9, r9, r12 - uxtab16 r8, r9, r10, ror #8 - - ldr r9, [r0] // load dst pixel - - // blend - uxtb16 r10, r9 - uxtb16 r6, r9, ror #8 - - // Negate r8 and extract src alpha - mvn r9, r8 // bitwise not - uxtb r9, r9, ror #24 - - mla r10, r9, r10, r14 - mla r9, r6, r9, r14 - uxtab16 r10, r10, r10, ror #8 - uxtab16 r9, r9, r9, ror #8 - and r9, r9, r12 - uxtab16 r10, r9, r10, ror #8 - - uqadd8 r8, r10, r8 - - str r8, [r0], #4 - - subs r7, r7, #1 - bgt argb32constalpha_next_pixel - - add r0, r0, r1 // dest = dest + dbpl - add r2, r2, r3 // src = src + sbpl - - subs r5, r5, #1 - bgt argb32constalpha_next_row - -argb32_blend_exit - - // Restore registers - ldmfd sp!, {r4-r12, lr} - bx lr - - __END_ARM -} - -void qt_blend_rgb32_on_rgb32_arm_simd(uchar *destPixels, int dbpl, - const uchar *srcPixels, int sbpl, - int w, int h, - int const_alpha) -{ - if (const_alpha != 256) { - qt_blend_argb32_on_argb32_arm_simd(destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha); - return; - } - - const uint *src = (const uint *) srcPixels; - uint *dst = (uint *) destPixels; - if (w <= 64) { - for (int y=0; y<h; ++y) { - qt_memconvert(dst, src, w); - dst = (quint32 *)(((uchar *) dst) + dbpl); - src = (const quint32 *)(((const uchar *) src) + sbpl); - } - } else { - int len = w * 4; - for (int y=0; y<h; ++y) { - memcpy(dst, src, len); - dst = (quint32 *)(((uchar *) dst) + dbpl); - src = (const quint32 *)(((const uchar *) src) + sbpl); - } - } -} - -#else // defined(Q_OS_SYMBIAN) && defined(Q_CC_RVCT) // TODO: add GNU assembler instructions and support for other platforms. // Default to C code for now @@ -327,6 +111,5 @@ void qt_blend_rgb32_on_rgb32_arm_simd(uchar *destPixels, int dbpl, } } -#endif #endif // QT_HAVE_ARMV_SIMD diff --git a/src/gui/painting/qpaintdevice.cpp b/src/gui/painting/qpaintdevice.cpp index fc5cdcdaa5..857f147231 100644 --- a/src/gui/painting/qpaintdevice.cpp +++ b/src/gui/painting/qpaintdevice.cpp @@ -56,13 +56,6 @@ QPaintDevice::~QPaintDevice() } -#ifndef Q_WS_QPA -int QPaintDevice::metric(PaintDeviceMetric) const -{ - qWarning("QPaintDevice::metrics: Device has no metric information"); - return 0; -} -#endif void QPaintDevice::init(QPainter *) const { diff --git a/src/gui/painting/qpaintdevice.h b/src/gui/painting/qpaintdevice.h index 95509a9daa..476f883645 100644 --- a/src/gui/painting/qpaintdevice.h +++ b/src/gui/painting/qpaintdevice.h @@ -51,9 +51,6 @@ QT_BEGIN_NAMESPACE QT_MODULE(Gui) -#if defined(Q_WS_QWS) -class QWSDisplay; -#endif class QPaintEngine; diff --git a/src/gui/painting/qpaintengine.cpp b/src/gui/painting/qpaintengine.cpp index 2545cc7cd9..da97116c6f 100644 --- a/src/gui/painting/qpaintengine.cpp +++ b/src/gui/painting/qpaintengine.cpp @@ -752,9 +752,7 @@ void QPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem) const QTextItemInt &ti = static_cast<const QTextItemInt &>(textItem); QPainterPath path; -#ifndef Q_WS_MAC path.setFillRule(Qt::WindingFill); -#endif if (ti.glyphs.numGlyphs) ti.fontEngine->addOutlineToPath(0, 0, ti.glyphs, &path, ti.flags); if (!path.isEmpty()) { @@ -903,30 +901,6 @@ QPaintDevice *QPaintEngine::paintDevice() const return d_func()->pdev; } -#ifdef Q_WS_WIN -/*! - \internal - - Empty default implementation. -*/ - -HDC QPaintEngine::getDC() const -{ - return 0; -} - - -/*! - \internal - - Empty default implementation. -*/ - -void QPaintEngine::releaseDC(HDC) const -{ -} - -#endif /*! \internal diff --git a/src/gui/painting/qpaintengine.h b/src/gui/painting/qpaintengine.h index 49ceb2a8b3..28c2942930 100644 --- a/src/gui/painting/qpaintengine.h +++ b/src/gui/painting/qpaintengine.h @@ -191,10 +191,6 @@ public: void setSystemRect(const QRect &rect); QRect systemRect() const; -#ifdef Q_WS_WIN - virtual HDC getDC() const; - virtual void releaseDC(HDC hdc) const; -#endif virtual QPoint coordinateOffset() const; @@ -266,14 +262,7 @@ private: friend class QPSPrintEngine; friend class QMacPrintEngine; friend class QMacPrintEnginePrivate; -#ifdef Q_WS_QWS - friend class QtopiaPrintEngine; - friend class QtopiaPrintEnginePrivate; - friend class QProxyFontEngine; -#endif -#ifdef Q_WS_QPA friend class QFontEngineQPA; -#endif friend class QPainter; friend class QPainterPrivate; friend class QWidget; diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 99c17435dc..e49bd229e7 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -75,15 +75,6 @@ # include <qt_windows.h> # include <qvarlengtharray.h> # include <private/qfontengine_p.h> -# if defined(Q_OS_WINCE) -# include "qguifunctions_wince.h" -# endif -#elif defined(Q_WS_MAC) -# include <private/qt_mac_p.h> -# include <private/qpixmap_mac_p.h> -# include <private/qpaintengine_mac_p.h> -#elif defined(Q_OS_SYMBIAN) && defined(QT_NO_FREETYPE) -# include <private/qfontengine_s60_p.h> #endif #if defined(Q_OS_WIN64) @@ -135,9 +126,6 @@ bool QRasterPaintEngine::clearTypeFontsEnabled() #endif // Q_OS_WIN -#ifdef Q_WS_MAC -extern bool qt_applefontsmoothing_enabled; -#endif /******************************************************************************** @@ -482,8 +470,6 @@ bool QRasterPaintEngine::begin(QPaintDevice *device) d->glyphCacheType = QFontEngineGlyphCache::Raster_Mono; #if defined(Q_OS_WIN) else if (clearTypeFontsEnabled()) -#elif defined (Q_WS_MAC) - else if (qt_applefontsmoothing_enabled) #else else if (false) #endif @@ -2789,46 +2775,6 @@ bool QRasterPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, return true; } -#if defined(Q_OS_SYMBIAN) && defined(QT_NO_FREETYPE) -void QRasterPaintEngine::drawGlyphsS60(const QPointF &p, const QTextItemInt &ti) -{ - Q_D(QRasterPaintEngine); - QRasterPaintEngineState *s = state(); - - QFontEngine *fontEngine = ti.fontEngine; - if (fontEngine->type() != QFontEngine::S60FontEngine) { - QPaintEngineEx::drawTextItem(p, ti); - return; - } - - QFontEngineS60 *fe = static_cast<QFontEngineS60 *>(fontEngine); - - QVarLengthArray<QFixedPoint> positions; - QVarLengthArray<glyph_t> glyphs; - QTransform matrix = s->matrix; - matrix.translate(p.x(), p.y()); - if (matrix.type() == QTransform::TxScale) - fe->setFontScale(matrix.m11()); - ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions); - - const QFixed aliasDelta = QFixed::fromReal(aliasedCoordinateDelta); - - for (int i=0; i<glyphs.size(); ++i) { - TOpenFontCharMetrics tmetrics; - const TUint8 *glyphBitmapBytes; - TSize glyphBitmapSize; - fe->getCharacterData(glyphs[i], tmetrics, glyphBitmapBytes, glyphBitmapSize); - const int x = qFloor(positions[i].x + tmetrics.HorizBearingX() + aliasDelta); - const int y = qFloor(positions[i].y - tmetrics.HorizBearingY() + aliasDelta); - alphaPenBlt(glyphBitmapBytes, glyphBitmapSize.iWidth, 8, x, y, glyphBitmapSize.iWidth, glyphBitmapSize.iHeight); - } - - if (matrix.type() == QTransform::TxScale) - fe->setFontScale(1.0); - - return; -} -#endif // Q_OS_SYMBIAN && QT_NO_FREETYPE /*! * Returns true if the rectangle is completely within the current clip @@ -2967,7 +2913,6 @@ void QRasterPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte ensurePen(); ensureState(); -#if defined (Q_WS_WIN) || defined(Q_WS_MAC) || defined(Q_WS_QPA) if (!supportsTransformations(ti.fontEngine)) { QVarLengthArray<QFixedPoint> positions; @@ -2982,36 +2927,6 @@ void QRasterPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte return; } -#elif defined (Q_OS_SYMBIAN) && defined(QT_NO_FREETYPE) // Q_OS_WIN || Q_WS_MAC || Q_WS_QPA - if (s->matrix.type() <= QTransform::TxTranslate - || (s->matrix.type() == QTransform::TxScale - && (qFuzzyCompare(s->matrix.m11(), s->matrix.m22())))) { - drawGlyphsS60(p, ti); - return; - } -#else // Q_OS_WIN || Q_WS_MAC || Q_WS_QPA - - QFontEngine *fontEngine = ti.fontEngine; - -#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN) - - if (fontEngine->type() == QFontEngine::Freetype) { - QTransform matrix = s->matrix; - matrix.translate(p.x(), p.y()); - - QVarLengthArray<QFixedPoint> positions; - QVarLengthArray<glyph_t> glyphs; - fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions); - if (glyphs.size() == 0) - return; - - if (!drawCachedGlyphs(glyphs.size(), glyphs.constData(), positions.constData(), fontEngine)) - QPaintEngine::drawTextItem(p, ti); - - return; - } -#endif -#endif QPaintEngineEx::drawTextItem(p, ti); } @@ -3189,22 +3104,6 @@ void QRasterPaintEngine::drawEllipse(const QRectF &rect) /*! \internal */ -#ifdef Q_WS_MAC -void QRasterPaintEngine::setCGContext(CGContextRef ctx) -{ - Q_D(QRasterPaintEngine); - d->cgContext = ctx; -} - -/*! - \internal -*/ -CGContextRef QRasterPaintEngine::getCGContext() const -{ - Q_D(const QRasterPaintEngine); - return d->cgContext; -} -#endif #ifdef Q_OS_WIN /*! @@ -3236,26 +3135,12 @@ void QRasterPaintEngine::releaseDC(HDC) const bool QRasterPaintEngine::supportsTransformations(const QFontEngine *fontEngine) const { const QTransform &m = state()->matrix; -#if defined(Q_WS_WIN) && !defined(Q_WS_WINCE) - QFontEngine::Type fontEngineType = fontEngine->type(); - if ((fontEngineType == QFontEngine::Win && !((QFontEngineWin *) fontEngine)->ttf && m.type() > QTransform::TxTranslate) - || (m.type() <= QTransform::TxTranslate - && (fontEngineType == QFontEngine::TestFontEngine - || fontEngineType == QFontEngine::Box))) { - return true; - } -#endif return supportsTransformations(fontEngine->fontDef.pixelSize, m); } bool QRasterPaintEngine::supportsTransformations(qreal pixelSize, const QTransform &m) const { -#if defined(Q_WS_MAC) - // Mac font engines don't support scaling and rotation - if (m.type() > QTransform::TxTranslate) -#else if (m.type() >= QTransform::TxProject) -#endif return true; return !shouldDrawCachedGlyphs(pixelSize, m); diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h index d387e1312a..6e71e9986a 100644 --- a/src/gui/painting/qpaintengine_raster_p.h +++ b/src/gui/painting/qpaintengine_raster_p.h @@ -219,10 +219,6 @@ public: void saveBuffer(const QString &s) const; #endif -#ifdef Q_WS_MAC - void setCGContext(CGContextRef ref); - CGContextRef getCGContext() const; -#endif #ifdef Q_OS_WIN void setDC(HDC hdc); @@ -254,9 +250,6 @@ private: bool drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions, QFontEngine *fontEngine); -#if defined(Q_OS_SYMBIAN) && defined(QT_NO_FREETYPE) - void drawGlyphsS60(const QPointF &p, const QTextItemInt &ti); -#endif // Q_OS_SYMBIAN && QT_NO_FREETYPE bool setClipRectInDeviceCoords(const QRect &r, Qt::ClipOperation op); diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp index 5ef6900cc8..5c39a5fca2 100644 --- a/src/gui/painting/qpaintengineex.cpp +++ b/src/gui/painting/qpaintengineex.cpp @@ -925,15 +925,8 @@ void QPaintEngineEx::drawPolygon(const QPoint *points, int pointCount, PolygonDr int count = pointCount<<1; QVarLengthArray<qreal> pts(count); -#ifdef Q_WS_MAC - for (int i=0; i<count; i+=2) { - pts[i] = ((int *) points)[i+1]; - pts[i+1] = ((int *) points)[i]; - } -#else for (int i=0; i<count; ++i) pts[i] = ((int *) points)[i]; -#endif QVectorPath path(pts.data(), pointCount, 0, QVectorPath::polygonFlags(mode)); @@ -1059,9 +1052,7 @@ Q_GUI_EXPORT QPainterPath qt_painterPathFromVectorPath(const QVectorPath &path) void QPaintEngineEx::drawStaticTextItem(QStaticTextItem *staticTextItem) { QPainterPath path; -#ifndef Q_WS_MAC path.setFillRule(Qt::WindingFill); -#endif if (staticTextItem->numGlyphs == 0) return; diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 2cd601f2c7..416fe5adbf 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -157,15 +157,9 @@ static bool qt_painter_thread_test(int devType, const char *what, bool extraCond case QInternal::Printer: case QInternal::Picture: // can be drawn onto these devices safely from any thread -#ifndef Q_WS_WIN if (extraCondition) -#endif break; default: -#ifdef Q_WS_X11 - if (QApplication::testAttribute(Qt::AA_X11InitThreads)) - return true; -#endif if (!extraCondition && QThread::currentThread() != qApp->thread()) { qWarning("QPainter: It is not safe to use %s outside the GUI thread", what); return false; diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index 8bb599f9f0..5b70f4b22a 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -2970,9 +2970,6 @@ qreal QPainterPath::angleAtPercent(qreal t) const return QLineF(0, 0, m1, m2).angle(); } -#if defined(Q_WS_WINCE) -#pragma warning( disable : 4056 4756 ) -#endif /*! Returns the slope of the path at the percentage \a t. The diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp index 47687e4a53..8f21663ffc 100644 --- a/src/gui/painting/qpdf.cpp +++ b/src/gui/painting/qpdf.cpp @@ -2438,12 +2438,6 @@ void QPdfEnginePrivate::drawTextItem(const QPointF &p, const QTextItemInt &ti) if (ti.charFormat.isAnchor()) { qreal size = ti.fontEngine->fontDef.pixelSize; -#ifdef Q_WS_WIN - if (ti.fontEngine->type() == QFontEngine::Win) { - QFontEngineWin *fe = static_cast<QFontEngineWin *>(ti.fontEngine); - size = fe->tm.tmHeight; - } -#endif int synthesized = ti.fontEngine->synthesized(); qreal stretch = synthesized & QFontEngine::SynthesizedStretch ? ti.fontEngine->fontDef.stretch/100. : 1.; @@ -2507,12 +2501,6 @@ void QPdfEnginePrivate::drawTextItem(const QPointF &p, const QTextItemInt &ti) currentPage->fonts.append(font->object_id); qreal size = ti.fontEngine->fontDef.pixelSize; -#ifdef Q_WS_WIN - if (ti.fontEngine->type() == QFontEngine::Win) { - QFontEngineWin *fe = static_cast<QFontEngineWin *>(ti.fontEngine); - size = fe->tm.tmHeight; - } -#endif QVarLengthArray<glyph_t> glyphs; QVarLengthArray<QFixedPoint> positions; diff --git a/src/gui/painting/qrasterizer_p.h b/src/gui/painting/qrasterizer_p.h index e72ddbf2b7..913e2d3229 100644 --- a/src/gui/painting/qrasterizer_p.h +++ b/src/gui/painting/qrasterizer_p.h @@ -66,9 +66,6 @@ class QRasterBuffer; class QRasterizerPrivate; class -#ifdef Q_WS_QWS -Q_GUI_EXPORT -#endif QRasterizer { public: diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp index 9d9534bee9..2843e5ccb7 100644 --- a/src/gui/painting/qregion.cpp +++ b/src/gui/painting/qregion.cpp @@ -46,14 +46,10 @@ #include "qdatastream.h" #include "qvariant.h" #include "qvarlengtharray.h" - -#include <qdebug.h> - -#if defined(Q_OS_UNIX) || defined(Q_WS_WIN) #include "qimage.h" #include "qbitmap.h" -#include <stdlib.h> -#endif + +#include <qdebug.h> QT_BEGIN_NAMESPACE @@ -263,12 +259,6 @@ void QRegion::detach() { if (d->ref.load() != 1) *this = copy(); -#if defined(Q_WS_X11) - else if (d->xrectangles) { - free(d->xrectangles); - d->xrectangles = 0; - } -#endif } // duplicates in qregion_win.cpp and qregion_wce.cpp @@ -1598,22 +1588,8 @@ void QRegionPrivate::selfTest() const } #endif // QT_REGION_DEBUG -#if defined(Q_WS_X11) -QT_BEGIN_INCLUDE_NAMESPACE -# include "qregion_x11.cpp" -QT_END_INCLUDE_NAMESPACE -#elif defined(Q_WS_MAC) -QT_BEGIN_INCLUDE_NAMESPACE -# include "qregion_mac.cpp" -QT_END_INCLUDE_NAMESPACE -#elif defined(Q_WS_WIN) -QT_BEGIN_INCLUDE_NAMESPACE -# include "qregion_win.cpp" -QT_END_INCLUDE_NAMESPACE -#elif defined(Q_WS_QWS) || defined(Q_WS_QPA) static QRegionPrivate qrp; QRegion::QRegionData QRegion::shared_empty = {Q_BASIC_ATOMIC_INITIALIZER(1), &qrp}; -#endif typedef void (*OverlapFunc)(register QRegionPrivate &dest, register const QRect *r1, const QRect *r1End, register const QRect *r2, const QRect *r2End, register int y1, register int y2); @@ -3822,12 +3798,6 @@ QRegion::QRegion(const QRect &r, RegionType t) } else { d = new QRegionData; d->ref.store(1); -#if defined(Q_WS_X11) - d->rgn = 0; - d->xrectangles = 0; -#elif defined(Q_WS_WIN) - d->rgn = 0; -#endif if (t == Rectangle) { d->qt_rgn = new QRegionPrivate(r); } else if (t == Ellipse) { @@ -3847,12 +3817,6 @@ QRegion::QRegion(const QPolygon &a, Qt::FillRule fillRule) if (qt_rgn) { d = new QRegionData; d->ref.store(1); -#if defined(Q_WS_X11) - d->rgn = 0; - d->xrectangles = 0; -#elif defined(Q_WS_WIN) - d->rgn = 0; -#endif d->qt_rgn = qt_rgn; } else { d = &shared_empty; @@ -3879,12 +3843,6 @@ QRegion::QRegion(const QBitmap &bm) } else { d = new QRegionData; d->ref.store(1); -#if defined(Q_WS_X11) - d->rgn = 0; - d->xrectangles = 0; -#elif defined(Q_WS_WIN) - d->rgn = 0; -#endif d->qt_rgn = qt_bitmapToRegion(bm); } } @@ -3892,15 +3850,6 @@ QRegion::QRegion(const QBitmap &bm) void QRegion::cleanUp(QRegion::QRegionData *x) { delete x->qt_rgn; -#if defined(Q_WS_X11) - if (x->rgn) - XDestroyRegion(x->rgn); - if (x->xrectangles) - free(x->xrectangles); -#elif defined(Q_WS_WIN) - if (x->rgn) - qt_win_dispose_rgn(x->rgn); -#endif delete x; } @@ -3929,12 +3878,6 @@ QRegion QRegion::copy() const QRegion r; QScopedPointer<QRegionData> x(new QRegionData); x->ref.store(1); -#if defined(Q_WS_X11) - x->rgn = 0; - x->xrectangles = 0; -#elif defined(Q_WS_WIN) - x->rgn = 0; -#endif if (d->qt_rgn) x->qt_rgn = new QRegionPrivate(*d->qt_rgn); else @@ -4221,9 +4164,7 @@ QRect QRegion::boundingRect() const Returns true if \a rect is guaranteed to be fully contained in \a region. A false return value does not guarantee the opposite. */ -#if defined(Q_WS_QWS) || defined(Q_WS_QPA) Q_GUI_EXPORT -#endif bool qt_region_strictContains(const QRegion ®ion, const QRect &rect) { if (isEmptyHelper(region.d->qt_rgn) || !rect.isValid()) diff --git a/src/gui/painting/qregion.h b/src/gui/painting/qregion.h index d1ec9c6c34..a599b3ad16 100644 --- a/src/gui/painting/qregion.h +++ b/src/gui/painting/qregion.h @@ -59,9 +59,7 @@ QT_MODULE(Gui) template <class T> class QVector; class QVariant; -#if defined(Q_WS_QWS) || defined(Q_WS_QPA) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN) struct QRegionPrivate; -#endif class QBitmap; @@ -142,24 +140,8 @@ public: Handle handle() const; #endif #ifndef qdoc -#if defined(Q_WS_WIN) - inline HRGN handle() const { ensureHandle(); return d->rgn; } -#elif defined(Q_WS_X11) - inline Region handle() const { if(!d->rgn) updateX11Region(); return d->rgn; } -#elif defined(Q_WS_MAC) -#if defined Q_WS_MAC32 - RgnHandle toQDRgn() const; - RgnHandle toQDRgnForUpdate_sys() const; - static QRegion fromQDRgn(RgnHandle shape); -#endif - inline HIMutableShapeRef handle(bool unused = false) const - { Q_UNUSED(unused); return toHIMutableShape(); } - HIMutableShapeRef toHIMutableShape() const; - static QRegion fromHIShapeRef(HIShapeRef shape); -#elif defined(Q_WS_QWS) || defined(Q_WS_QPA) inline void *handle() const { return d->qt_rgn; } #endif -#endif #ifndef QT_NO_DATASTREAM friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QRegion &); @@ -168,20 +150,7 @@ public: private: QRegion copy() const; // helper of detach. void detach(); -#if defined(Q_WS_WIN) - void ensureHandle() const; - QRegion winCombine(const QRegion &r, int num) const; -#elif defined(Q_WS_X11) - void updateX11Region() const; - void *clipRectangles(int &num) const; - friend void *qt_getClipRects(const QRegion &r, int &num); -#elif defined(Q_WS_MAC) - static OSStatus shape2QRegionHelper(int inMessage, HIShapeRef inShape, - const CGRect *inRect, void *inRefcon); -#endif -#if defined(Q_WS_QWS) || defined(Q_WS_QPA) Q_GUI_EXPORT -#endif friend bool qt_region_strictContains(const QRegion ®ion, const QRect &rect); friend struct QRegionPrivate; @@ -191,19 +160,8 @@ Q_GUI_EXPORT #endif struct QRegionData { QBasicAtomicInt ref; -#if defined(Q_WS_WIN) - HRGN rgn; -#elif defined(Q_WS_X11) - Region rgn; - void *xrectangles; -#endif -#if defined(Q_WS_QWS) || defined(Q_WS_QPA) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN) QRegionPrivate *qt_rgn; -#endif }; -#if defined(Q_WS_WIN) - friend class QETWidget; -#endif struct QRegionData *d; static struct QRegionData shared_empty; static void cleanUp(QRegionData *x); diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index 0f9a82c25a..b56f6b42e4 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -134,13 +134,9 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const if (!supportsSubPixelPositions) { m_subPixelPositionCount = 1; } else { -#if !defined(Q_WS_X11) int i = 0; while (m_subPixelPositionCount == 0 && i < numGlyphs) m_subPixelPositionCount = calculateSubPixelPositionCount(glyphs[i++]); -#else - m_subPixelPositionCount = 4; -#endif } } @@ -295,38 +291,6 @@ void QTextureGlyphCache::fillInPendingGlyphs() QImage QTextureGlyphCache::textureMapForGlyph(glyph_t g, QFixed subPixelPosition) const { -#if defined(Q_WS_X11) - if (m_transform.type() > QTransform::TxTranslate && m_current_fontengine->type() == QFontEngine::Freetype) { - QFontEngineFT::GlyphFormat format = QFontEngineFT::Format_None; - QImage::Format imageFormat = QImage::Format_Invalid; - switch (m_type) { - case Raster_RGBMask: - format = QFontEngineFT::Format_A32; - imageFormat = QImage::Format_RGB32; - break; - case Raster_A8: - format = QFontEngineFT::Format_A8; - imageFormat = QImage::Format_Indexed8; - break; - case Raster_Mono: - format = QFontEngineFT::Format_Mono; - imageFormat = QImage::Format_Mono; - break; - }; - - QFontEngineFT *ft = static_cast<QFontEngineFT*> (m_current_fontengine); - QFontEngineFT::QGlyphSet *gset = ft->loadTransformedGlyphSet(m_transform); - QFixedPoint positions[1]; - positions[0].x = subPixelPosition; - - if (gset && ft->loadGlyphs(gset, &g, 1, positions, format)) { - QFontEngineFT::Glyph *glyph = gset->getGlyph(g, subPixelPosition); - const int bytesPerLine = (format == QFontEngineFT::Format_Mono ? ((glyph->width + 31) & ~31) >> 3 - : (glyph->width + 3) & ~3); - return QImage(glyph->data, glyph->width, glyph->height, bytesPerLine, imageFormat); - } - } else -#endif if (m_type == QFontEngineGlyphCache::Raster_RGBMask) return m_current_fontengine->alphaRGBMapForGlyph(g, subPixelPosition, glyphMargin(), m_transform); else @@ -367,11 +331,7 @@ void QImageTextureGlyphCache::createTextureData(int width, int height) int QImageTextureGlyphCache::glyphMargin() const { -#if defined(Q_WS_MAC) || defined(Q_WS_X11) - return 0; -#else return m_type == QFontEngineGlyphCache::Raster_RGBMask ? 2 : 0; -#endif } void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g, QFixed subPixelPosition) |