Support canvas.resetTransform() interface.
Created attachment 137269 [details] Patch
Comment on attachment 137269 [details] Patch Attachment 137269 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/12408859 New failing tests: platform/chromium/virtual/gpu/fast/canvas/canvas-resetTransform.html fast/canvas/canvas-resetTransform.html
Created attachment 137276 [details] Archive of layout-test-results from ec2-cr-linux-03 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: ec2-cr-linux-03 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Created attachment 137278 [details] Patch
Comment on attachment 137278 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=137278&action=review > Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:670 > + state().m_transform = AffineTransform(); Shouldn't this be makeIdentity()?
Comment on attachment 137278 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=137278&action=review > LayoutTests/fast/canvas/script-tests/canvas-resetTransform.js:15 > +ctx.beginPath(); > +ctx.scale(0.5, 0.5); > +ctx.resetTransform(); > +ctx.fillStyle = 'green'; > +ctx.fillRect(0, 0, 100, 100); > + > +var imageData = ctx.getImageData(1, 1, 98, 98); > +var imgdata = imageData.data; > +shouldBe("imgdata[4]", "0"); > +shouldBe("imgdata[5]", "128"); > +shouldBe("imgdata[6]", "0"); I would expect this test to draw two identical rects with different colours, one with a scale and one after the resetTransform, and test both corners of the imagedata. Am I missing something? And maybe have some debug() statements to explain what's going on. > Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:668 > + if (!ctm.isInvertible()) > + return; Is this behaviour explained anywhere? I can understand why the other transformation functions have it, but in this case we're trying to reset the transform to identity, so I don't know why it is should fail if there is a currently un-invertable state. >> Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:670 >> + state().m_transform = AffineTransform(); > > Shouldn't this be makeIdentity()? Agreed.
Comment on attachment 137278 [details] Patch r- until Dean and Alexey's comments are addressed.
It seems we already support resetTransform. Lets close this out.