RESOLVED FIXED 16604
<canvas> lacks transform() and setTransform()
https://bugs.webkit.org/show_bug.cgi?id=16604
Summary <canvas> lacks transform() and setTransform()
Ilmari Heikkinen
Reported 2007-12-25 10:09:59 PST
Safari lacks the canvas matrix transformation functions ctx.transform(m00,m01,m10,m11,dx,dy) and ctx.setTransform(m00,m01,m10,m11,dx,dy). http://www.whatwg.org/specs/web-apps/current-work/multipage/section-the-canvas.html#transform
Attachments
Testcase for transform() and setTransform() (420 bytes, text/html)
2007-12-25 10:10 PST, Ilmari Heikkinen
no flags
add setTransform() support (6.98 KB, patch)
2008-11-24 05:16 PST, Dirk Schulze
no flags
add setTransform() support (2) (17.80 KB, patch)
2008-11-24 17:26 PST, Dirk Schulze
no flags
setTransform() for Canvas (17.53 KB, patch)
2008-12-05 14:11 PST, Dirk Schulze
no flags
setTransform() for Canvas (19.06 KB, patch)
2008-12-05 23:35 PST, Dirk Schulze
no flags
setTransform() for Canvas (19.44 KB, patch)
2008-12-06 10:37 PST, Dirk Schulze
no flags
setTransform() for Canvas (21.58 KB, patch)
2008-12-06 22:56 PST, Dirk Schulze
oliver: review+
Ilmari Heikkinen
Comment 1 2007-12-25 10:10:32 PST
Created attachment 18109 [details] Testcase for transform() and setTransform()
Eric Seidel (no email)
Comment 2 2007-12-27 23:23:23 PST
*** Bug 16630 has been marked as a duplicate of this bug. ***
Oliver Hunt
Comment 3 2008-01-28 13:20:00 PST
transform() is easy -- setTransform() is more difficult to do as it requires adding yet a nother set of platform specific methods.
Adam Roben (:aroben)
Comment 4 2008-03-17 14:54:55 PDT
Dirk Schulze
Comment 5 2008-11-24 05:16:47 PST
Created attachment 25424 [details] add setTransform() support This adds setTransform() support. What to do on a CTM, that isn't invertible? Checked behavior on paths that have been added before or after setTransform(), as well as save() and restore() arround setTransform(). The tests do some basic checks. What, if the given matrix is not invertible, is the path transformed with setTransform or only the context, does restore() restore the ctm ...
Dirk Schulze
Comment 6 2008-11-24 17:26:51 PST
Created attachment 25462 [details] add setTransform() support (2) updated the patch. Avoids not-invertable CTM.
Dirk Schulze
Comment 7 2008-11-25 11:00:27 PST
(In reply to comment #6) > Created an attachment (id=25462) [review] > add setTransform() support (2) > > updated the patch. Avoids not-invertable CTM. It's probably enough to check for a not-invertable CTM on the following 'drawing' and 'transformation' methods: scale, rotate, translate, transform, setTransform, beginPath, closePath, moveTo, lineTo, quadraticCurveTo, bezierCurveTo, arcTo, arc, rect, fill, stroke, clip, clipRect, fillRect, strokeRect, drawImage, drawImageFromRect, willDraw, drawTextInternal
Dirk Schulze
Comment 8 2008-12-05 14:11:17 PST
Created attachment 25788 [details] setTransform() for Canvas setTransform() for Canvas with a new LayoutTest.
Dirk Schulze
Comment 9 2008-12-05 23:35:57 PST
Created attachment 25807 [details] setTransform() for Canvas Fixed a bug in isPointInPath and changed expected result of a LayoutTest. setTransform is a new property in fast/dom/Window/window-properties.html
Dirk Schulze
Comment 10 2008-12-06 10:37:48 PST
Created attachment 25815 [details] setTransform() for Canvas Fixed a bug in setTransform(). http://azarask.in/projects/algorithm-ink/ is working again.
Oliver Hunt
Comment 11 2008-12-06 16:43:47 PST
Comment on attachment 25815 [details] setTransform() for Canvas r=me! yay!
Oliver Hunt
Comment 12 2008-12-06 16:52:05 PST
Comment on attachment 25815 [details] setTransform() for Canvas wth, now that the setTransform test fails again. *grumble*
Oliver Hunt
Comment 13 2008-12-06 16:56:36 PST
Comment on attachment 25815 [details] setTransform() for Canvas Am removing the review flag bit, and am going to see if i can work out why CG hates us
Oliver Hunt
Comment 14 2008-12-06 17:28:57 PST
I am having difficulty believing this, but it looks like i might be seeing a codegen error... srsly wtf?
Oliver Hunt
Comment 15 2008-12-06 18:26:31 PST
Further investigation shows that gdb was (simply put) lying to me. unfortunately that means i still have no idea why this is failing.
Dirk Schulze
Comment 16 2008-12-06 22:56:56 PST
Created attachment 25828 [details] setTransform() for Canvas with a fix for Mac
Oliver Hunt
Comment 17 2008-12-07 01:05:25 PST
Fixed r39079
Note You need to log in before you can comment on or make changes to this bug.