Large canvas fills should not crash or create unnecessarily large image buffers
https://bugs.webkit.org/show_bug.cgi?id=67988
Source/WebCore:
When using source-in, destination-in, source-out, or destination-atop a temporary
buffer is created. This buffer only needs to be big enough to cover the intersection
of the path and the canvas. If the area of intersection between the fill and the
canvas is empty the canvas is completely cleared and a temporary buffer is not used.
This change also adds some null checks for failures to create contexts or buffers.
Patch by Ben Wells <benwells@chromium.org> on 2011-09-16
Reviewed by Darin Adler.
Test: fast/canvas/canvas-large-fills.html
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::clearCanvas):
(WebCore::CanvasRenderingContext2D::fillAndDisplayTransparencyElsewhere):
LayoutTests:
Patch by Ben Wells <benwells@chromium.org> on 2011-09-16
Reviewed by Darin Adler.
* fast/canvas/canvas-large-fills-expected.txt: Added.
* fast/canvas/canvas-large-fills.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95346
268f45cc-cd09-0410-ab3c-
d52691b4dbfc