Proposal: Add support for even-odd fill and clip to Canvas
https://bugs.webkit.org/show_bug.cgi?id=106188

Patch by Rik Cabanier <cabanier@adobe.com> on 2013-01-21
Reviewed by Dirk Schulze.

Source/WebCore:

This patch adds support for an optional winding rule to fill, clip
and isPointInPath in canvas 2d. By default, the fill is non-zero but
you can now pass in an optional winding rule string ("nonzero" or "evenodd")
to make an explicit choice.

Tests: fast/canvas/canvas-clip-rule.html
       fast/canvas/canvas-fill-rule.html
       fast/canvas/canvas-isPointInPath-winding.html

* html/canvas/CanvasRenderingContext2D.cpp: Change implementation so it sets the windig rule in the context.
(WebCore::parseWinding):
(WebCore):
(WebCore::CanvasRenderingContext2D::fill):
(WebCore::CanvasRenderingContext2D::clip):
(WebCore::CanvasRenderingContext2D::isPointInPath):
* html/canvas/CanvasRenderingContext2D.h:
(CanvasRenderingContext2D):
* html/canvas/CanvasRenderingContext2D.idl: Change the idl so the new API is exposed to JavaScript.
* platform/graphics/cg/GraphicsContextCG.cpp: Fixes a bug where the wrong winding rule was set for clipping in Core Graphics.
(WebCore::GraphicsContext::clip):

LayoutTests:

Add tests to verify that the winding rule work as expected with clip, fill and isPointInPath

* fast/canvas/canvas-clip-rule-expected.txt: Added.
* fast/canvas/canvas-clip-rule.html: Added.
* fast/canvas/canvas-fill-rule-expected.txt: Added.
* fast/canvas/canvas-fill-rule.html: Added.
* fast/canvas/canvas-isPointInPath-winding-expected.txt: Added.
* fast/canvas/canvas-isPointInPath-winding.html: Added.
* fast/canvas/script-tests/canvas-clip-rule.js: Added.
(pixelDataAtPoint):
(checkResult):
(prepareTestScenario):
* fast/canvas/script-tests/canvas-fill-rule.js: Added.
(pixelDataAtPoint):
(checkResult):
(prepareTestScenario):
* fast/canvas/script-tests/canvas-isPointInPath-winding.js: Added.
(prepareTestScenario):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140352 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed.  Rolled Chromium DEPS to r177953.  Requested by
thakis_ via sheriffbot.

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-01-21

* DEPS:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140353 268f45cc-cd09-0410-ab3c-d52691b4dbfc