From c9b18c882915b8f31c8c99bfc271a87800ba61ed Mon Sep 17 00:00:00 2001
From: Holger Hans Peter Freyther <holger@moiji-mobile.com>
Date: Mon, 23 Jan 2012 11:42:01 +0100
Subject: blitter: Move the definition out of the class declaration
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Cosmetic change to remove four spaces of indention from some of the
more deeply nested methods.

Change-Id: I9f09a0ce65d74d6dab59a293bb7fb172a5e47aef
Baed-On: I67fdd0ab722b7c7c67c4da7a0a0bd86459751700
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
---
 src/gui/painting/qpaintengine_blitter.cpp | 127 ++++++++++++++++--------------
 1 file changed, 68 insertions(+), 59 deletions(-)

diff --git a/src/gui/painting/qpaintengine_blitter.cpp b/src/gui/painting/qpaintengine_blitter.cpp
index e6b1060..635b568 100644
--- a/src/gui/painting/qpaintengine_blitter.cpp
+++ b/src/gui/painting/qpaintengine_blitter.cpp
@@ -195,65 +195,10 @@ public:
         raster.reset(new QRasterPaintEngine(p->buffer()));
     }
 
-    inline void lock() {
-        if (!pmData->blittable()->isLocked())
-            raster->d_func()->rasterBuffer->prepare(pmData->buffer());
-    }
-
-    inline void unlock() {
-        pmData->blittable()->unlock();
-    }
-
-    void fillRect(const QRectF &rect, const QColor &color) {
-        Q_Q(QBlitterPaintEngine);
-        pmData->unmarkRasterOverlay(rect);
-        QRectF targetRect = rect;
-        if (hasXForm)
-            targetRect = q->state()->matrix.mapRect(rect);
-        const QClipData *clipData = q->clip();
-        if (clipData) {
-            if (clipData->hasRectClip) {
-                unlock();
-                pmData->blittable()->fillRect(targetRect & clipData->clipRect, color);
-            } else if (clipData->hasRegionClip) {
-                QVector<QRect> rects = clipData->clipRegion.rects();
-                for (int i = 0; i < rects.size(); ++i) {
-                    QRect intersectRect = rects.at(i).intersected(targetRect.toRect());
-                    if (!intersectRect.isEmpty()) {
-                        unlock();
-                        pmData->blittable()->fillRect(intersectRect, color);
-                    }
-                }
-            }
-        } else {
-            if (targetRect.x() >= 0 && targetRect.y() >= 0
-                && targetRect.width() <= raster->paintDevice()->width()
-                && targetRect.height() <= raster->paintDevice()->height()) {
-                unlock();
-                pmData->blittable()->fillRect(targetRect, color);
-            } else {
-                QRectF deviceRect(0, 0, raster->paintDevice()->width(), raster->paintDevice()->height());
-                unlock();
-                pmData->blittable()->fillRect(deviceRect & targetRect, color);
-            }
-        }
-    }
-
-    void clipAndDrawPixmap(const QRectF &clip, const QRectF &target, const QPixmap &pm, const QRectF &sr) {
-        QRectF intersectedRect = clip.intersected(target);
-        if (intersectedRect.isEmpty())
-            return;
-        QRectF source = sr;
-        if (intersectedRect.size() != target.size()) {
-            qreal deltaTop = target.top() - intersectedRect.top();
-            qreal deltaLeft = target.left() - intersectedRect.left();
-            qreal deltaBottom = target.bottom() - intersectedRect.bottom();
-            qreal deltaRight = target.right() - intersectedRect.right();
-            source.adjust(-deltaLeft, -deltaTop, -deltaRight, -deltaBottom);
-        }
-        pmData->unmarkRasterOverlay(intersectedRect);
-        pmData->blittable()->drawPixmap(intersectedRect, pm, source);
-    }
+    void lock();
+    void unlock();
+    void fillRect(const QRectF& rect, const QColor&);
+    void clipAndDrawPixmap(const QRectF &clip, const QRectF &target, const QPixmap &pm, const QRectF &sr);
 
     void updateClip() {
         Q_Q(QBlitterPaintEngine);
@@ -273,6 +218,70 @@ public:
     uint hasXForm;
 };
 
+inline void QBlitterPaintEnginePrivate::lock()
+{
+    if (!pmData->blittable()->isLocked())
+        raster->d_func()->rasterBuffer->prepare(pmData->buffer());
+}
+
+inline void QBlitterPaintEnginePrivate::unlock()
+{
+    pmData->blittable()->unlock();
+}
+
+void QBlitterPaintEnginePrivate::fillRect(const QRectF &rect, const QColor &color)
+{
+    Q_Q(QBlitterPaintEngine);
+    pmData->unmarkRasterOverlay(rect);
+    QRectF targetRect = rect;
+    if (hasXForm)
+        targetRect = q->state()->matrix.mapRect(rect);
+    const QClipData *clipData = q->clip();
+    if (clipData) {
+        if (clipData->hasRectClip) {
+            unlock();
+            pmData->blittable()->fillRect(targetRect & clipData->clipRect, color);
+        } else if (clipData->hasRegionClip) {
+            QVector<QRect> rects = clipData->clipRegion.rects();
+            for (int i = 0; i < rects.size(); ++i) {
+                QRect intersectRect = rects.at(i).intersected(targetRect.toRect());
+                if (!intersectRect.isEmpty()) {
+                    unlock();
+                    pmData->blittable()->fillRect(intersectRect, color);
+                }
+            }
+        }
+    } else {
+        if (targetRect.x() >= 0 && targetRect.y() >= 0
+            && targetRect.width() <= raster->paintDevice()->width()
+            && targetRect.height() <= raster->paintDevice()->height()) {
+            unlock();
+            pmData->blittable()->fillRect(targetRect, color);
+        } else {
+            QRectF deviceRect(0, 0, raster->paintDevice()->width(), raster->paintDevice()->height());
+            unlock();
+            pmData->blittable()->fillRect(deviceRect & targetRect, color);
+        }
+    }
+}
+
+void QBlitterPaintEnginePrivate::clipAndDrawPixmap(const QRectF &clip, const QRectF &target, const QPixmap &pm, const QRectF &sr)
+{
+    QRectF intersectedRect = clip.intersected(target);
+    if (intersectedRect.isEmpty())
+        return;
+    QRectF source = sr;
+    if (intersectedRect.size() != target.size()) {
+        qreal deltaTop = target.top() - intersectedRect.top();
+        qreal deltaLeft = target.left() - intersectedRect.left();
+        qreal deltaBottom = target.bottom() - intersectedRect.bottom();
+        qreal deltaRight = target.right() - intersectedRect.right();
+        source.adjust(-deltaLeft, -deltaTop, -deltaRight, -deltaBottom);
+    }
+    pmData->unmarkRasterOverlay(intersectedRect);
+    pmData->blittable()->drawPixmap(intersectedRect, pm, source);
+}
+
 QBlitterPaintEngine::QBlitterPaintEngine(QBlittablePixmapData *p)
     : QPaintEngineEx(*(new QBlitterPaintEnginePrivate(p)))
 {}
-- 
cgit v0.12