Changeset 40869 in webkit


Ignore:
Timestamp:
Feb 11, 2009 2:00:55 PM (15 years ago)
Author:
eric@webkit.org
Message:

2009-02-11 Scott Violet <sky@google.com>

Reviewed by Eric Seidel.

https://bugs.webkit.org/show_bug.cgi?id=23882
GraphicsContextSkia draws round rects as solid rects

Fixes two bugs in Skia's GraphicsContext::fillRoundedRect:
. fillRoundedRect had an extra call to fillRect, resulting in always

drawing a solid rectangle.

. if the total radius along a given axis is greater than the size of

the axis to draw, a solid rect should be drawn.

The layout tests LayoutTests/fast/css/shadow-multiple.html and
LayoutTests/fast/box-shadow/basic-shadows.html cover this.

  • platform/graphics/skia/GraphicsContextSkia.cpp: (WebCore::GraphicsContext::fillRoundedRect):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r40868 r40869  
     12009-02-11  Scott Violet  <sky@google.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=23882
     6        GraphicsContextSkia draws round rects as solid rects
     7
     8        Fixes two bugs in Skia's GraphicsContext::fillRoundedRect:
     9        . fillRoundedRect had an extra call to fillRect, resulting in always
     10          drawing a solid rectangle.
     11        . if the total radius along a given axis is greater than the size of
     12          the axis to draw, a solid rect should be drawn.
     13
     14        The layout tests LayoutTests/fast/css/shadow-multiple.html and
     15        LayoutTests/fast/box-shadow/basic-shadows.html cover this.
     16
     17        * platform/graphics/skia/GraphicsContextSkia.cpp:
     18        (WebCore::GraphicsContext::fillRoundedRect):
     19
    1202009-02-11  Julien Chaffraix  <jchaffraix@webkit.org>
    221
  • trunk/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp

    r40809 r40869  
    778778        ClipRectToCanvas(*platformContext()->canvas(), r, &r);
    779779
     780    if (topLeft.width() + topRight.width() > rect.width()
     781            || bottomLeft.width() + bottomRight.width() > rect.width()
     782            || topLeft.height() + bottomLeft.height() > rect.height()
     783            || topRight.height() + bottomRight.height() > rect.height()) {
     784        // Not all the radii fit, return a rect. This matches the behavior of
     785        // Path::createRoundedRectangle. Without this we attempt to draw a round
     786        // shadow for a square box.
     787        fillRect(rect, color);
     788        return;
     789    }
     790
    780791    SkPath path;
    781792    addCornerArc(&path, r, topRight, 270);
     
    787798    platformContext()->setupPaintForFilling(&paint);
    788799    platformContext()->canvas()->drawPath(path, paint);
    789     return fillRect(rect, color);
    790800}
    791801
Note: See TracChangeset for help on using the changeset viewer.