[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 15:36:44 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 6d767de8097724ff97d293796d6a1d48903ba696
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 9 08:04:24 2010 +0000

    2010-11-09  Sam Magnuson  <smagnuson at netflix.com>
    
            Reviewed by Andreas Kling.
    
            [Qt] image borders do not render correctly
            https://bugs.webkit.org/show_bug.cgi?id=49191
    
            Test: fast/borders/border-image-01.html
    
            * platform/graphics/qt/ImageQt.cpp:
            (WebCore::Image::drawPattern):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71611 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 87d246b..ad2f42f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-11-09  Sam Magnuson  <smagnuson at netflix.com>
+
+        Reviewed by Andreas Kling.
+
+        [Qt] image borders do not render correctly
+        https://bugs.webkit.org/show_bug.cgi?id=49191
+
+        Test: fast/borders/border-image-01.html
+
+        * platform/graphics/qt/ImageQt.cpp:
+        (WebCore::Image::drawPattern):
+
 2010-11-08  James Simonsen  <simonjam at chromium.org>
 
         Reviewed by Dimitri Glazkov.
diff --git a/WebCore/platform/graphics/qt/ImageQt.cpp b/WebCore/platform/graphics/qt/ImageQt.cpp
index c0cfae4..7b46b71 100644
--- a/WebCore/platform/graphics/qt/ImageQt.cpp
+++ b/WebCore/platform/graphics/qt/ImageQt.cpp
@@ -102,20 +102,31 @@ void Image::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRect, const
     if (!framePixmap) // If it's too early we won't have an image yet.
         return;
 
+    QRectF dr = QRectF(destRect).normalized();
+    if (!dr.width() || !dr.height()) // Qt interprets 0 width/height as full width/height so just short circuit.
+        return;
+
     QPixmap pixmap = *framePixmap;
-    QRect tr = QRectF(tileRect).toRect();
+    QRect tr = QRectF(tileRect).toRect().normalized();
     if (tr.x() || tr.y() || tr.width() != pixmap.width() || tr.height() != pixmap.height())
         pixmap = pixmap.copy(tr);
 
-    QBrush b(pixmap);
-    b.setTransform(patternTransform);
     ctxt->save();
+
     ctxt->setCompositeOperation(op);
     QPainter* p = ctxt->platformContext();
     if (!pixmap.hasAlpha() && p->compositionMode() == QPainter::CompositionMode_SourceOver)
         p->setCompositionMode(QPainter::CompositionMode_Source);
-    p->setBrushOrigin(phase);
-    p->fillRect(destRect, b);
+
+    /* Translate the coordinates as phase is not in world matrix coordinate space but the tile rect origin is. */
+    QTransform transform(patternTransform);
+    transform *= QTransform().translate(phase.x(), phase.y());
+    transform.translate(tr.x(), tr.y());
+
+    QBrush b(pixmap);
+    b.setTransform(transform);
+    p->fillRect(dr, b);
+
     ctxt->restore();
 
     if (imageObserver())

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list