Bug 130236

Summary: Refactor Path to Path2D and remove currentPath
Product: WebKit Reporter: Dirk Schulze <krit>
Component: CanvasAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, cdumez, cgarcia, commit-queue, dino, esprehn+autocc, gyuyoung.kim, kondapallykalyan, rniwa
Priority: P2 Keywords: WebExposed
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
buildbot: commit-queue-
Archive of layout-test-results from webkit-ews-06 for mac-mountainlion
none
Archive of layout-test-results from webkit-ews-16 for mac-mountainlion-wk2
none
Patch
buildbot: commit-queue-
Archive of layout-test-results from webkit-ews-08 for mac-mountainlion
none
Archive of layout-test-results from webkit-ews-05 for mac-mountainlion
none
Archive of layout-test-results from webkit-ews-16 for mac-mountainlion-wk2
none
Archive of layout-test-results from webkit-ews-12 for mac-mountainlion-wk2
none
Patch
dino: review+
Patch for landing
none
Patch for landing... for real this time none

Description Dirk Schulze 2014-03-14 06:57:06 PDT
Other implementations prefer Path2D over Path. Furthermore, currentPath is not the right way to apply a Path2D. Instead pass Path2D as argument to fill, stroke, clip.
Comment 1 Dirk Schulze 2014-03-14 07:05:03 PDT
Created attachment 226708 [details]
Patch
Comment 2 Build Bot 2014-03-14 08:09:07 PDT
Comment on attachment 226708 [details]
Patch

Attachment 226708 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/6234891448483840

New failing tests:
js/dom/global-constructors-attributes.html
Comment 3 Build Bot 2014-03-14 08:09:12 PDT
Created attachment 226716 [details]
Archive of layout-test-results from webkit-ews-06 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-06  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 4 Build Bot 2014-03-14 08:20:25 PDT
Comment on attachment 226708 [details]
Patch

Attachment 226708 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/5306108528820224

New failing tests:
js/dom/global-constructors-attributes.html
Comment 5 Build Bot 2014-03-14 08:20:33 PDT
Created attachment 226718 [details]
Archive of layout-test-results from webkit-ews-16 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-16  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 6 Dirk Schulze 2014-03-14 09:01:37 PDT
Created attachment 226722 [details]
Patch
Comment 7 Build Bot 2014-03-14 10:44:01 PDT
Comment on attachment 226722 [details]
Patch

Attachment 226722 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/6110487183884288

New failing tests:
js/dom/global-constructors-attributes.html
Comment 8 Build Bot 2014-03-14 10:44:06 PDT
Created attachment 226732 [details]
Archive of layout-test-results from webkit-ews-08 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-08  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 9 Build Bot 2014-03-14 11:12:13 PDT
Comment on attachment 226722 [details]
Patch

Attachment 226722 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/5204266264297472

New failing tests:
js/dom/global-constructors-attributes.html
Comment 10 Build Bot 2014-03-14 11:12:21 PDT
Created attachment 226737 [details]
Archive of layout-test-results from webkit-ews-05 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-05  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 11 Build Bot 2014-03-14 12:18:31 PDT
Comment on attachment 226722 [details]
Patch

Attachment 226722 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/5145496616173568

New failing tests:
js/dom/global-constructors-attributes.html
Comment 12 Build Bot 2014-03-14 12:18:41 PDT
Created attachment 226750 [details]
Archive of layout-test-results from webkit-ews-16 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-16  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 13 Build Bot 2014-03-14 13:15:29 PDT
Comment on attachment 226722 [details]
Patch

Attachment 226722 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/4896682181394432

New failing tests:
js/dom/global-constructors-attributes.html
Comment 14 Build Bot 2014-03-14 13:15:37 PDT
Created attachment 226755 [details]
Archive of layout-test-results from webkit-ews-12 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-12  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 15 Dirk Schulze 2014-03-14 13:26:21 PDT
Created attachment 226757 [details]
Patch

I fixed you expectation files Mac ML. Please stay cool!
Comment 16 Dean Jackson 2014-03-14 13:34:27 PDT
Comment on attachment 226757 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=226757&action=review

> LayoutTests/fast/canvas/script-tests/canvas-clip-path.js:18
> +	if (!data.length)
> +		return true;
> +	var c = {r:0,g:0,b:0,a:0};
> +	for (var i = 0; i < data.length; i += 4) {
> +		c.r += data[i];
> +		c.g += data[i+1];
> +		c.b += data[i+2];
> +		c.a += data[i+3];
> +	}
> +	if (refColor.r == Math.round(c.r/data.length*4)
> +		&& refColor.g == Math.round(c.g/data.length*4)
> +		&& refColor.b == Math.round(c.b/data.length*4)
> +		&& refColor.a == Math.round(c.a/data.length*4))
> +		return true;
> +	return false;

So much indent!!

> LayoutTests/fast/canvas/script-tests/canvas-stroke-path.js:19
> +function areaColor(data, refColor) {
> +	if (!data.length)
> +		return true;
> +	var c = {r:0,g:0,b:0,a:0};
> +	for (var i = 0; i < data.length; i += 4) {
> +		c.r += data[i];
> +		c.g += data[i+1];
> +		c.b += data[i+2];
> +		c.a += data[i+3];
> +	}
> +	if (refColor.r == Math.round(c.r/data.length*4)
> +		&& refColor.g == Math.round(c.g/data.length*4)
> +		&& refColor.b == Math.round(c.b/data.length*4)
> +		&& refColor.a == Math.round(c.a/data.length*4))
> +		return true;
> +	return false;
> +}

So much indent here too!

> Source/WebCore/html/canvas/CanvasRenderingContext2D.h:141
> +    void fill(DOMPath* , const String& winding = "nonzero");
> +    void stroke(DOMPath*);
> +    void clip(DOMPath* , const String& winding = "nonzero");

Nit: extra space between * and ,
Comment 17 Dirk Schulze 2014-03-14 14:00:04 PDT
Created attachment 226762 [details]
Patch for landing
Comment 18 Dirk Schulze 2014-03-14 14:02:29 PDT
Created attachment 226764 [details]
Patch for landing... for real this time
Comment 19 WebKit Commit Bot 2014-03-14 14:43:55 PDT
Comment on attachment 226764 [details]
Patch for landing... for real this time

Clearing flags on attachment: 226764

Committed r165651: <http://trac.webkit.org/changeset/165651>
Comment 20 WebKit Commit Bot 2014-03-14 14:44:02 PDT
All reviewed patches have been landed.  Closing bug.