WebCore:
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Apr 2008 18:15:34 +0000 (18:15 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Apr 2008 18:15:34 +0000 (18:15 +0000)
2008-04-28  David Hyatt  <hyatt@apple.com>

        https://bugs.webkit.org/show_bug.cgi?id=18779

        The arguments in drawImage were reversed when I switched away from the image buffer method.

        Reviewed by Tim Hatcher

        Added fast/canvas/drawImage.html

        * html/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::drawImage):

LayoutTests:

2008-04-28  David Hyatt  <hyatt@apple.com>

        Add layout test for canvas.

        Reviewed by Tim Hatcher

        * fast/canvas/drawImage.html: Added.
        * platform/mac/fast/canvas/drawImage-expected.checksum: Added.
        * platform/mac/fast/canvas/drawImage-expected.png: Added.
        * platform/mac/fast/canvas/drawImage-expected.txt: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/canvas/drawImage.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/canvas/drawImage-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/canvas/drawImage-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/canvas/drawImage-expected.txt [new file with mode: 0644]
WebCore/ChangeLog
WebCore/html/CanvasRenderingContext2D.cpp

index ec84cf7..5be9ba5 100644 (file)
@@ -1,3 +1,14 @@
+2008-04-28  David Hyatt  <hyatt@apple.com>
+
+        Add layout test for canvas.
+
+        Reviewed by Tim Hatcher
+
+        * fast/canvas/drawImage.html: Added.
+        * platform/mac/fast/canvas/drawImage-expected.checksum: Added.
+        * platform/mac/fast/canvas/drawImage-expected.png: Added.
+        * platform/mac/fast/canvas/drawImage-expected.txt: Added.
+
 2008-04-28  Holger Hans Peter Freyther  <zecke@selfish.org>
 
         Reviewed by Simon.
diff --git a/LayoutTests/fast/canvas/drawImage.html b/LayoutTests/fast/canvas/drawImage.html
new file mode 100644 (file)
index 0000000..8e85957
--- /dev/null
@@ -0,0 +1,14 @@
+If this renders correctly you should see one big friendly green square.
+<canvas id="canvas" width="200" height="200" ></canvas>
+<canvas id="canvas2" width="200" height="200" style="display:none" ></canvas>
+<script>
+var canvas = document.getElementById("canvas");
+var canvas2 = document.getElementById("canvas2");
+var context = canvas.getContext("2d");
+var context2 = canvas2.getContext("2d");
+context2.fillStyle = 'red';
+context2.fillRect(0,0,200,200);
+context2.fillStyle = 'green';
+context2.fillRect(50,50,100,100);
+context.drawImage(canvas2, 50, 50, 100, 100, 0, 0, 200, 200);
+</script>
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/canvas/drawImage-expected.checksum b/LayoutTests/platform/mac/fast/canvas/drawImage-expected.checksum
new file mode 100644 (file)
index 0000000..c6e1bcb
--- /dev/null
@@ -0,0 +1 @@
+640ad41fe81631f8afaf26bf1eaa080e
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/canvas/drawImage-expected.png b/LayoutTests/platform/mac/fast/canvas/drawImage-expected.png
new file mode 100644 (file)
index 0000000..6a810f8
Binary files /dev/null and b/LayoutTests/platform/mac/fast/canvas/drawImage-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/canvas/drawImage-expected.txt b/LayoutTests/platform/mac/fast/canvas/drawImage-expected.txt
new file mode 100644 (file)
index 0000000..a4d31df
--- /dev/null
@@ -0,0 +1,10 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderText {#text} at (0,186) size 439x18
+        text run at (0,186) width 439: "If this renders correctly you should see one big friendly green square. "
+      RenderHTMLCanvas {CANVAS} at (439,0) size 200x200
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
index 6be9dde..6d289b3 100644 (file)
@@ -1,3 +1,16 @@
+2008-04-28  David Hyatt  <hyatt@apple.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=18779
+
+        The arguments in drawImage were reversed when I switched away from the image buffer method.
+
+        Reviewed by Tim Hatcher
+
+        Added fast/canvas/drawImage.html
+
+        * html/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::drawImage):
+
 2008-04-28  Holger Hans Peter Freyther  <zecke@selfish.org>
 
         Reviewed by Simon.
index 4c32c51..62f5a0c 100644 (file)
@@ -1023,7 +1023,7 @@ void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* canvas, const FloatR
         m_canvas->setOriginTainted();
 
     willDraw(destRect);
-    c->drawImage(buffer->image(), sourceRect, destRect);
+    c->drawImage(buffer->image(), destRect, sourceRect);
 }
 
 // FIXME: Why isn't this just another overload of drawImage? Why have a different name?