inconsistency in drawImage with target rect negative dimensions.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Jan 2013 20:25:06 +0000 (20:25 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Jan 2013 20:25:06 +0000 (20:25 +0000)
commit69426a418e57d584d8716b8ad3a5c96bbf1c5b1e
treec19b0981cc3539673f68b6412970e60dcef4b5db
parentec3faed8503149d14cd5112b795038f8be34fe0d
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: https://svn.webkit.org/repository/webkit/trunk@139911 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/canvas/drawImage-with-negative-source-destination-expected.txt
LayoutTests/fast/canvas/drawImage-with-negative-source-destination.js
PerformanceTests/Canvas/drawimage.html [new file with mode: 0644]
PerformanceTests/ChangeLog
PerformanceTests/Skipped
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/GraphicsContext.cpp
Source/WebCore/platform/graphics/GraphicsContext.h
Source/WebCore/platform/graphics/filters/FEComposite.cpp
Source/WebCore/platform/graphics/gstreamer/ImageGStreamer.h