Changeset 100528 in webkit


Ignore:
Timestamp:
Nov 16, 2011 4:57:30 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Seaming on border corners with mixed colour alpha borders
https://bugs.webkit.org/show_bug.cgi?id=70471

Patch by Ben Wells <benwells@chromium.org> on 2011-11-16
Reviewed by Simon Fraser.

Source/WebCore:

Seaming is fixed by antialiasing mitred corners for edges that have alpha and are joining
a side that is of a different color.

Test: fast/borders/border-mixed-alpha.html

  • rendering/RenderBoxModelObject.cpp:

(WebCore::colorNeedsAntiAliasAtCorner):
(WebCore::RenderBoxModelObject::paintOneBorderSide):

LayoutTests:

  • fast/borders/border-mixed-alpha.html: Added.
  • platform/chromium/test_expectations.txt:
  • platform/mac/fast/borders/border-mixed-alpha-expected.png: Added.
  • platform/mac/fast/borders/border-mixed-alpha-expected.txt: Added.
Location:
trunk
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r100520 r100528  
     12011-11-16  Ben Wells  <benwells@chromium.org>
     2
     3        Seaming on border corners with mixed colour alpha borders
     4        https://bugs.webkit.org/show_bug.cgi?id=70471
     5
     6        Reviewed by Simon Fraser.
     7
     8        * fast/borders/border-mixed-alpha.html: Added.
     9        * platform/chromium/test_expectations.txt:
     10        * platform/mac/fast/borders/border-mixed-alpha-expected.png: Added.
     11        * platform/mac/fast/borders/border-mixed-alpha-expected.txt: Added.
     12
    1132011-11-16  Peter Kasting  <pkasting@google.com>
    214
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r100520 r100528  
    35363536BUGWK68436 SNOWLEOPARD CPU : svg/W3C-SVG-1.1/paths-data-12-t.svg = IMAGE+TEXT
    35373537
     3538// New test that needs rebaselining for chromium ports
     3539BUGWK70471 : fast/borders/border-mixed-alpha.html = IMAGE
     3540// WK70471 introduces slight changes in seams for this test
     3541BUGWK70471 : fast/borders/mixed-border-styles.html = IMAGE
     3542
    35383543// Tests that are known to exhibit TEXT failures on Mac10.5 with Skia (CPU and/or GPU) graphics.
    35393544BUGWK68437 LEOPARD CPU : canvas/philip/tests/2d.text.draw.fontface.notinpage.html = TEXT
  • trunk/Source/WebCore/ChangeLog

    r100517 r100528  
     12011-11-16  Ben Wells  <benwells@chromium.org>
     2
     3        Seaming on border corners with mixed colour alpha borders
     4        https://bugs.webkit.org/show_bug.cgi?id=70471
     5
     6        Reviewed by Simon Fraser.
     7
     8        Seaming is fixed by antialiasing mitred corners for edges that have alpha and are joining
     9        a side that is of a different color.
     10
     11        Test: fast/borders/border-mixed-alpha.html
     12
     13        * rendering/RenderBoxModelObject.cpp:
     14        (WebCore::colorNeedsAntiAliasAtCorner):
     15        (WebCore::RenderBoxModelObject::paintOneBorderSide):
     16
    1172011-11-16  Sam Weinig  <sam@webkit.org>
    218
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r99022 r100528  
    14251425}
    14261426
     1427
     1428static inline bool colorNeedsAntiAliasAtCorner(BoxSide side, BoxSide adjacentSide, const BorderEdge edges[])
     1429{
     1430    if (!edges[side].color.hasAlpha())
     1431        return false;
     1432
     1433    if (edges[side].shouldRender() != edges[adjacentSide].shouldRender())
     1434        return false;
     1435
     1436    if (!edgesShareColor(edges[side], edges[adjacentSide]))
     1437        return true;
     1438
     1439    return borderStyleHasUnmatchedColorsAtCorner(edges[side].style, side, adjacentSide);
     1440}
     1441
    14271442// This assumes that we draw in order: top, bottom, left, right.
    14281443static inline bool willBeOverdrawn(BoxSide side, BoxSide adjacentSide, const BorderEdge edges[])
     
    15071522            colorToPaint, edgeToRender.style, bleedAvoidance, includeLogicalLeftEdge, includeLogicalRightEdge);
    15081523    } else {
    1509         bool shouldClip = styleRequiresClipPolygon(edgeToRender.style) && (mitreAdjacentSide1 || mitreAdjacentSide2);
     1524        bool clipForStyle = styleRequiresClipPolygon(edgeToRender.style) && (mitreAdjacentSide1 || mitreAdjacentSide2);
     1525        bool clipAdjacentSide1 = colorNeedsAntiAliasAtCorner(side, adjacentSide1, edges) && mitreAdjacentSide1;
     1526        bool clipAdjacentSide2 = colorNeedsAntiAliasAtCorner(side, adjacentSide2, edges) && mitreAdjacentSide2;
     1527        bool shouldClip = clipForStyle || clipAdjacentSide1 || clipAdjacentSide2;
    15101528       
    15111529        GraphicsContextStateSaver clipStateSaver(*graphicsContext, shouldClip);
    15121530        if (shouldClip) {
    1513             clipBorderSidePolygon(graphicsContext, outerBorder, innerBorder, side, !mitreAdjacentSide1, !mitreAdjacentSide2);
     1531            bool aliasAdjacentSide1 = clipAdjacentSide1 || (clipForStyle && mitreAdjacentSide1);
     1532            bool aliasAdjacentSide2 = clipAdjacentSide2 || (clipForStyle && mitreAdjacentSide2);
     1533            clipBorderSidePolygon(graphicsContext, outerBorder, innerBorder, side, !aliasAdjacentSide1, !aliasAdjacentSide2);
    15141534            // Since we clipped, no need to draw with a mitre.
    15151535            mitreAdjacentSide1 = false;
Note: See TracChangeset for help on using the changeset viewer.