Changeset 237163 in webkit


Ignore:
Timestamp:
Oct 15, 2018 5:53:13 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

[CG] Adopt CG SPI for non-even cornered rounded rects
https://bugs.webkit.org/show_bug.cgi?id=190155

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2018-10-15
Reviewed by Simon Fraser.

Source/WebCore:

Instead of creating bezier curves for the non-even corners of the rounded
rects, we should use the optimized SPI provided by CG.

  • platform/graphics/cg/PathCG.cpp:

(WebCore::Path::platformAddPathForRoundedRect):

Source/WebCore/PAL:

  • pal/spi/cg/CoreGraphicsSPI.h:
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r237162 r237163  
     12018-10-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        [CG] Adopt CG SPI for non-even cornered rounded rects
     4        https://bugs.webkit.org/show_bug.cgi?id=190155
     5
     6        Reviewed by Simon Fraser.
     7
     8        Instead of creating bezier curves for the non-even corners of the rounded
     9        rects, we should use the optimized SPI provided by CG.
     10
     11        * platform/graphics/cg/PathCG.cpp:
     12        (WebCore::Path::platformAddPathForRoundedRect):
     13
    1142018-10-15  Don Olmstead  <don.olmstead@sony.com>
    215
  • trunk/Source/WebCore/PAL/ChangeLog

    r237156 r237163  
     12018-10-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        [CG] Adopt CG SPI for non-even cornered rounded rects
     4        https://bugs.webkit.org/show_bug.cgi?id=190155
     5
     6        Reviewed by Simon Fraser.
     7
     8        * pal/spi/cg/CoreGraphicsSPI.h:
     9
    1102018-10-15  Timothy Hatcher  <timothy@apple.com>
    211
  • trunk/Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h

    r235772 r237163  
    282282
    283283void CGContextDrawConicGradient(CGContextRef, CGGradientRef, CGPoint center, CGFloat angle);
     284
     285#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000)
     286void CGPathAddUnevenCornersRoundedRect(CGMutablePathRef, const CGAffineTransform *, CGRect, const CGSize corners[4]);
     287#endif
    284288#endif
    285289
  • trunk/Source/WebCore/platform/graphics/cg/PathCG.cpp

    r232246 r237163  
    319319        return;
    320320    }
     321
     322#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000)
     323    CGRect rectToDraw = rect;
     324    CGSize corners[4] = { topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius };
     325    CGPathAddUnevenCornersRoundedRect(ensurePlatformPath(), nullptr, rectToDraw, corners);
     326    return;
     327#endif
    321328#endif
    322329
Note: See TracChangeset for help on using the changeset viewer.