Changeset 51722 in webkit


Ignore:
Timestamp:
Dec 4, 2009 4:39:27 PM (14 years ago)
Author:
eric@webkit.org
Message:

2009-12-04 Adam Langley <agl@google.com>

Reviewed by Eric Seidel.

Chromium: make rounded borders heavier.

Skia draws its rounded corners differently from the other ports.
Whereas they have anti-aliased clipping regions, Skia only has 1-bit
regions. (Which is technically more correct, but somewhat unhelpful
for us.) Instead, with Skia we use a layer and collect all the
clipping paths in effect. When the state is popped, we paint
transparency outside the clipping paths and merge the layer down.

This appears to cause rounded borders to look a little thin, which is
addressed in this patch.

This is well covered by existing tests but will require new baselines
in the Chromium tree.

https://bugs.webkit.org/show_bug.cgi?id=31778

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

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r51718 r51722  
     12009-12-04  Adam Langley  <agl@google.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Chromium: make rounded borders heavier.
     6
     7        Skia draws its rounded corners differently from the other ports.
     8        Whereas they have anti-aliased clipping regions, Skia only has 1-bit
     9        regions. (Which is technically more correct, but somewhat unhelpful
     10        for us.) Instead, with Skia we use a layer and collect all the
     11        clipping paths in effect. When the state is popped, we paint
     12        transparency outside the clipping paths and merge the layer down.
     13
     14        This appears to cause rounded borders to look a little thin, which is
     15        addressed in this patch.
     16
     17        This is well covered by existing tests but will require new baselines
     18        in the Chromium tree.
     19
     20        https://bugs.webkit.org/show_bug.cgi?id=31778
     21
     22        * platform/graphics/skia/GraphicsContextSkia.cpp:
     23        (WebCore::GraphicsContext::addInnerRoundedRectClip):
     24
    1252009-12-04  Simon Fraser  <simon.fraser@apple.com>
    226
  • trunk/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp

    r50852 r51722  
    294294    // only perform the inset if we won't invert r
    295295    if (2 * thickness < rect.width() && 2 * thickness < rect.height()) {
    296         r.inset(SkIntToScalar(thickness), SkIntToScalar(thickness));
     296        // Adding one to the thickness doesn't make the border too thick as
     297        // it's painted over afterwards. But without this adjustment the
     298        // border appears a little anemic after anti-aliasing.
     299        r.inset(SkIntToScalar(thickness + 1), SkIntToScalar(thickness + 1));
    297300        path.addOval(r, SkPath::kCCW_Direction);
    298301    }
Note: See TracChangeset for help on using the changeset viewer.