WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
60331
Remove canvas usage of roundToDevicePixels
https://bugs.webkit.org/show_bug.cgi?id=60331
Summary
Remove canvas usage of roundToDevicePixels
Matthew Delaney
Reported
2011-05-05 19:26:23 PDT
roundToDevicePixels() was added in
http://trac.webkit.org/changeset/14739
to canvas in order to remedy pixel cracks when at non-integral scales. This code path causes us to create clips for drawImage which causes the drawImage path to be much slower in CG. Chromium appears to ignore the method altogether by early returning from it. I don't believe it's necessary to worry about rounding to device pixels when drawing in the canvas' backing stores.
Attachments
Patch
(3.17 KB, patch)
2011-05-05 19:39 PDT
,
Matthew Delaney
no flags
Details
Formatted Diff
Diff
Patch
(4.64 KB, patch)
2011-05-09 11:22 PDT
,
Matthew Delaney
no flags
Details
Formatted Diff
Diff
Patch
(3.17 KB, patch)
2011-05-09 12:42 PDT
,
Matthew Delaney
simon.fraser
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Matthew Delaney
Comment 1
2011-05-05 19:39:03 PDT
Created
attachment 92531
[details]
Patch
Simon Fraser (smfr)
Comment 2
2011-05-05 22:34:28 PDT
Comment on
attachment 92531
[details]
Patch Were all these calls to roundToDevicePixels() added at the same time? Have you looked at the history to check why each was added?
Matthew Delaney
Comment 3
2011-05-09 11:22:35 PDT
Created
attachment 92810
[details]
Patch
Simon Fraser (smfr)
Comment 4
2011-05-09 12:27:23 PDT
Comment on
attachment 92810
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=92810&action=review
> Source/WebCore/platform/graphics/cg/ImageCG.cpp:271 > - CGContextDrawImage(context, GraphicsContext(context).roundToDevicePixels(FloatRect(0, 0, CGImageGetWidth(image), CGImageGetHeight(image))), image); > + CGContextDrawImage(context, FloatRect(0, 0, CGImageGetWidth(image), CGImageGetHeight(image)), image);
The change log says "This could only affect canvases at non-integral scale factors" but that doesn't seem to be true for this change.
> Source/WebCore/platform/graphics/cg/PatternCG.cpp:43 > + CGRect rect = FloatRect(0, 0, CGImageGetWidth(platformImage), CGImageGetHeight(platformImage));
Ditto.
Matthew Delaney
Comment 5
2011-05-09 12:42:46 PDT
Created
attachment 92829
[details]
Patch
Matthew Delaney
Comment 6
2011-05-09 13:23:13 PDT
Committed
r86085
: <
http://trac.webkit.org/changeset/86085
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug