Changeset 86314 in webkit


Ignore:
Timestamp:
May 12, 2011 12:04:24 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-05-12 Ben Wells <benwells@chromium.org>

Reviewed by Simon Fraser.

RGBA colors in outlines show overpainting at the corners
https://bugs.webkit.org/show_bug.cgi?id=58999

  • fast/borders/outline-alpha-block.html: Added.
  • fast/borders/outline-alpha-inline.html: Added.
  • platform/chromium/test_expectations.txt:
  • platform/mac/fast/borders/outline-alpha-block-expected.png: Added.
  • platform/mac/fast/borders/outline-alpha-block-expected.txt: Added.
  • platform/mac/fast/borders/outline-alpha-inline-expected.png: Added.
  • platform/mac/fast/borders/outline-alpha-inline-expected.txt: Added.
  • platform/mac/fast/box-shadow/box-shadow-radius-expected.png: Rebaselined as this test had rgba outlines.
  • platform/mac/fast/layers/self-painting-outline-expected.png: Rebaselined as this test had rgba outlines.

2011-05-12 Ben Wells <benwells@chromium.org>

Reviewed by Simon Fraser.

RGBA colors in outlines show overpainting at the corners
https://bugs.webkit.org/show_bug.cgi?id=58999

Tests: fast/borders/outline-alpha-block.html

fast/borders/outline-alpha-inline.html

Updated baseline images for tests with rgba outlines:

fast/box-shadow/box-shadow-radius.html
fast/layers/self-painting-outline.html

  • rendering/RenderInline.cpp:

(WebCore::RenderInline::paintOutline):
(WebCore::RenderInline::paintOutlineForLine):

  • rendering/RenderInline.h:
  • rendering/RenderObject.cpp: (WebCore::RenderObject::paintOutline):
