RESOLVED FIXED Bug 24534
Fix a bug in pattern transformation in PatternSkia
https://bugs.webkit.org/show_bug.cgi?id=24534
Summary Fix a bug in pattern transformation in PatternSkia
Hin-Chung Lam
Reported 2009-03-11 18:58:52 PDT
PatternSkia should respect the local transformation in createPlatformPattern and apply the local transformation to shader. This patch fixes the following layout tests in chromium: LayoutTests/svg/batik/paints/patternRegionA.svg LayoutTests/svg/W3C-SVG-1.1/pservers-grad-06-b.svg LayoutTests/svg/W3C-SVG-1.1/pservers-pattern-01-b.svg LayoutTests/svg/W3C-SVG-1.1/coords-units-01-b.svg Note that Skia is bad about having positive translation in tile mode. The code takes special care of that. See the code for more details. Review in chromium is here: http://codereview.chromium.org/42100/show
Attachments
Patch to patternSkia.cpp (5.10 KB, patch)
2009-03-11 18:59 PDT, Hin-Chung Lam
no flags
patch + change log (6.04 KB, patch)
2009-03-11 19:16 PDT, Hin-Chung Lam
eric: review-
New fix (9.72 KB, patch)
2010-01-28 12:52 PST, Stephen White
no flags
ChangeLog and non-Skia fixes (9.70 KB, patch)
2010-01-28 13:17 PST, Stephen White
no flags
Same as above, plus QT fix (9.72 KB, patch)
2010-01-28 14:58 PST, Stephen White
no flags
Hin-Chung Lam
Comment 1 2009-03-11 18:59:41 PDT
Created attachment 28509 [details] Patch to patternSkia.cpp
Hin-Chung Lam
Comment 2 2009-03-11 19:16:42 PDT
Created attachment 28511 [details] patch + change log
Dimitri Glazkov (Google)
Comment 3 2009-03-18 11:14:30 PDT
Brett, can you look at this change?
Brett Wilson (Google)
Comment 4 2009-03-18 11:20:19 PDT
I would like to let the Skia folks know about this before we work around something. If it is a bug, it should be fixed there, or we should know a fix is pending before checking in. I'll forward it.
Hin-Chung Lam
Comment 5 2009-03-24 13:08:13 PDT
(In reply to comment #4) > I would like to let the Skia folks know about this before we work around > something. If it is a bug, it should be fixed there, or we should know a fix is > pending before checking in. I'll forward it. > Any updates from skia people?
Dirk Schulze
Comment 6 2009-03-24 13:51:50 PDT
There is maybe another way to support transformations for patterns. On CG and Qt we transform the context right before we stroke/fill anything with a pattern, the path should not be affected. Just look at fillPath/strokePath in GraphicsContextCg.cpp or GraphicsContextQt.cpp to know what I mean. Could that avoid this hack at the end of the pattern-patch? To round and cut off some values seems to be incorrect for me.
Eric Seidel (no email)
Comment 7 2009-05-19 20:37:44 PDT
Comment on attachment 28511 [details] patch + change log r- based on Dirk's comments. Mostly I can't quite tell if this is right, Dirk is questioning the correctness, and we're trying to clear out the review queue one. Feel free to mark this r=? with answers to Dirk's questions.
Dirk Schulze
Comment 8 2009-11-14 00:31:10 PST
No progress on this bug? :-(
Stephen White
Comment 9 2010-01-28 12:52:45 PST
Created attachment 47643 [details] New fix The good news is, the Skia bug should be fixed, so the hack part of Alpha's fix (above) should no longer be necessary. The bad news is, I changed the allocation of SkShaders a few months back to be done once on first draw, so it was necessary to rework Patterns a bit so that the m_patternSpaceTransform could be forwarded to the SkShader.
Stephen White
Comment 10 2010-01-28 13:17:16 PST
Created attachment 47644 [details] ChangeLog and non-Skia fixes
WebKit Review Bot
Comment 11 2010-01-28 13:56:08 PST
Stephen White
Comment 12 2010-01-28 14:58:26 PST
Created attachment 47652 [details] Same as above, plus QT fix
Eric Seidel (no email)
Comment 13 2010-02-01 15:14:05 PST
Comment on attachment 47652 [details] Same as above, plus QT fix I would have probably put the "else" into its own function, but OK.
WebKit Commit Bot
Comment 14 2010-02-01 21:36:48 PST
Comment on attachment 47652 [details] Same as above, plus QT fix Clearing flags on attachment: 47652 Committed r54203: <http://trac.webkit.org/changeset/54203>
WebKit Commit Bot
Comment 15 2010-02-01 21:36:58 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.