Changeset 237691 in webkit


Ignore:
Timestamp:
Nov 1, 2018 11:49:13 AM (5 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-11-01
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:

LayoutTests:

This test fails on iOS simulator because of just one pixel difference
between drawing a shadow of the element and drawing a copy of the element.
This failure happens on iOS and does not happen on macOS because we don't
use accelerated drawing for macOS testing but we use it for iOS testing.

  • platform/ios/TestExpectations:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r237683 r237691  
     12018-11-01  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        This test fails on iOS simulator because of just one pixel difference
     9        between drawing a shadow of the element and drawing a copy of the element.
     10        This failure happens on iOS and does not happen on macOS because we don't
     11        use accelerated drawing for macOS testing but we use it for iOS testing.
     12
     13        * platform/ios/TestExpectations:
     14
    1152018-11-01  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/LayoutTests/platform/ios/TestExpectations

    r237679 r237691  
    19371937fast/box-decoration-break/box-decoration-break-rendering.html
    19381938fast/box-shadow/border-radius-big.html
     1939fast/box-shadow/box-shadow-with-zero-radius.html [ ImageOnlyFailure ]
    19391940
    19401941# <rdar://problem/19226186> ASSERT(m_mainThreadLoader) fails in WorkerThreadableLoader::MainThreadBridge::MainThreadBridge()
  • trunk/Source/WebCore/ChangeLog

    r237688 r237691  
     12018-11-01  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-11-01  Youenn Fablet  <youenn@apple.com>
    215
  • trunk/Source/WebCore/PAL/ChangeLog

    r237607 r237691  
     12018-11-01  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-30  Alexey Proskuryakov  <ap@apple.com>
    211
  • trunk/Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h

    r237359 r237691  
    282282
    283283void CGContextDrawConicGradient(CGContextRef, CGGradientRef, CGPoint center, CGFloat angle);
     284
     285#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS_FAMILY) && __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

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