Bug 16604 - <canvas> lacks transform() and setTransform()
Summary: <canvas> lacks transform() and setTransform()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 523.x (Safari 3)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: http://www.whatwg.org/specs/web-apps/...
Keywords: HasReduction, InRadar
: 16630 (view as bug list)
Depends on: 17169
Blocks:
  Show dependency treegraph
 
Reported: 2007-12-25 10:09 PST by Ilmari Heikkinen
Modified: 2008-12-07 01:05 PST (History)
2 users (show)

See Also:


Attachments
Testcase for transform() and setTransform() (420 bytes, text/html)
2007-12-25 10:10 PST, Ilmari Heikkinen
no flags Details
add setTransform() support (6.98 KB, patch)
2008-11-24 05:16 PST, Dirk Schulze
no flags Details | Formatted Diff | Diff
add setTransform() support (2) (17.80 KB, patch)
2008-11-24 17:26 PST, Dirk Schulze
no flags Details | Formatted Diff | Diff
setTransform() for Canvas (17.53 KB, patch)
2008-12-05 14:11 PST, Dirk Schulze
no flags Details | Formatted Diff | Diff
setTransform() for Canvas (19.06 KB, patch)
2008-12-05 23:35 PST, Dirk Schulze
no flags Details | Formatted Diff | Diff
setTransform() for Canvas (19.44 KB, patch)
2008-12-06 10:37 PST, Dirk Schulze
no flags Details | Formatted Diff | Diff
setTransform() for Canvas (21.58 KB, patch)
2008-12-06 22:56 PST, Dirk Schulze
oliver: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ilmari Heikkinen 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
Comment 1 Ilmari Heikkinen 2007-12-25 10:10:32 PST
Created attachment 18109 [details]
Testcase for transform() and setTransform()
Comment 2 Eric Seidel 2007-12-27 23:23:23 PST
*** Bug 16630 has been marked as a duplicate of this bug. ***
Comment 3 Oliver Hunt 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.
Comment 4 Adam Roben (:aroben) 2008-03-17 14:54:55 PDT
<rdar://5691316>
Comment 5 Dirk Schulze 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 ...
Comment 6 Dirk Schulze 2008-11-24 17:26:51 PST
Created attachment 25462 [details]
add setTransform() support (2)

updated the patch. Avoids not-invertable CTM.
Comment 7 Dirk Schulze 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
Comment 8 Dirk Schulze 2008-12-05 14:11:17 PST
Created attachment 25788 [details]
setTransform() for Canvas

setTransform() for Canvas with a new LayoutTest.
Comment 9 Dirk Schulze 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
Comment 10 Dirk Schulze 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.
Comment 11 Oliver Hunt 2008-12-06 16:43:47 PST
Comment on attachment 25815 [details]
setTransform() for Canvas

r=me! yay!
Comment 12 Oliver Hunt 2008-12-06 16:52:05 PST
Comment on attachment 25815 [details]
setTransform() for Canvas

wth, now that the setTransform test fails again.  *grumble*
Comment 13 Oliver Hunt 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
Comment 14 Oliver Hunt 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?
Comment 15 Oliver Hunt 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.
Comment 16 Dirk Schulze 2008-12-06 22:56:56 PST
Created attachment 25828 [details]
setTransform() for Canvas

with a fix for Mac
Comment 17 Oliver Hunt 2008-12-07 01:05:25 PST
Fixed r39079