2006-09-20 Julien Palmas <julien.palmas@gmail.com>
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Sep 2006 22:38:59 +0000 (22:38 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Sep 2006 22:38:59 +0000 (22:38 +0000)
        Reviewed by eseidel.  Landed by eseidel.

        Test: svg/custom/pattern-y-offset.svg

        * kcanvas/device/quartz/KRenderingPaintServerQuartz.mm:
        (WebCore::KRenderingPaintServerPatternQuartz::setup):

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

LayoutTests/ChangeLog
LayoutTests/svg/custom/pattern-y-offset-expected.checksum [new file with mode: 0644]
LayoutTests/svg/custom/pattern-y-offset-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/pattern-y-offset-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/pattern-y-offset.svg [new file with mode: 0644]
WebCore/ChangeLog
WebCore/kcanvas/device/quartz/KRenderingPaintServerQuartz.mm

index a813b94720d5bd1b9002a2dae07753fa1e3b68bd..350880246915c3facee0cde27e4517544d2bad6f 100644 (file)
@@ -1,3 +1,14 @@
+2006-09-20  Julien Palmas  <julien.palmas@gmail.com>
+
+        Reviewed by eseidel.  Landed by eseidel.
+        
+        Test for http://bugzilla.opendarwin.org/show_bug.cgi?id=6003
+
+        * svg/custom/pattern-y-offset-expected.checksum: Added.
+        * svg/custom/pattern-y-offset-expected.png: Added.
+        * svg/custom/pattern-y-offset-expected.txt: Added.
+        * svg/custom/pattern-y-offset.svg: Added.
+
 2006-09-20  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by harrison
diff --git a/LayoutTests/svg/custom/pattern-y-offset-expected.checksum b/LayoutTests/svg/custom/pattern-y-offset-expected.checksum
new file mode 100644 (file)
index 0000000..6c556b3
--- /dev/null
@@ -0,0 +1 @@
+ffa049d1eb419017e233db5fc754a69c
\ No newline at end of file
diff --git a/LayoutTests/svg/custom/pattern-y-offset-expected.png b/LayoutTests/svg/custom/pattern-y-offset-expected.png
new file mode 100644 (file)
index 0000000..7a9ce9e
Binary files /dev/null and b/LayoutTests/svg/custom/pattern-y-offset-expected.png differ
diff --git a/LayoutTests/svg/custom/pattern-y-offset-expected.txt b/LayoutTests/svg/custom/pattern-y-offset-expected.txt
new file mode 100644 (file)
index 0000000..0702b90
--- /dev/null
@@ -0,0 +1,7 @@
+KRenderingPaintServer {id="patternUserSpace" [type=PATTERN] [bbox=at (0,0) size 0x0]}
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+    KCanvasContainer {svg} at (-0.50,-0.50) size 121x81
+      KCanvasContainer {pattern} at (-0.50,-0.50) size 51x31
+        KCanvasItem {rect} at (-0.50,-0.50) size 51x31 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#0000FF]}] [data="M0.00,0.00L50.00,0.00L50.00,30.00L0.00,30.00"]
+      KCanvasItem {rect} at (19.50,19.50) size 101x61 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=PATTERN] [bbox=at (0,0) size 0x0]}] [data="M20.00,20.00L120.00,20.00L120.00,80.00L20.00,80.00"]
diff --git a/LayoutTests/svg/custom/pattern-y-offset.svg b/LayoutTests/svg/custom/pattern-y-offset.svg
new file mode 100644 (file)
index 0000000..c40061b
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+
+<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">
+
+    <pattern id="patternUserSpace" patternUnits="userSpaceOnUse" patternContentUnits="userSpaceOnUse" x="20" y="20" width="50" height="30">
+      <rect x="0" y="0" width="50" height="30" fill="blue" stroke="green"/>
+    </pattern>
+    
+    <rect x="20" y="20" width="100" height="60" fill="url(#patternUserSpace)" stroke="black"/>
+
+</svg>
+
index b5fd394aa8a567bf588bffab636c7d738b1b3925..2ce41235d8c6a0ffd733a8ec02ed9576fbe5c0ff 100644 (file)
@@ -1,3 +1,12 @@
+2006-09-20  Julien Palmas  <julien.palmas@gmail.com>
+
+        Reviewed by eseidel.  Landed by eseidel.
+
+        Test: svg/custom/pattern-y-offset.svg
+
+        * kcanvas/device/quartz/KRenderingPaintServerQuartz.mm:
+        (WebCore::KRenderingPaintServerPatternQuartz::setup):
+
 2006-09-20  David Hyatt  <hyatt@apple.com>
 
         Add a new wheelEvent method to ScrollView.  Platforms that wish
index ef86ddb62a8efabca82a5afb14fd2a71cc3d9d2a..ab34e0614c7d23b0b999fb86ef849d640837581e 100644 (file)
@@ -169,7 +169,7 @@ bool KRenderingPaintServerPatternQuartz::setup(KRenderingDeviceContext* renderin
     CGAffineTransform transform = patternTransform();
     transform = CGAffineTransformConcat(transform, ctm);
 
-    CGSize phase = CGSizeMake(bbox().x(), bbox().y());
+    CGSize phase = CGSizeMake(bbox().x(), -bbox().y()); // Pattern space seems to start in the lower-left, so we flip the Y here.
     CGContextSetPatternPhase(context, phase);
 
     CGPatternCallbacks callbacks = {0, patternCallback, NULL};