RESOLVED FIXED3615
canvas transform matrix does not apply to patterns
https://bugs.webkit.org/show_bug.cgi?id=3615
Summary canvas transform matrix does not apply to patterns
Randy Reddig
Reported 2005-06-19 22:18:25 PDT
CanvasPattern usage is more interesting when it can be transformed by the canvas' current transform matrix. Scaling/rotation of bitmaps make interesting effects. The WHATWG spec on the subject is ambiguous on the subject: http://www.whatwg.org/specs/web-apps/current-work/#canvaspattern0 In addition, it specifies the origin of the pattern to be centered on the center of the canvas, which makes the output pixels of a rendering operation dependent on the size of the viewport, not orthagonal as all other raster ops.
Attachments
Create patterns lazily (11.87 KB, patch)
2005-07-12 12:19 PDT, Anders Carlsson
hyatt: review+
Ian 'Hixie' Hickson
Comment 1 2005-06-20 02:53:24 PDT
What's ambiguous?
Randy Reddig
Comment 2 2005-06-20 07:56:34 PDT
Whether patterns (or gradients) are subject to transformation. The document does not specify.
Ian 'Hixie' Hickson
Comment 3 2005-06-20 17:53:26 PDT
"The transformation matrix is applied to all drawing operations prior to their being rendered."
Randy Reddig
Comment 4 2005-06-20 19:24:35 PDT
Okay, so you agree that Safari's behavior is incorrect then?
Ian 'Hixie' Hickson
Comment 5 2005-06-21 03:35:25 PDT
I've no idea what Safari does, but if it ignores the transformation matrix when painting patterns, then I'd say yes.
Joost de Valk (AlthA)
Comment 6 2005-06-21 23:08:03 PDT
Then i'll say yes too :)
John Sullivan
Comment 7 2005-06-24 16:19:43 PDT
This is also in Radar as <rdar://problem/4161599>
Anders Carlsson
Comment 8 2005-07-12 12:19:59 PDT
Created attachment 2930 [details] Create patterns lazily Here's a patch that changes the behavior so that fill and stroke patterns are created in the respective fill and stroke functions using the current CTM.
Eric Seidel (no email)
Comment 9 2005-07-12 12:56:58 PDT
It might be interesting to compare this with how I did the (incomplete) pattern code for KCanvas. The same fixes might be applicable there. The file in question is WebCore/kcanvas/device/quartz/KRenderingPaintServerQuartz.mm
Dave Hyatt
Comment 10 2005-07-12 13:50:42 PDT
Comment on attachment 2930 [details] Create patterns lazily r=me
Justin Garcia
Comment 11 2005-07-24 16:01:10 PDT
Landed this patch
Note You need to log in before you can comment on or make changes to this bug.