Bug 17169 - Support transform on Canvas
Summary: Support transform on Canvas
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Oliver Hunt
URL:
Keywords:
Depends on:
Blocks: 16604
  Show dependency treegraph
 
Reported: 2008-02-03 17:13 PST by Oliver Hunt
Modified: 2008-02-03 19:44 PST (History)
1 user (show)

See Also:


Attachments
Patch to support transform (13.47 KB, patch)
2008-02-03 18:01 PST, Oliver Hunt
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Hunt 2008-02-03 17:13:04 PST
Add transform() support to Canvas
Comment 1 Oliver Hunt 2008-02-03 18:01:06 PST
Created attachment 18893 [details]
Patch to support transform
Comment 2 Darin Adler 2008-02-03 18:14:35 PST
Comment on attachment 18893 [details]
Patch to support transform

+    state().m_path.transform(transform.inverse());

Is the transform guaranteed to be invertible? If not, what happens? Does a test case cover this?
Comment 3 Maciej Stachowiak 2008-02-03 18:19:35 PST
Comment on attachment 18893 [details]
Patch to support transform

Looks good, assuming isfinite checks for NaN as well as infinities (I am not sure if it does).

r=me but please double-check that detail.
Comment 4 Oliver Hunt 2008-02-03 18:38:12 PST
Landed r29956 -- added an additional nan testcase
Comment 5 Darin Adler 2008-02-03 19:05:57 PST
(In reply to comment #3)
> Looks good, assuming isfinite checks for NaN as well as infinities (I am not
> sure if it does).

Yes, isfinite(x) === !isnan(x) && !isinf(x).
Comment 6 Darin Adler 2008-02-03 19:06:13 PST
(In reply to comment #2)
> (From update of attachment 18893 [details] [edit])
> +    state().m_path.transform(transform.inverse());
> 
> Is the transform guaranteed to be invertible? If not, what happens? Does a test
> case cover this?

Ollie?
Comment 7 Oliver Hunt 2008-02-03 19:44:38 PST
Darin, whoops, didn't see your comment.

It's safe -- it's equivalent to scale(0,0) for example.

That said it should have a testcase which i'll work on after i eat