Bug 161089 - Add support for CanvasRenderingContext2D.resetTransform()
Summary: Add support for CanvasRenderingContext2D.resetTransform()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL: https://html.spec.whatwg.org/#dom-con...
Keywords: WebExposed
Depends on:
Blocks:
 
Reported: 2016-08-23 10:04 PDT by Chris Dumez
Modified: 2016-08-23 19:15 PDT (History)
10 users (show)

See Also:


Attachments
Patch (9.85 KB, patch)
2016-08-23 10:06 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews122 for ios-simulator-elcapitan-wk2 (612.23 KB, application/zip)
2016-08-23 11:29 PDT, Build Bot
no flags Details
Patch (17.39 KB, patch)
2016-08-23 16:08 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2016-08-23 10:04:08 PDT
Add support for CanvasRenderingContext2D.resetTransform():
- https://html.spec.whatwg.org/#dom-context-2d-resettransform

Firefox and Chrome already support this.
Comment 1 Chris Dumez 2016-08-23 10:06:21 PDT
Created attachment 286724 [details]
Patch
Comment 2 Simon Fraser (smfr) 2016-08-23 11:01:08 PDT
Comment on attachment 286724 [details]
Patch

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

> LayoutTests/imported/w3c/ChangeLog:11
> +        * web-platform-tests/2dcontext/transformations/canvas_transformations_reset_001-expected.html: Added.
> +        * web-platform-tests/2dcontext/transformations/canvas_transformations_reset_001.html: Added.
> +        Import W3C test to cover CanvasRenderingContext2D.resetTransform().
> +

Would be nice to have a test that tests this across save/restore.
Comment 3 Build Bot 2016-08-23 11:29:47 PDT
Comment on attachment 286724 [details]
Patch

Attachment 286724 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1928645

New failing tests:
imported/w3c/web-platform-tests/2dcontext/transformations/canvas_transformations_reset_001.html
Comment 4 Build Bot 2016-08-23 11:29:51 PDT
Created attachment 286748 [details]
Archive of layout-test-results from ews122 for ios-simulator-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews122  Port: ios-simulator-elcapitan-wk2  Platform: Mac OS X 10.11.5
Comment 5 Said Abou-Hallawa 2016-08-23 11:58:51 PDT
Comment on attachment 286724 [details]
Patch

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

> Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:821
>      if (!ctm.isInvertible())

Can't we use if (!state().hasInvertibleTransform) instead?
Comment 6 Chris Dumez 2016-08-23 12:07:58 PDT
(In reply to comment #5)
> Comment on attachment 286724 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=286724&action=review
> 
> > Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:821
> >      if (!ctm.isInvertible())
> 
> Can't we use if (!state().hasInvertibleTransform) instead?

I have merely moved the existing code but I will check.
Comment 7 Said Abou-Hallawa 2016-08-23 14:38:28 PDT
Comment on attachment 286724 [details]
Patch

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

>>> Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:821
>>>      if (!ctm.isInvertible())
>> 
>> Can't we use if (!state().hasInvertibleTransform) instead?
> 
> I have merely moved the existing code but I will check.

state().hasInvertibleTransform is a cached value for state().isInvertible() since the later is an expensive operation.
Comment 8 Chris Dumez 2016-08-23 16:08:02 PDT
Created attachment 286799 [details]
Patch
Comment 9 WebKit Commit Bot 2016-08-23 19:14:53 PDT
Comment on attachment 286799 [details]
Patch

Clearing flags on attachment: 286799

Committed r204878: <http://trac.webkit.org/changeset/204878>
Comment 10 WebKit Commit Bot 2016-08-23 19:15:01 PDT
All reviewed patches have been landed.  Closing bug.