Bug 59213

Summary: rounded corners don't looks smooth when background-image is a gradient
Product: WebKit Reporter: Vicki Murley <vicki>
Component: Layout and RenderingAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: mitz, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Macintosh   
OS: OS X 10.6   
Attachments:
Description Flags
test cases for buttons with gradients as background images
none
Reduction
none
Patch mitz: review+

Description Vicki Murley 2011-04-22 11:20:50 PDT
Created attachment 90729 [details]
test cases for buttons with gradients as background images

Follow up to https://bugs.webkit.org/show_bug.cgi?id=21819

When an element has rounded corners and the uses a gradient as the background image, the rounded edges don't look smooth.  Some color, from the gradient or the background color, is bleeding through the edges.

Attached two examples.  The first is the same example attached to https://bugs.webkit.org/show_bug.cgi?id=21819, plus a gradient.  The second is a slightly more complicated mock-up of iPhone-style buttons.
Comment 1 Simon Fraser (smfr) 2011-04-22 11:23:17 PDT
Created attachment 90730 [details]
Reduction
Comment 2 Simon Fraser (smfr) 2011-04-22 11:59:04 PDT
Created attachment 90736 [details]
Patch
Comment 3 mitz 2011-04-22 12:06:43 PDT
Comment on attachment 90736 [details]
Patch

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

> Source/WebCore/rendering/RenderBoxModelObject.cpp:584
> +    adjustedRect.inflateX(-ceilf(1.0f / contextScale.width()));
> +    adjustedRect.inflateY(-ceilf(1.0f / contextScale.height()));

Drop the .0f
Comment 4 Simon Fraser (smfr) 2011-04-22 12:54:47 PDT
http://trac.webkit.org/changeset/84664