[skia] Handle mask box image.
authorAlpha Lam <hclam@chromium.org>
Mon, 29 Oct 2012 20:57:13 +0000 (20:57 +0000)
committerAlpha Lam <hclam@chromium.org>
Mon, 29 Oct 2012 20:57:13 +0000 (20:57 +0000)
commit3783cd2147056df767fd68cfdff891ae2372e05a
tree744f3abdb94524255dc3322fea1ecb152c0df9cc
parent9c84b4a1fd9a4f90fc63ed9ede4952885f10b068
[skia] Handle mask box image.
https://bugs.webkit.org/show_bug.cgi?id=100570

Reviewed by James Robinson.

Source/WebCore:

When drawing an image with source rectangle it should intersect with image rectangle.
This should be the case for drawing single image and tiling an image.

Test: fast/images/mask-box-image-crash.html

* platform/graphics/skia/ImageSkia.cpp:
(WebCore::Image::drawPattern):
(WebCore::BitmapImage::draw):
(WebCore::BitmapImageSingleFrameSkia::draw):

LayoutTests:

Added a test for -webkit-mask-box-image. Test should complete without crashes.
Output image should be blank.

* fast/images/mask-box-image-crash-expected.png: Added.
* fast/images/mask-box-image-crash-expected.txt: Added.
* fast/images/mask-box-image-crash.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132844 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/images/mask-box-image-crash-expected.png [new file with mode: 0644]
LayoutTests/fast/images/mask-box-image-crash-expected.txt [new file with mode: 0644]
LayoutTests/fast/images/mask-box-image-crash.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/skia/ImageSkia.cpp