[Cairo] Canvas-shadow behavior is not being as expected
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Apr 2013 23:06:16 +0000 (23:06 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Apr 2013 23:06:16 +0000 (23:06 +0000)
commit994ff4c84366d0efc408dd65ba48ea83a157a04a
tree78002e976ab765c29820dbe95951b38c55f8c3be
parent372aa228fb97bcde3c01d16c11c06c70fe7a31fa
[Cairo] Canvas-shadow behavior is not being as expected
https://bugs.webkit.org/show_bug.cgi?id=108897

Patch by Rashmi Shyamasundar <rashmi.s2@samsung.com> on 2013-04-22
Reviewed by Martin Robinson.

Source/WebCore:

Use the pattern-extend-mode "CAIRO_EXTEND_NONE" instead of "CAIRO_EXTEND_PAD" in
PlatformContextCairo::drawSurfaceToContext().

In the function PlatformContextCairo::drawSurfaceToContext(), a pattern is being
created from the source surface and this pattern is drawn onto the destination
context. There is no gradient involved. Hence the extend mode for filling the
pattern should be "CAIRO_EXTEND_NONE". If we use the extend mode
"CAIRO_EXTEND_PAD" in PlatformContextCairo::drawSurfaceToContext(), the original
image area is also filled with the shadow color which is not the expected behavior.

Test: fast/canvas/canvas-image-shadow.html

* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::PlatformContextCairo::drawSurfaceToContext):

LayoutTests:

Test to verify the shadow of an image drawn on canvas.
This test uses an image whose size is smaller than,
the size of the rectangle which should be filled with the image.

* fast/canvas/canvas-image-shadow-expected.txt: Added.
* fast/canvas/canvas-image-shadow.html: Added.
* fast/canvas/green.png: Added.
* fast/canvas/script-tests/canvas-image-shadow.js: Added.
(draw):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@148923 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/canvas/script-tests/shadow-image.js [new file with mode: 0755]
LayoutTests/fast/canvas/shadow-image-expected.txt [new file with mode: 0644]
LayoutTests/fast/canvas/shadow-image.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp