Bug 84191 - GraphicsContextCG's roundToDevicePixels should round even when there's no transform
Summary: GraphicsContextCG's roundToDevicePixels should round even when there's no tra...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Levi Weintraub
URL:
Keywords:
Depends on:
Blocks: 60318
  Show dependency treegraph
 
Reported: 2012-04-17 13:54 PDT by Levi Weintraub
Modified: 2012-04-18 13:05 PDT (History)
7 users (show)

See Also:


Attachments
Patch (2.61 KB, patch)
2012-04-17 14:20 PDT, Levi Weintraub
no flags Details | Formatted Diff | Diff
Patch (3.49 KB, patch)
2012-04-18 11:15 PDT, Levi Weintraub
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Levi Weintraub 2012-04-17 13:54:10 PDT
Currently, if there's no transform on the graphics context, the CG implementation of GraphicsContext::roundToDevicePixels returns the rect passed in instead of rounding. This breaks text underlines when sub-pixel layout is enabled.
Comment 1 Levi Weintraub 2012-04-17 14:20:30 PDT
Created attachment 137601 [details]
Patch
Comment 2 Eric Seidel (no email) 2012-04-17 17:04:33 PDT
Comment on attachment 137601 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=137601&action=review

Wouldn't rect.round() do the same thing?  Or do we call it roundedIntRect(rect)?  In either case, I would be surprised if the float -> int -> float conversion would matter, and would save adding a couple lines of code.

> Source/WebCore/ChangeLog:11
> +        end up being more than on3e pixel wide. This adds a static inline rounding method and uses it for

on3e
Comment 3 Levi Weintraub 2012-04-18 11:15:28 PDT
Created attachment 137728 [details]
Patch
Comment 4 Eric Seidel (no email) 2012-04-18 11:54:33 PDT
Comment on attachment 137728 [details]
Patch

LGTM.
Comment 5 Levi Weintraub 2012-04-18 11:55:53 PDT
Comment on attachment 137728 [details]
Patch

Thanks Eric :)
Comment 6 WebKit Review Bot 2012-04-18 13:05:27 PDT
Comment on attachment 137728 [details]
Patch

Clearing flags on attachment: 137728

Committed r114548: <http://trac.webkit.org/changeset/114548>
Comment 7 WebKit Review Bot 2012-04-18 13:05:32 PDT
All reviewed patches have been landed.  Closing bug.