Summary: | Canvas: rotation of 'no-repeat' pattern still has small error | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Shinichiro Hamaji <hamaji> | ||||||||||||||||
Component: | WebCore Misc. | Assignee: | Adam Barth <abarth> | ||||||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||||||
Severity: | Normal | CC: | abarth, hamaji, oliver | ||||||||||||||||
Priority: | P2 | ||||||||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||||||||
Hardware: | PC | ||||||||||||||||||
OS: | OS X 10.5 | ||||||||||||||||||
Attachments: |
|
Description
Shinichiro Hamaji
2009-06-25 21:54:37 PDT
Created attachment 31904 [details]
Patch v1
LayoutTests/ChangeLog | 15 +++++++++++++++
.../image-object-in-canvas-expected.checksum | 2 +-
.../canvas/image-object-in-canvas-expected.png | Bin 56436 -> 78707 bytes
WebCore/ChangeLog | 15 +++++++++++++++
WebCore/platform/graphics/cg/PatternCG.cpp | 7 +++----
5 files changed, 34 insertions(+), 5 deletions(-)
Adding Oliver into CC list as he reviewed my previous patch. Comment on attachment 31904 [details]
Patch v1
I'm not sure what you're trying to fix here. If this patch is correct you should just be doing 1<<22, but like i said i'm not sure what you're actually trying to do.
Created attachment 32853 [details]
an HTML to describe this bug
Created attachment 32854 [details]
Before the patch
Created attachment 32855 [details]
After the patch
Sorry for the poor description/title of this bug. I've attached an HTML which can describe why I want to use smaller value than before. 1<<23 is the precision of mantissa of floats and using this means that the error is <1px. I think 1px error can be still visible. The HTML I've attached is putting 3x3 image whose shape is '+' vertically. As it doesn't change the value of X-axis, you should see a vertical straight line like "After the patch". However, with current WebKit, the line is not straight like "Before the patch". If we use 1<<22 as this value, the error should be <0.5px. As WebKit is doing anti-alias for rotation, the image changes if we use 1<<21 or something smaller value. However, I think no one would be care about such tiny changes. So, I think 1<<22 would be OK. I'll update the patch with more description and test case. Created attachment 32859 [details]
Patch v2
Comment on attachment 32859 [details]
Patch v2
ChangeLog needs to be updated to say 1<<22 not (1<<23)/2 but this is otherwise okay -- can the person who lands fix up the changelog?
(In reply to comment #9) > (From update of attachment 32859 [details]) > ChangeLog needs to be updated to say 1<<22 not (1<<23)/2 but this is otherwise > okay -- can the person who lands fix up the changelog? Ok. I'll do the fixup. Sorry, bugzilla-tool isn't awesome enough to handle this PNG. Created attachment 33446 [details]
platform/mac/fast/canvas/image-object-in-canvas-expected.png
Created attachment 33447 [details]
platform/mac/fast/canvas/image-pattern-rotate-expected.png
Thanks Oliver for your review, and thanks Adam for trying to fix the ChangeLog and land this patch. I've uploaded png images in this patch. Please use them if you need. Trying again. Wow, that was complicated. Bugzilla-tool validating patch. Hopefully will be landed shortly. Committing to http://svn.webkit.org/repository/webkit/trunk ... M LayoutTests/ChangeLog A LayoutTests/fast/canvas/image-pattern-rotate.html M LayoutTests/platform/mac/fast/canvas/image-object-in-canvas-expected.checksum M LayoutTests/platform/mac/fast/canvas/image-object-in-canvas-expected.png A LayoutTests/platform/mac/fast/canvas/image-pattern-rotate-expected.checksum A LayoutTests/platform/mac/fast/canvas/image-pattern-rotate-expected.png A LayoutTests/platform/mac/fast/canvas/image-pattern-rotate-expected.txt M WebCore/ChangeLog M WebCore/platform/graphics/cg/PatternCG.cpp Committed r46399 M WebCore/ChangeLog M WebCore/platform/graphics/cg/PatternCG.cpp A LayoutTests/platform/mac/fast/canvas/image-pattern-rotate-expected.txt M LayoutTests/platform/mac/fast/canvas/image-object-in-canvas-expected.png A LayoutTests/platform/mac/fast/canvas/image-pattern-rotate-expected.checksum A LayoutTests/platform/mac/fast/canvas/image-pattern-rotate-expected.png M LayoutTests/platform/mac/fast/canvas/image-object-in-canvas-expected.checksum M LayoutTests/ChangeLog A LayoutTests/fast/canvas/image-pattern-rotate.html r46399 = 8574a2ebe1893f5ee6b2b1fb26e1b18debbdf507 (trunk) No changes between current HEAD and refs/remotes/trunk Resetting to the latest refs/remotes/trunk http://trac.webkit.org/changeset/46399 Forgot to fixup the changelog before landing, but I did in the next commit: Committing to http://svn.webkit.org/repository/webkit/trunk ... M LayoutTests/ChangeLog M WebCore/ChangeLog Committed r46400 |