2006-10-05 Nikolas Zimmermann <zimmermann@kde.org>
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Oct 2006 17:48:53 +0000 (17:48 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Oct 2006 17:48:53 +0000 (17:48 +0000)
        Reviewed and landed by ap.

        Fix Qt/Linux build, adapt to Eric's Quartz changes and to Maciej's ResourceLoader changes.

        * kcanvas/device/qt/KRenderingPaintServerGradientQt.cpp:
        (WebCore::KRenderingPaintServerLinearGradientQt::renderPath):
        (WebCore::KRenderingPaintServerLinearGradientQt::setup):
        (WebCore::KRenderingPaintServerRadialGradientQt::setup):
        (WebCore::KRenderingPaintServerRadialGradientQt::renderPath):
        * kcanvas/device/qt/KRenderingPaintServerPatternQt.cpp:
        (WebCore::KRenderingPaintServerPatternQt::renderPath):
        * kcanvas/device/qt/KRenderingPaintServerQt.cpp:
        (WebCore::KRenderingPaintServerQt::setPenProperties):
        * kcanvas/device/qt/KRenderingPaintServerSolidQt.cpp:
        (WebCore::KRenderingPaintServerSolidQt::setup):
        (WebCore::KRenderingPaintServerSolidQt::renderPath):
        * kcanvas/device/qt/RenderPathQt.cpp:
        (WebCore::getPathStroke):

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

WebCore/ChangeLog
WebCore/kcanvas/device/qt/KRenderingPaintServerGradientQt.cpp
WebCore/kcanvas/device/qt/KRenderingPaintServerPatternQt.cpp
WebCore/kcanvas/device/qt/KRenderingPaintServerQt.cpp
WebCore/kcanvas/device/qt/KRenderingPaintServerSolidQt.cpp
WebCore/kcanvas/device/qt/RenderPathQt.cpp
WebCore/platform/qt/FrameQtClient.cpp
WebCore/platform/qt/ResourceLoaderQt.cpp

index 022aa685b53f8f538dadb363b4662ba227bba785..e0af2dd12c26926e71d2996c86d71f756d2ebcbc 100644 (file)
@@ -1,3 +1,24 @@
+2006-10-05  Nikolas Zimmermann  <zimmermann@kde.org>
+
+        Reviewed and landed by ap.
+
+        Fix Qt/Linux build, adapt to Eric's quartz changes and to Maciej's ResourceLoader changes.
+
+        * kcanvas/device/qt/KRenderingPaintServerGradientQt.cpp:
+        (WebCore::KRenderingPaintServerLinearGradientQt::renderPath):
+        (WebCore::KRenderingPaintServerLinearGradientQt::setup):
+        (WebCore::KRenderingPaintServerRadialGradientQt::setup):
+        (WebCore::KRenderingPaintServerRadialGradientQt::renderPath):
+        * kcanvas/device/qt/KRenderingPaintServerPatternQt.cpp:
+        (WebCore::KRenderingPaintServerPatternQt::renderPath):
+        * kcanvas/device/qt/KRenderingPaintServerQt.cpp:
+        (WebCore::KRenderingPaintServerQt::setPenProperties):
+        * kcanvas/device/qt/KRenderingPaintServerSolidQt.cpp:
+        (WebCore::KRenderingPaintServerSolidQt::setup):
+        (WebCore::KRenderingPaintServerSolidQt::renderPath):
+        * kcanvas/device/qt/RenderPathQt.cpp:
+        (WebCore::getPathStroke):
+
 2006-10-05  Alexey Proskuryakov  <ap@nypop.com>
 
         Reviewed by Darin.
index 779a7af0005ae010b923be649374a38d69226776..45922f40a3cad8ba5996b4874d088b0287fe7f94 100644 (file)
@@ -60,10 +60,10 @@ void KRenderingPaintServerLinearGradientQt::renderPath(KRenderingDeviceContext*
     RenderStyle* renderStyle = path->style();
     KRenderingDeviceContextQt* qtContext = static_cast<KRenderingDeviceContextQt*>(context);
 
-    if ((type & APPLY_TO_FILL) && KSVGPainterFactory::isFilled(renderStyle))
+    if ((type & APPLY_TO_FILL) && renderStyle->svgStyle()->hasFill())
         qtContext->fillPath();
 
-    if ((type & APPLY_TO_STROKE) && KSVGPainterFactory::isStroked(renderStyle))
+    if ((type & APPLY_TO_STROKE) && renderStyle->svgStyle()->hasStroke())
         qtContext->strokePath();
 }
 
@@ -106,7 +106,7 @@ bool KRenderingPaintServerLinearGradientQt::setup(KRenderingDeviceContext* conte
 
     // TODO: Gradient transform + opacity fixes! 
 
-    if ((type & APPLY_TO_FILL) && KSVGPainterFactory::isFilled(renderStyle)) {
+    if ((type & APPLY_TO_FILL) && renderStyle->svgStyle()->hasFill()) {
         KRenderingFillPainter fillPainter = KSVGPainterFactory::fillPainter(renderStyle, object);
         fill_color_array(gradient, gradientStops(), opacity);
 
@@ -116,7 +116,7 @@ bool KRenderingPaintServerLinearGradientQt::setup(KRenderingDeviceContext* conte
         qtContext->setFillRule(fillPainter.fillRule());
     }
 
-    if ((type & APPLY_TO_STROKE) && KSVGPainterFactory::isStroked(renderStyle)) {
+    if ((type & APPLY_TO_STROKE) && renderStyle->svgStyle()->hasStroke()) {
         KRenderingStrokePainter strokePainter = KSVGPainterFactory::strokePainter(renderStyle, object);
         fill_color_array(gradient, gradientStops(), opacity);
 
@@ -222,7 +222,7 @@ bool KRenderingPaintServerRadialGradientQt::setup(KRenderingDeviceContext* conte
     // gradientTrans.map(cx, cy, &cx, &cy);
     // qtContext->painter().setMatrix(mat);
 
-    if ((type & APPLY_TO_FILL) && KSVGPainterFactory::isFilled(renderStyle)) {
+    if ((type & APPLY_TO_FILL) && renderStyle->svgStyle()->hasFill()) {
         KRenderingFillPainter fillPainter = KSVGPainterFactory::fillPainter(renderStyle, object);
         fill_color_array(gradient, gradientStops(), opacity);
 
@@ -232,7 +232,7 @@ bool KRenderingPaintServerRadialGradientQt::setup(KRenderingDeviceContext* conte
         qtContext->setFillRule(fillPainter.fillRule());
     }
 
-    if ((type & APPLY_TO_STROKE) && KSVGPainterFactory::isStroked(renderStyle)) {
+    if ((type & APPLY_TO_STROKE) && renderStyle->svgStyle()->hasStroke()) {
         KRenderingStrokePainter strokePainter = KSVGPainterFactory::strokePainter(renderStyle, object);
         fill_color_array(gradient, gradientStops(), opacity);
 
@@ -266,10 +266,10 @@ void KRenderingPaintServerRadialGradientQt::renderPath(KRenderingDeviceContext*
     RenderStyle* renderStyle = path->style();
     KRenderingDeviceContextQt* qtContext = static_cast<KRenderingDeviceContextQt*>(context);
 
-    if ((type & APPLY_TO_FILL) && KSVGPainterFactory::isFilled(renderStyle))
+    if ((type & APPLY_TO_FILL) && renderStyle->svgStyle()->hasFill())
         qtContext->fillPath();
 
-    if ((type & APPLY_TO_STROKE) && KSVGPainterFactory::isStroked(renderStyle))
+    if ((type & APPLY_TO_STROKE) && renderStyle->svgStyle()->hasStroke())
         qtContext->strokePath();
 }
 
index 1bb62fa1dfb84fcc0a555d921ec445d53791f275..caffd1e6883965870bd630d257053caa6bd65dce 100644 (file)
@@ -55,10 +55,10 @@ void KRenderingPaintServerPatternQt::renderPath(KRenderingDeviceContext* context
     RenderStyle* renderStyle = path->style();
     KRenderingDeviceContextQt* qtContext = static_cast<KRenderingDeviceContextQt*>(context);
 
-    if ((type & APPLY_TO_FILL) && KSVGPainterFactory::isFilled(renderStyle))
+    if ((type & APPLY_TO_FILL) && renderStyle->svgStyle()->hasFill())
         qtContext->fillPath();
 
-    if ((type & APPLY_TO_STROKE) && KSVGPainterFactory::isStroked(renderStyle))
+    if ((type & APPLY_TO_STROKE) && renderStyle->svgStyle()->hasStroke())
         qtContext->strokePath();
 }
 
index 04fbe599d13954a8581995ef2e06d2a2e77d6636..3ba3f42cf02b4a595a7e7ebfc6151e734196d45a 100644 (file)
@@ -52,8 +52,8 @@ void KRenderingPaintServerQt::setPenProperties(const KRenderingStrokePainter& st
     } else if(strokePainter.strokeJoinStyle() == JOIN_ROUND)
         pen.setJoinStyle(Qt::RoundJoin);
 
-    KCDashArray dashes = strokePainter.dashArray();
-    unsigned int dashLength = !dashes.isEmpty() ? dashes.count() : 0;
+    const KCDashArray& dashes = strokePainter.dashArray();
+    unsigned int dashLength = !dashes.isEmpty() ? dashes.size() : 0;
     if(dashLength) {
         QVector<qreal> pattern;
         unsigned int count = (dashLength % 2) == 0 ? dashLength : dashLength * 2;
index 3a2ef49140c45e3bfc29a8b250a76a3c0920c6b1..343c49d6127feb4e7c5b089650c81824c3627e63 100644 (file)
@@ -64,7 +64,7 @@ bool KRenderingPaintServerSolidQt::setup(KRenderingDeviceContext* context, const
 
     QColor c = color();
 
-    if ((type & APPLY_TO_FILL) && KSVGPainterFactory::isFilled(renderStyle)) {
+    if ((type & APPLY_TO_FILL) && renderStyle->svgStyle()->hasFill()) {
         KRenderingFillPainter fillPainter = KSVGPainterFactory::fillPainter(renderStyle, object);
         c.setAlphaF(fillPainter.opacity());
 
@@ -75,7 +75,7 @@ bool KRenderingPaintServerSolidQt::setup(KRenderingDeviceContext* context, const
         /* if(isPaintingText()) ... */
     }
 
-    if((type & APPLY_TO_STROKE) && KSVGPainterFactory::isStroked(renderStyle)) {
+    if((type & APPLY_TO_STROKE) && renderStyle->svgStyle()->hasStroke()) {
         KRenderingStrokePainter strokePainter = KSVGPainterFactory::strokePainter(renderStyle, object);
         c.setAlphaF(strokePainter.opacity());
 
@@ -98,10 +98,10 @@ void KRenderingPaintServerSolidQt::renderPath(KRenderingDeviceContext* context,
     RenderStyle* renderStyle = path->style();
     KRenderingDeviceContextQt* qtContext = static_cast<KRenderingDeviceContextQt*>(context);
 
-    if ((type & APPLY_TO_FILL) && KSVGPainterFactory::isFilled(renderStyle))
+    if ((type & APPLY_TO_FILL) && renderStyle->svgStyle()->hasFill())
         qtContext->fillPath();
 
-    if ((type & APPLY_TO_STROKE) && KSVGPainterFactory::isStroked(renderStyle))
+    if ((type & APPLY_TO_STROKE) && renderStyle->svgStyle()->hasStroke())
         qtContext->strokePath();
 }
 
index 382cd5a42e1faf5eb2c1c2ba2ca9cf34fcc0224c..fcffac938fbf36a56bcb14d01a3d3ebf4a185e1d 100644 (file)
@@ -57,8 +57,8 @@ static QPainterPath getPathStroke(const QPainterPath &path, const KRenderingStro
     } else if(strokePainter.strokeJoinStyle() == JOIN_ROUND)
         s.setJoinStyle(Qt::RoundJoin);
 
-    KCDashArray dashes = strokePainter.dashArray();
-    unsigned int dashLength = !dashes.isEmpty() ? dashes.count() : 0;
+    const KCDashArray& dashes = strokePainter.dashArray();
+    unsigned int dashLength = !dashes.isEmpty() ? dashes.size() : 0;
     if(dashLength) {
         QVector<qreal> pattern;
         unsigned int count = (dashLength % 2) == 0 ? dashLength : dashLength * 2;
index 49fdb316868f11a7111cfb82bddc8edae4a2987c..1f6f0527de47b1dd88ab70f90df01b4a959f4880 100644 (file)
@@ -57,16 +57,16 @@ void FrameQtClientDefault::openURL(const KURL& url)
     m_frame->didOpenURL(url);
     m_beginCalled = false;
 
-    ResourceLoader* job = new ResourceLoader(this, "GET", url);
-    job->start(0);
+    RefPtr<ResourceLoader> loader = ResourceLoader::create(this, "GET", url);
+    loader->start(0);
 }
 
 void FrameQtClientDefault::submitForm(const String& method, const KURL& url, const FormData* postData)
 {
     m_beginCalled = false;
 
-    ResourceLoader* job = new ResourceLoader(this, method, url, *postData);
-    job->start(0);
+    RefPtr<ResourceLoader> loader = ResourceLoader::create(this, method, url, *postData);
+    loader->start(0);
 }
 
 void FrameQtClientDefault::receivedResponse(ResourceLoader*, PlatformResponse)
index 312d9c8b2343a55a003f3f032982cc4f66371dc7..fe6e654e3051f60225e533709fdc891a68204af6 100644 (file)
@@ -48,6 +48,7 @@ ResourceLoader::~ResourceLoader()
 
 bool ResourceLoader::start(DocLoader*)
 {
+    ref();
     ResourceLoaderManager::self()->add(this);
     return true;
 }