Location:
trunk
Files:
6 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r86313 r86314  
     12011-05-12  Ben Wells  <benwells@chromium.org>
     2
     3        Reviewed by Simon Fraser.
     4
     5        RGBA colors in outlines show overpainting at the corners
     6        https://bugs.webkit.org/show_bug.cgi?id=58999
     7
     8        * fast/borders/outline-alpha-block.html: Added.
     9        * fast/borders/outline-alpha-inline.html: Added.
     10        * platform/chromium/test_expectations.txt:
     11        * platform/mac/fast/borders/outline-alpha-block-expected.png: Added.
     12        * platform/mac/fast/borders/outline-alpha-block-expected.txt: Added.
     13        * platform/mac/fast/borders/outline-alpha-inline-expected.png: Added.
     14        * platform/mac/fast/borders/outline-alpha-inline-expected.txt: Added.
     15        * platform/mac/fast/box-shadow/box-shadow-radius-expected.png: Rebaselined as this test had rgba outlines.
     16        * platform/mac/fast/layers/self-painting-outline-expected.png: Rebaselined as this test had rgba outlines.
     17
    1182011-05-11  Srinivasulu Chereddy  <Srinivasulu.Chereddy@nokia.com>
    219
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r86280 r86314  
    40284028BUGCR82281 : fast/xpath/xpath-other-nodeset-result-should-mark-its-nodeset.html = TEXT
    40294029BUGCR82281 : fast/xpath/xpath-snapshot-result-should-mark-its-nodeset.html = TEXT
     4030
     4031// New pixel tests added for bug 58999, rebaseline when webkit 58999 rolls.
     4032BUGWK58999 WIN LINUX : fast/borders/outline-alpha-block.html = IMAGE+TEXT
     4033BUGWK58999 WIN LINUX : fast/borders/outline-alpha-inline.html = IMAGE+TEXT
  • trunk/Source/WebCore/ChangeLog

    r86312 r86314  
     12011-05-12  Ben Wells  <benwells@chromium.org>
     2
     3        Reviewed by Simon Fraser.
     4
     5        RGBA colors in outlines show overpainting at the corners
     6        https://bugs.webkit.org/show_bug.cgi?id=58999
     7
     8        Tests: fast/borders/outline-alpha-block.html
     9               fast/borders/outline-alpha-inline.html
     10
     11        Updated baseline images for tests with rgba outlines:
     12               fast/box-shadow/box-shadow-radius.html
     13               fast/layers/self-painting-outline.html
     14
     15         * rendering/RenderInline.cpp:
     16        (WebCore::RenderInline::paintOutline):
     17        (WebCore::RenderInline::paintOutlineForLine):
     18        * rendering/RenderInline.h:
     19        * rendering/RenderObject.cpp:
     20        (WebCore::RenderObject::paintOutline):
     21
    1222011-05-11  Levi Weintraub  <leviw@chromium.org>
    223
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r86060 r86314  
    13981398    rects.append(IntRect());
    13991399
     1400    Color outlineColor = styleToUse->visitedDependentColor(CSSPropertyOutlineColor);
     1401#if !USE(SKIA)
     1402    bool useTransparencyLayer = outlineColor.hasAlpha();
     1403    if (useTransparencyLayer) {
     1404        graphicsContext->beginTransparencyLayer(static_cast<float>(outlineColor.alpha()) / 255);
     1405        outlineColor = Color(outlineColor.red(), outlineColor.green(), outlineColor.blue());
     1406    }
     1407#endif
     1408
    14001409    for (unsigned i = 1; i < rects.size() - 1; i++)
    1401         paintOutlineForLine(graphicsContext, tx, ty, rects.at(i - 1), rects.at(i), rects.at(i + 1));
     1410        paintOutlineForLine(graphicsContext, tx, ty, rects.at(i - 1), rects.at(i), rects.at(i + 1), outlineColor);
     1411
     1412#if !USE(SKIA)
     1413    if (useTransparencyLayer)
     1414        graphicsContext->endTransparencyLayer();
     1415#endif
    14021416}
    14031417
    14041418void RenderInline::paintOutlineForLine(GraphicsContext* graphicsContext, int tx, int ty,
    1405                                        const IntRect& lastline, const IntRect& thisline, const IntRect& nextline)
     1419                                       const IntRect& lastline, const IntRect& thisline, const IntRect& nextline,
     1420                                       const Color outlineColor)
    14061421{
    14071422    RenderStyle* styleToUse = style();
    14081423    int ow = styleToUse->outlineWidth();
    14091424    EBorderStyle os = styleToUse->outlineStyle();
    1410     Color oc = styleToUse->visitedDependentColor(CSSPropertyOutlineColor);
    14111425
    14121426    int offset = style()->outlineOffset();
     
    14241438               b + (nextline.isEmpty() || thisline.x() <= nextline.x() || (nextline.maxX() - 1) <= thisline.x() ? ow : 0),
    14251439               BSLeft,
    1426                oc, os,
     1440               outlineColor, os,
    14271441               (lastline.isEmpty() || thisline.x() < lastline.x() || (lastline.maxX() - 1) <= thisline.x() ? ow : -ow),
    14281442               (nextline.isEmpty() || thisline.x() <= nextline.x() || (nextline.maxX() - 1) <= thisline.x() ? ow : -ow));
     
    14351449               b + (nextline.isEmpty() || nextline.maxX() <= thisline.maxX() || (thisline.maxX() - 1) <= nextline.x() ? ow : 0),
    14361450               BSRight,
    1437                oc, os,
     1451               outlineColor, os,
    14381452               (lastline.isEmpty() || lastline.maxX() < thisline.maxX() || (thisline.maxX() - 1) <= lastline.x() ? ow : -ow),
    14391453               (nextline.isEmpty() || nextline.maxX() <= thisline.maxX() || (thisline.maxX() - 1) <= nextline.x() ? ow : -ow));
     
    14451459                   min(r+ow, (lastline.isEmpty() ? 1000000 : tx + lastline.x())),
    14461460                   t ,
    1447                    BSTop, oc, os,
     1461                   BSTop, outlineColor, os,
    14481462                   ow,
    14491463                   (!lastline.isEmpty() && tx + lastline.x() + 1 < r + ow) ? -ow : ow);
     
    14551469                   r + ow,
    14561470                   t ,
    1457                    BSTop, oc, os,
     1471                   BSTop, outlineColor, os,
    14581472                   (!lastline.isEmpty() && l - ow < tx + lastline.maxX()) ? -ow : ow,
    14591473                   ow);
     
    14661480                   min(r + ow, !nextline.isEmpty() ? tx + nextline.x() + 1 : 1000000),
    14671481                   b + ow,
    1468                    BSBottom, oc, os,
     1482                   BSBottom, outlineColor, os,
    14691483                   ow,
    14701484                   (!nextline.isEmpty() && tx + nextline.x() + 1 < r + ow) ? -ow : ow);
     
    14761490                   r + ow,
    14771491                   b + ow,
    1478                    BSBottom, oc, os,
     1492                   BSBottom, outlineColor, os,
    14791493                   (!nextline.isEmpty() && l - ow < tx + nextline.maxX()) ? -ow : ow,
    14801494                   ow);
  • trunk/Source/WebCore/rendering/RenderInline.h

    r83075 r86314  
    163163    static RenderInline* cloneInline(RenderInline* src);
    164164
    165     void paintOutlineForLine(GraphicsContext*, int tx, int ty, const IntRect& prevLine, const IntRect& thisLine, const IntRect& nextLine);
     165    void paintOutlineForLine(GraphicsContext*, int tx, int ty, const IntRect& prevLine, const IntRect& thisLine,
     166                             const IntRect& nextLine, const Color);
    166167    RenderBoxModelObject* continuationBefore(RenderObject* beforeChild);
    167168
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r86128 r86314  
    10521052        return;
    10531053
     1054#if !USE(SKIA)
     1055    bool useTransparencyLayer = outlineColor.hasAlpha();
     1056    if (useTransparencyLayer) {
     1057        graphicsContext->beginTransparencyLayer(static_cast<float>(outlineColor.alpha()) / 255);
     1058        outlineColor = Color(outlineColor.red(), outlineColor.green(), outlineColor.blue());
     1059    }
     1060#endif
     1061
    10541062    int leftOuter = tx - outlineWidth;
    10551063    int leftInner = tx;
     
    10651073    drawLineForBoxSide(graphicsContext, rightInner, topOuter, rightOuter, bottomOuter, BSRight, outlineColor, outlineStyle, outlineWidth, outlineWidth);
    10661074    drawLineForBoxSide(graphicsContext, leftOuter, bottomInner, rightOuter, bottomOuter, BSBottom, outlineColor, outlineStyle, outlineWidth, outlineWidth);
     1075
     1076#if !USE(SKIA)
     1077    if (useTransparencyLayer)
     1078        graphicsContext->endTransparencyLayer();
     1079#endif
    10671080}
    10681081
Note: See TracChangeset for help on using the changeset viewer.