Bug 137442

Summary: There are wrong condition checking on GraphicsContext::roundToDevicePixels
Product: WebKit Reporter: byeongha.cho
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ahmad.saleem792, commit-queue, d-r, gyuyoung.kim, mrobinson, zan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch cgarcia: review+

byeongha.cho
Reported 2014-10-06 00:34:24 PDT
There are wrong condition checking on GraphicsContext::roundToDevicePixels() of GraphicsContextCairo.cpp. I think this is copy and paste mistake. // We must ensure width and height are at least 1 (or -1) when // we're given float values in the range between 0 and 1 (or -1 and 0). double width = frect.width(); double height = frect.height(); cairo_user_to_device_distance(cr, &width, &height); if (width > -1 && width < 0) width = -1; else if (width > 0 && width < 1) width = 1; else width = round(width); if (height > -1 && width < 0) //'width' should be replaced with 'height'. height = -1; else if (height > 0 && height < 1) height = 1; else height = round(height);
Attachments
Patch (1.46 KB, patch)
2014-10-06 00:38 PDT, byeongha.cho
no flags
Patch (2.85 KB, patch)
2014-10-14 23:07 PDT, byeongha.cho
no flags
Patch (1.53 KB, patch)
2014-10-14 23:38 PDT, byeongha.cho
cgarcia: review+
byeongha.cho
Comment 1 2014-10-06 00:38:01 PDT
Darin Adler
Comment 2 2014-10-07 21:42:40 PDT
Comment on attachment 239315 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=239315&action=review > Source/WebCore/ChangeLog:8 > + No new tests is needed. There's no functional change. Why is there no functional change? The condition is wrong; it must lead to some kind of bug.
byeongha.cho
Comment 3 2014-10-14 23:05:08 PDT
(In reply to comment #2) > (From update of attachment 239315 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=239315&action=review > > Source/WebCore/ChangeLog:8 > > + No new tests is needed. There's no functional change. > Why is there no functional change? The condition is wrong; it must lead to some kind of bug. Yes, you are right. I'm going to upload the patch with detailed description again. Actually, this is regression of '[cairo][canvas] Drawing from/into float rectangles with width or height in range 0 to 1 fails' issue. I think Zan Dobersek <zandobersek@gmail.com> has made some mistake. So I fixed it.
byeongha.cho
Comment 4 2014-10-14 23:07:14 PDT
Gyuyoung Kim
Comment 5 2014-10-14 23:09:09 PDT
Comment on attachment 239851 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=239851&action=review > Source/WebCore/ChangeLog:10 > + commit 957e1a234d3bc5b333615b0c5b6c8da56be4600a I think this full commit log lets us confuse to track history. I think you just mention what revision used wrong condition in ChangeLog.
byeongha.cho
Comment 6 2014-10-14 23:22:58 PDT
byeongha.cho
Comment 7 2014-10-14 23:38:55 PDT
Darin Adler
Comment 8 2014-10-15 09:40:17 PDT
Comment on attachment 239852 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=239852&action=review > Source/WebCore/ChangeLog:9 > + Fixing copy and paste mistake of r79129. > + There are condition checking for width in place of height. Why no test case? Generally we require test cases so we don’t introduce the same mistake again.
Ahmad Saleem
Comment 9 2022-06-01 15:32:46 PDT
I tried to look into GraphicsContextCairo.cpp from Webkit Github mirror but I think code is more simplified and this might not be be applicable anymore. Link - https://github.com/WebKit/WebKit/blob/ecc984f22b6d9d87c82985a6fb0c8b8b4a5c7975/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp Can we close this, if it is not applicable anymore? Thanks!
Alexey Proskuryakov
Comment 10 2022-06-01 18:41:30 PDT
This was fixed in bug 169031 (without a test case!!!), and later simplified to simply call into Cairo indeed. *** This bug has been marked as a duplicate of bug 169031 ***
Note You need to log in before you can comment on or make changes to this bug.