Changeset 139137 in webkit


Ignore:
Timestamp:
Jan 8, 2013 5:17:19 PM (11 years ago)
Author:
junov@google.com
Message:

Color bleeding with rounded rectangles on high dpi displays
https://bugs.webkit.org/show_bug.cgi?id=106373

Reviewed by Simon Fraser.

Source/WebCore:

Test: fast/backgrounds/gradient-background-leakage-hidpi.html

Avoid using the BackgroundBleedShrinkBackground draw strategy for
RenderBox when border width is less than two layout units. This
is because rounded rectangles are always snapped to integer layout
coordinates, even with subpixel layout enabled.

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::determineBackgroundBleedAvoidance):

LayoutTests:

New layout test to verify that rounded rectangle corners do not
produce color bleeding on high dpi devices.

  • fast/backgrounds/gradient-background-leakage-hidpi-expected.txt: Added.
  • fast/backgrounds/gradient-background-leakage-hidpi.html: Added.
  • platform/chromium-linux/fast/backgrounds/gradient-background-leakage-hidpi-expected.png: Added.
Location:
trunk
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r139136 r139137  
     12013-01-08  Justin Novosad  <junov@google.com>
     2
     3        Color bleeding with rounded rectangles on high dpi displays
     4        https://bugs.webkit.org/show_bug.cgi?id=106373
     5
     6        Reviewed by Simon Fraser.
     7
     8        New layout test to verify that rounded rectangle corners do not
     9        produce color bleeding on high dpi devices.
     10
     11        * fast/backgrounds/gradient-background-leakage-hidpi-expected.txt: Added.
     12        * fast/backgrounds/gradient-background-leakage-hidpi.html: Added.
     13        * platform/chromium-linux/fast/backgrounds/gradient-background-leakage-hidpi-expected.png: Added.
     14
    1152013-01-08  Filip Pizlo  <fpizlo@apple.com>
    216
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r139121 r139137  
    27722772webkit.org/b/91676 fast/js/mozilla/strict/assign-to-callee-name.html [ Failure ]
    27732773
     2774# Test needing new baselines with fix for bug 106373
     2775webkit.org/b/106373 fast/backgrounds/gradient-background-leakage-hidpi.html [ Pass ImageOnlyFailure ]
     2776
    27742777# Failure introduced by Chromium r83848.
    27752778crbug.com/137938 [ Mac Android ] fast/url/ipv6.html [ Failure ]
  • trunk/Source/WebCore/ChangeLog

    r139135 r139137  
     12013-01-08  Justin Novosad  <junov@google.com>
     2
     3        Color bleeding with rounded rectangles on high dpi displays
     4        https://bugs.webkit.org/show_bug.cgi?id=106373
     5
     6        Reviewed by Simon Fraser.
     7
     8        Test: fast/backgrounds/gradient-background-leakage-hidpi.html
     9
     10        Avoid using the BackgroundBleedShrinkBackground draw strategy for
     11        RenderBox when border width is less than two layout units. This
     12        is because rounded rectangles are always snapped to integer layout
     13        coordinates, even with subpixel layout enabled.
     14
     15        * rendering/RenderBox.cpp:
     16        (WebCore::RenderBox::determineBackgroundBleedAvoidance):
     17
    1182013-01-08  Elliott Sprehn  <esprehn@chromium.org>
    219
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r139044 r139137  
    996996    AffineTransform ctm = context->getCTM();
    997997    FloatSize contextScaling(static_cast<float>(ctm.xScale()), static_cast<float>(ctm.yScale()));
     998
     999    // Because RoundedRect uses IntRect internally the inset applied by the
     1000    // BackgroundBleedShrinkBackground strategy cannot be less than one integer
     1001    // layout coordinate, even with subpixel layout enabled. To take that into
     1002    // account, we clamp the contextScaling to 1.0 for the following test so
     1003    // that borderObscuresBackgroundEdge can only return true if the border
     1004    // widths are greater than 2 in both layout coordinates and screen
     1005    // coordinates.
     1006    // This precaution will become obsolete if RoundedRect is ever promoted to
     1007    // a sub-pixel representation.
     1008    if (contextScaling.width() > 1)
     1009        contextScaling.setWidth(1);
     1010    if (contextScaling.height() > 1)
     1011        contextScaling.setHeight(1);
     1012
    9981013    if (borderObscuresBackgroundEdge(contextScaling))
    9991014        return BackgroundBleedShrinkBackground;
Note: See TracChangeset for help on using the changeset viewer.