Reviewed by ap.
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Aug 2006 16:25:13 +0000 (16:25 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Aug 2006 16:25:13 +0000 (16:25 +0000)
        http://bugzilla.opendarwin.org/show_bug.cgi?id=10467
        WebKit should have Qt platform support (Part II)

        Adapt the KCanvas Qt device to Rob's KCanvasMatrix removal.
        Use AffineTransform everywhere instead.

        * kcanvas/device/qt/KRenderingDeviceQt.cpp:
        (WebCore::KRenderingDeviceContextQt::KRenderingDeviceContextQt):
        (WebCore::KRenderingDeviceContextQt::concatCTM):
        (WebCore::KRenderingDeviceContextQt::ctm):
        * kcanvas/device/qt/KRenderingDeviceQt.h:
        * kcanvas/device/qt/KRenderingPaintServerGradientQt.cpp:
        (WebCore::KRenderingPaintServerLinearGradientQt::setup):
        (WebCore::KRenderingPaintServerRadialGradientQt::setup):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16010 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/kcanvas/device/qt/KRenderingDeviceQt.cpp
WebCore/kcanvas/device/qt/KRenderingDeviceQt.h
WebCore/kcanvas/device/qt/KRenderingPaintServerGradientQt.cpp

index 7dc4783..4a07607 100644 (file)
@@ -1,3 +1,22 @@
+2006-08-24  Nikolas Zimmermann  <zimmermann@kde.org>
+
+        Reviewed by ap.
+
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=10467
+        WebKit should have Qt platform support (Part II)
+
+        Adapt the KCanvas Qt device to Rob's KCanvasMatrix removal.
+        Use AffineTransform everywhere instead.
+
+        * kcanvas/device/qt/KRenderingDeviceQt.cpp:
+        (WebCore::KRenderingDeviceContextQt::KRenderingDeviceContextQt):
+        (WebCore::KRenderingDeviceContextQt::concatCTM):
+        (WebCore::KRenderingDeviceContextQt::ctm):
+        * kcanvas/device/qt/KRenderingDeviceQt.h:
+        * kcanvas/device/qt/KRenderingPaintServerGradientQt.cpp:
+        (WebCore::KRenderingPaintServerLinearGradientQt::setup):
+        (WebCore::KRenderingPaintServerRadialGradientQt::setup):
+
 2006-08-24  Rob Buis  <buis@kde.org>
 
         Reviewed by Darin.
index 6a52684..539430d 100644 (file)
 
 #include "IntRect.h"
 #include "RenderPathQt.h"
-#include "KCanvasMatrix.h"
 #include "KCanvasPathQt.h"
-#include "KCanvasClipperQt.h"
+#include "AffineTransform.h"
 #include "GraphicsContext.h"
+#include "KCanvasClipperQt.h"
 #include "KRenderingDeviceQt.h"
 #include "KRenderingPaintServerSolidQt.h"
 #include "KRenderingPaintServerGradientQt.h"
@@ -37,7 +37,7 @@ namespace WebCore {
 
 KRenderingDeviceContextQt::KRenderingDeviceContextQt(QPainter* painter)
     : m_painter(painter)
-      , m_path()
+    , m_path()
 {
     Q_ASSERT(m_painter != 0);
 }
@@ -46,16 +46,16 @@ KRenderingDeviceContextQt::~KRenderingDeviceContextQt()
 {
 }
 
-KCanvasMatrix KRenderingDeviceContextQt::concatCTM(const KCanvasMatrix& worldMatrix)
+AffineTransform KRenderingDeviceContextQt::concatCTM(const AffineTransform& worldMatrix)
 {
-    KCanvasMatrix ret = ctm();
-    m_painter->setMatrix(worldMatrix.matrix(), true);
+    AffineTransform ret = ctm();
+    m_painter->setMatrix(worldMatrix, true);
     return ret;
 }
 
-KCanvasMatrix KRenderingDeviceContextQt::ctm() const
+AffineTransform KRenderingDeviceContextQt::ctm() const
 {
-    return KCanvasMatrix(m_painter->matrix());
+    return AffineTransform(m_painter->matrix());
 }
 
 IntRect KRenderingDeviceContextQt::mapFromVisual(const IntRect& rect)
index fcfe3b0..c64598f 100644 (file)
@@ -36,8 +36,8 @@ public:
     KRenderingDeviceContextQt(QPainter*);
     virtual ~KRenderingDeviceContextQt();
 
-    virtual KCanvasMatrix concatCTM(const KCanvasMatrix&);
-    virtual KCanvasMatrix ctm() const;
+    virtual AffineTransform concatCTM(const AffineTransform&);
+    virtual AffineTransform ctm() const;
 
     virtual IntRect mapFromVisual(const IntRect&);
     virtual IntRect mapToVisual(const IntRect&);
index 23e8e10..3e3a728 100644 (file)
@@ -26,7 +26,7 @@
 #include <QPointF>
 
 #include "RenderStyle.h"
-#include "KCanvasMatrix.h"
+#include "AffineTransform.h"
 #include "KRenderingDeviceQt.h"
 #include "KCanvasRenderingStyle.h"
 #include "KRenderingFillPainter.h"
@@ -95,13 +95,12 @@ bool KRenderingPaintServerLinearGradientQt::setup(KRenderingDeviceContext* conte
     qtContext->painter().setBrush(Qt::NoBrush);
 
     QLinearGradient gradient(QPointF(x1, y1), QPointF(x2, y2));
-    if (spreadMethod() == SPREADMETHOD_REPEAT) {
+    if (spreadMethod() == SPREADMETHOD_REPEAT)
         gradient.setSpread(QGradient::RepeatSpread);
-    } else if (spreadMethod() == SPREADMETHOD_REFLECT) {
+    else if (spreadMethod() == SPREADMETHOD_REFLECT)
         gradient.setSpread(QGradient::ReflectSpread);
-    } else {
+    else
         gradient.setSpread(QGradient::PadSpread);
-    }
 
     double opacity = 1.0;
 
@@ -164,7 +163,7 @@ bool KRenderingPaintServerRadialGradientQt::setup(KRenderingDeviceContext* conte
 
     qtContext->painter().setPen(Qt::NoPen);
     qtContext->painter().setBrush(Qt::NoBrush);
-    QMatrix mat = qtContext->ctm().matrix();
+    QMatrix mat = qtContext->ctm();
 
     double cx, fx, cy, fy, r;
     if (boundingBoxMode()) {
@@ -207,20 +206,19 @@ bool KRenderingPaintServerRadialGradientQt::setup(KRenderingDeviceContext* conte
     }
 
     QRadialGradient gradient(QPointF(cx, cy), gradientRadius(), QPointF(fx + cx, fy + cy));
-    if (spreadMethod() == SPREADMETHOD_REPEAT) {
+    if (spreadMethod() == SPREADMETHOD_REPEAT)
         gradient.setSpread(QGradient::RepeatSpread);
-    } else if (spreadMethod() == SPREADMETHOD_REFLECT) {
+    else if (spreadMethod() == SPREADMETHOD_REFLECT)
         gradient.setSpread(QGradient::ReflectSpread);
-    } else {
+    else
         gradient.setSpread(QGradient::PadSpread);
-    }
 
     double opacity = 1.0;
 
     // TODO: Gradient transform + opacity fixes! 
 
-    // KCanvasMatrix gradientTrans = gradientTransform();
-    // gradientTrans.qmatrix().map(cx, cy, &cx, &cy);
+    // AffineTransform gradientTrans = gradientTransform();
+    // gradientTrans.map(cx, cy, &cx, &cy);
     // qtContext->painter().setMatrix(mat);
 
     if ((type & APPLY_TO_FILL) && KSVGPainterFactory::isFilled(renderStyle)) {