inconsistency in drawImage with target rect negative dimensions.
https://bugs.webkit.org/show_bug.cgi?id=100026

Patch by Arnaud Renevier <a.renevier@sisa.samsung.com> on 2013-01-16
Reviewed by Dean Jackson.

PerformanceTests:

Create a drawImage performance test. There is no significative change
in performance: 27144.6851528 runs/s without the patch; 27153.517612
runs/s with the patch. Test is currently skipped.

* Canvas/drawimage.html: Added.
* Skipped:

Source/WebCore:

Remove -1, -1 special case in drawImage and drawImageBuffer. Replace
all -1 -1 arguments calls to with the correct rectangle dimensions.

Remove FloatRect(0, 0, -1, -1) default argument for srcRect, and
instead, add new overloaded functions to create a FloatRect from image
size.

Replace -1 -1 arguments calls in FEComposite::platformApplySoftware
with correct rectangle dimensions.

Replace ImageGStreamer rect method (which may return -1 -1 rectangle)
with cropRect method, and make caller check for rectangle emptiness.

* fast/canvas/drawImage-with-negative-source-destination-expected.txt:
* fast/canvas/drawImage-with-negative-source-destination.js:

* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawImage):
(WebCore):
(WebCore::GraphicsContext::drawImageBuffer):
* platform/graphics/GraphicsContext.h:
(GraphicsContext):
* platform/graphics/filters/FEComposite.cpp:
(WebCore::FEComposite::platformApplySoftware):
* platform/graphics/gstreamer/ImageGStreamer.h:
(WebCore::ImageGStreamer::rect):

LayoutTests:

Add a drawImage check for a destination rectangle with -1px
width/height. When drawing to (1, 1, -1, -1) rectangle, first
(top-left) pixel should have been and been the only one drawn into.

* fast/canvas/drawImage-with-negative-source-destination-expected.txt:
* fast/canvas/drawImage-with-negative-source-destination.js:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139911 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/PerformanceTests/ChangeLog b/PerformanceTests/ChangeLog
index 1881875..11ba648 100644
--- a/PerformanceTests/ChangeLog
+++ b/PerformanceTests/ChangeLog
@@ -1,3 +1,17 @@
+2013-01-16  Arnaud Renevier  <a.renevier@sisa.samsung.com>
+
+        inconsistency in drawImage with target rect negative dimensions.
+        https://bugs.webkit.org/show_bug.cgi?id=100026
+
+        Reviewed by Dean Jackson.
+
+        Create a drawImage performance test. There is no significative change
+        in performance: 27144.6851528 runs/s without the patch; 27153.517612
+        runs/s with the patch. Test is currently skipped.
+
+        * Canvas/drawimage.html: Added.
+        * Skipped:
+
 2013-01-15  Dominic Cooney  <dominicc@chromium.org>
 
         Allow zero values as results from the runFunction.