Changeset 140098 in webkit


Ignore:
Timestamp:
Jan 17, 2013 8:01:33 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Update GraphicsContext to support winding rule in clip operator for Chromium
https://bugs.webkit.org/show_bug.cgi?id=106872

Patch by Rik Cabanier <cabanier@adobe.com> on 2013-01-17
Reviewed by Dirk Schulze.

Added support for winding to clip() and canvasClip() functions.

No new tests, no change in behavior.

  • platform/graphics/skia/GraphicsContextSkia.cpp:

(WebCore::GraphicsContext::clip): Call clipPath() instead with winding rule.
(WebCore::GraphicsContext::canvasClip): Honor the winding rule.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r140097 r140098  
     12013-01-17  Rik Cabanier  <cabanier@adobe.com>
     2
     3        Update GraphicsContext to support winding rule in clip operator for Chromium
     4        https://bugs.webkit.org/show_bug.cgi?id=106872
     5
     6        Reviewed by Dirk Schulze.
     7
     8        Added support for winding to clip() and canvasClip() functions.
     9
     10        No new tests, no change in behavior.
     11
     12        * platform/graphics/skia/GraphicsContextSkia.cpp:
     13        (WebCore::GraphicsContext::clip): Call clipPath() instead with winding rule.
     14        (WebCore::GraphicsContext::canvasClip): Honor the winding rule.
     15
    1162013-01-17  Shinya Kawanaka  <shinyak@chromium.org>
    217
  • trunk/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp

    r139967 r140098  
    315315}
    316316
    317 // FIXME: don't ignore the winding rule. https://bugs.webkit.org/show_bug.cgi?id=106872
    318 void GraphicsContext::clip(const Path& path, WindRule)
     317void GraphicsContext::clip(const Path& path, WindRule clipRule)
    319318{
    320319    if (paintingDisabled() || path.isEmpty())
    321320        return;
    322321
    323     platformContext()->clipPath(*path.platformPath(), PlatformContextSkia::AntiAliased);
     322    clipPath(path, clipRule);
    324323}
    325324
     
    339338}
    340339
    341 // FIXME: don't ignore the winding rule. https://bugs.webkit.org/show_bug.cgi?id=106872
    342 void GraphicsContext::canvasClip(const Path& path, WindRule)
    343 {
    344     if (paintingDisabled())
    345         return;
    346 
    347     platformContext()->clipPath(path.isNull() ? SkPath() : *path.platformPath());
     340void GraphicsContext::canvasClip(const Path& pathToClip, WindRule clipRule)
     341{
     342    if (paintingDisabled())
     343        return;
     344
     345    const SkPath* path = pathToClip.platformPath();
     346    SkPath::FillType ftype = (clipRule == RULE_EVENODD) ? SkPath::kEvenOdd_FillType : SkPath::kWinding_FillType;
     347    SkPath storage;
     348
     349    if (path && (path->getFillType() != ftype)) {
     350        storage = *path;
     351        storage.setFillType(ftype);
     352        path = &storage;
     353    }
     354
     355    platformContext()->clipPath(path ? *path : SkPath());
    348356}
    349357
Note: See TracChangeset for help on using the changeset viewer.