Make QPoint have the same layout on all platforms
authorGunnar Sletta <gunnar.sletta@nokia.com>
Sat, 18 Jun 2011 14:39:32 +0000 (16:39 +0200)
committerQt Continuous Integration System <qt-info@nokia.com>
Mon, 20 Jun 2011 11:08:50 +0000 (13:08 +0200)
Change-Id: I8330295761a4440afd81c121039237fb651d9a9c
Reviewed-on: http://codereview.qt.nokia.com/487
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
src/corelib/tools/qpoint.h
src/gui/painting/qpaintengine_raster.cpp
src/gui/painting/qpaintengineex.cpp

index c0cf219..b394ece 100644 (file)
@@ -92,14 +92,8 @@ public:
 
 private:
     friend class QTransform;
-    // ### Qt 5;  remove the ifdef and just have the same order on all platforms.
-#if defined(Q_OS_MAC)
-    int yp;
-    int xp;
-#else
     int xp;
     int yp;
-#endif
 };
 
 Q_DECLARE_TYPEINFO(QPoint, Q_MOVABLE_TYPE);
index 0a1b8bb..e2ce35a 100644 (file)
@@ -2006,15 +2006,8 @@ void QRasterPaintEngine::drawPolygon(const QPoint *points, int pointCount, Polyg
     if (s->penData.blend) {
         int count = pointCount * 2;
         QVarLengthArray<qreal> fpoints(count);
-    #ifdef Q_WS_MAC
-        for (int i=0; i<count; i+=2) {
-            fpoints[i] = ((int *) points)[i+1];
-            fpoints[i+1] = ((int *) points)[i];
-        }
-    #else
         for (int i=0; i<count; ++i)
             fpoints[i] = ((int *) points)[i];
-    #endif
         QVectorPath vp((qreal *) fpoints.data(), pointCount, 0, QVectorPath::polygonFlags(mode));
 
         if (s->flags.fast_pen) {
index 5105d9a..9427dd5 100644 (file)
@@ -789,15 +789,8 @@ void QPaintEngineEx::drawLines(const QLine *lines, int lineCount)
 
         qreal pts[64];
         int count2 = count<<1;
-#ifdef Q_WS_MAC
-        for (int i=0; i<count2; i+=2) {
-            pts[i] = ((int *) lines)[i+1];
-            pts[i+1] = ((int *) lines)[i];
-        }
-#else
         for (int i=0; i<count2; ++i)
             pts[i] = ((int *) lines)[i];
-#endif
 
         QVectorPath path(pts, count, qpaintengineex_line_types_16, QVectorPath::LinesHint);
         stroke(path, state()->pen);