Title: [191148] trunk/Source
Revision
191148
Author
mmaxfi...@apple.com
Date
2015-10-15 16:20:07 -0700 (Thu, 15 Oct 2015)

Log Message

Migrate to CGContextSetBaseCTM() and CGContextResetClip() from WKSI
https://bugs.webkit.org/show_bug.cgi?id=150155

Reviewed by Tim Horton.

Source/WebCore:

No new tests because there is no behavior change.

* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawPattern):
(WebCore::GraphicsContext::platformApplyDeviceScaleFactor):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::putByteArray):
* platform/ios/WebCoreSystemInterfaceIOS.mm:
* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:

Source/WebKit/mac:

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Deleted.
* WebView/WebView.mm:
(-[WebView _setBaseCTM:forContext:]):

Source/WebKit2:

* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (191147 => 191148)


--- trunk/Source/WebCore/ChangeLog	2015-10-15 23:18:09 UTC (rev 191147)
+++ trunk/Source/WebCore/ChangeLog	2015-10-15 23:20:07 UTC (rev 191148)
@@ -1,3 +1,21 @@
+2015-10-15  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        Migrate to CGContextSetBaseCTM() and CGContextResetClip() from WKSI
+        https://bugs.webkit.org/show_bug.cgi?id=150155
+
+        Reviewed by Tim Horton.
+
+        No new tests because there is no behavior change.
+
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        (WebCore::GraphicsContext::drawPattern):
+        (WebCore::GraphicsContext::platformApplyDeviceScaleFactor):
+        * platform/graphics/cg/ImageBufferCG.cpp:
+        (WebCore::ImageBuffer::putByteArray):
+        * platform/ios/WebCoreSystemInterfaceIOS.mm:
+        * platform/mac/WebCoreSystemInterface.h:
+        * platform/mac/WebCoreSystemInterface.mm:
+
 2015-10-15  Dan Bernstein  <m...@apple.com>
 
         Fixed the build.

Modified: trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp (191147 => 191148)


--- trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp	2015-10-15 23:18:09 UTC (rev 191147)
+++ trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp	2015-10-15 23:20:07 UTC (rev 191148)
@@ -336,8 +336,7 @@
         RetainPtr<CGColorRef> color = adoptCF(CGColorCreateWithPattern(patternSpace.get(), pattern.get(), &alpha));
         CGContextSetFillColorSpace(context, patternSpace.get());
 
-        // FIXME: Really want a public API for this. It is just CGContextSetBaseCTM(context, CGAffineTransformIdentiy).
-        wkSetBaseCTM(context, CGAffineTransformIdentity);
+        CGContextSetBaseCTM(context, CGAffineTransformIdentity);
         CGContextSetPatternPhase(context, CGSizeZero);
 
         CGContextSetFillColorWithColor(context, color.get());
@@ -1695,7 +1694,7 @@
     // CoreGraphics expects the base CTM of a HiDPI context to have the scale factor applied to it.
     // Failing to change the base level CTM will cause certain CG features, such as focus rings,
     // to draw with a scale factor of 1 rather than the actual scale factor.
-    wkSetBaseCTM(platformContext(), CGAffineTransformScale(CGContextGetBaseCTM(platformContext()), deviceScaleFactor, deviceScaleFactor));
+    CGContextSetBaseCTM(platformContext(), CGAffineTransformScale(CGContextGetBaseCTM(platformContext()), deviceScaleFactor, deviceScaleFactor));
 }
 
 void GraphicsContext::platformFillEllipse(const FloatRect& ellipse)

Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp (191147 => 191148)


--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp	2015-10-15 23:18:09 UTC (rev 191147)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp	2015-10-15 23:20:07 UTC (rev 191148)
@@ -325,7 +325,7 @@
         CGContextConcatCTM(destContext, AffineTransform(wkGetUserToBaseCTM(destContext)).inverse());
     else
         CGContextConcatCTM(destContext, AffineTransform(CGContextGetCTM(destContext)).inverse());
-    wkCGContextResetClip(destContext);
+    CGContextResetClip(destContext);
     CGContextSetInterpolationQuality(destContext, kCGInterpolationNone);
     CGContextSetAlpha(destContext, 1.0);
     CGContextSetBlendMode(destContext, kCGBlendModeCopy);

Modified: trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.mm (191147 => 191148)


--- trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.mm	2015-10-15 23:18:09 UTC (rev 191147)
+++ trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.mm	2015-10-15 23:20:07 UTC (rev 191148)
@@ -29,11 +29,9 @@
 WEBCORE_EXPORT void (*wkCALayerEnumerateRectsBeingDrawnWithBlock)(CALayer *, CGContextRef context, void (^block)(CGRect rect));
 WEBCORE_EXPORT BOOL (*wkCGContextGetShouldSmoothFonts)(CGContextRef);
 WEBCORE_EXPORT CGPatternRef (*wkCGPatternCreateWithImageAndTransform)(CGImageRef, CGAffineTransform, int);
-WEBCORE_EXPORT void (*wkCGContextResetClip)(CGContextRef);
 WEBCORE_EXPORT void (*wkClearGlyphVector)(void* glyphs);
 WEBCORE_EXPORT OSStatus (*wkConvertCharToGlyphs)(void* styleGroup, const UniChar*, unsigned numCharacters, void* glyphs);
 WEBCORE_EXPORT NSDate *(*wkGetNSURLResponseLastModifiedDate)(NSURLResponse *response);
-WEBCORE_EXPORT void (*wkSetBaseCTM)(CGContextRef, CGAffineTransform);
 WEBCORE_EXPORT void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint point);
 WEBCORE_EXPORT CGAffineTransform (*wkGetUserToBaseCTM)(CGContextRef);
 WEBCORE_EXPORT bool (*wkCGContextIsPDFContext)(CGContextRef);

Modified: trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h (191147 => 191148)


--- trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h	2015-10-15 23:18:09 UTC (rev 191147)
+++ trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h	2015-10-15 23:20:07 UTC (rev 191148)
@@ -131,7 +131,6 @@
     wkPatternTilingConstantSpacingMinimalDistortion,
     wkPatternTilingConstantSpacing
 } wkPatternTiling;
-extern void (*wkCGContextResetClip)(CGContextRef);
 #if !PLATFORM(IOS)
 extern bool (*wkCGContextDrawsWithCorrectShadowOffsets)(CGContextRef);
 #endif
@@ -198,7 +197,6 @@
 extern void (*wkSetDragImage)(NSImage*, NSPoint offset);
 #endif
 extern void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL);
-extern void (*wkSetBaseCTM)(CGContextRef, CGAffineTransform);
 extern void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint);
 extern CGAffineTransform (*wkGetUserToBaseCTM)(CGContextRef);
 extern bool (*wkCGContextIsPDFContext)(CGContextRef);

Modified: trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm (191147 => 191148)


--- trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm	2015-10-15 23:18:09 UTC (rev 191147)
+++ trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm	2015-10-15 23:20:07 UTC (rev 191148)
@@ -33,7 +33,6 @@
 void (*wkAdvanceDefaultButtonPulseAnimation)(NSButtonCell *);
 void (*wkCALayerEnumerateRectsBeingDrawnWithBlock)(CALayer *, CGContextRef context, void (^block)(CGRect rect));
 BOOL (*wkCGContextGetShouldSmoothFonts)(CGContextRef);
-void (*wkCGContextResetClip)(CGContextRef);
 bool (*wkCGContextDrawsWithCorrectShadowOffsets)(CGContextRef);
 CGPatternRef (*wkCGPatternCreateWithImageAndTransform)(CGImageRef, CGAffineTransform, int);
 NSString* (*wkCopyNSURLResponseStatusLine)(NSURLResponse*);
@@ -77,7 +76,6 @@
 
 void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*, BOOL);
 void (*wkSetDragImage)(NSImage*, NSPoint offset);
-void (*wkSetBaseCTM)(CGContextRef, CGAffineTransform);
 void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint point);
 CGAffineTransform (*wkGetUserToBaseCTM)(CGContextRef);
 bool (*wkCGContextIsPDFContext)(CGContextRef);

Modified: trunk/Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h (191147 => 191148)


--- trunk/Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h	2015-10-15 23:18:09 UTC (rev 191147)
+++ trunk/Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h	2015-10-15 23:20:07 UTC (rev 191148)
@@ -142,6 +142,7 @@
 void CGContextSetCTM(CGContextRef, CGAffineTransform);
 void CGContextSetCompositeOperation(CGContextRef, CGCompositeOperation);
 void CGContextSetShouldAntialiasFonts(CGContextRef, bool shouldAntialiasFonts);
+void CGContextResetClip(CGContextRef);
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
 void CGContextSetFontDilation(CGContextRef, CGSize);
 void CGContextSetFontRenderingStyle(CGContextRef, CGFontRenderingStyle);

Modified: trunk/Source/WebKit/mac/ChangeLog (191147 => 191148)


--- trunk/Source/WebKit/mac/ChangeLog	2015-10-15 23:18:09 UTC (rev 191147)
+++ trunk/Source/WebKit/mac/ChangeLog	2015-10-15 23:20:07 UTC (rev 191148)
@@ -1,3 +1,15 @@
+2015-10-15  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        Migrate to CGContextSetBaseCTM() and CGContextResetClip() from WKSI
+        https://bugs.webkit.org/show_bug.cgi?id=150155
+
+        Reviewed by Tim Horton.
+
+        * WebCoreSupport/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface): Deleted.
+        * WebView/WebView.mm:
+        (-[WebView _setBaseCTM:forContext:]):
+
 2015-10-15  Dan Bernstein  <m...@apple.com>
 
         [Cocoa] Stop using WKSetNSURLConnectionDefersCallbacks

Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm (191147 => 191148)


--- trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm	2015-10-15 23:18:09 UTC (rev 191147)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm	2015-10-15 23:20:07 UTC (rev 191148)
@@ -50,7 +50,6 @@
     INIT(CGContextGetShouldSmoothFonts);
 #endif
     INIT(CGPatternCreateWithImageAndTransform);
-    INIT(CGContextResetClip);
 #if !PLATFORM(IOS)
     INIT(CGContextDrawsWithCorrectShadowOffsets);
 #endif
@@ -84,7 +83,6 @@
     INIT(WindowSetScaledFrame);
     INIT(SetCGFontRenderingMode);
 #endif
-    INIT(SetBaseCTM);
     INIT(SetCONNECTProxyAuthorizationForStream);
     INIT(SetCONNECTProxyForStream);
 #if !PLATFORM(IOS)

Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (191147 => 191148)


--- trunk/Source/WebKit/mac/WebView/WebView.mm	2015-10-15 23:18:09 UTC (rev 191147)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm	2015-10-15 23:20:07 UTC (rev 191148)
@@ -3871,7 +3871,7 @@
 
 - (void)_setBaseCTM:(CGAffineTransform)transform forContext:(CGContextRef)context
 {
-    WKSetBaseCTM(context, transform);
+    CGContextSetBaseCTM(context, transform);
 }
 
 - (BOOL)interactiveFormValidationEnabled

Modified: trunk/Source/WebKit2/ChangeLog (191147 => 191148)


--- trunk/Source/WebKit2/ChangeLog	2015-10-15 23:18:09 UTC (rev 191147)
+++ trunk/Source/WebKit2/ChangeLog	2015-10-15 23:20:07 UTC (rev 191148)
@@ -1,3 +1,13 @@
+2015-10-15  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        Migrate to CGContextSetBaseCTM() and CGContextResetClip() from WKSI
+        https://bugs.webkit.org/show_bug.cgi?id=150155
+
+        Reviewed by Tim Horton.
+
+        * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface): Deleted.
+
 2015-10-15  Dean Jackson  <d...@apple.com>
 
         Fix the iOS build. And hopefully not breaking the other builds

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm (191147 => 191148)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm	2015-10-15 23:18:09 UTC (rev 191147)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm	2015-10-15 23:20:07 UTC (rev 191148)
@@ -42,7 +42,6 @@
         INIT(CALayerEnumerateRectsBeingDrawnWithBlock);
         INIT(CGContextGetShouldSmoothFonts);
         INIT(CGPatternCreateWithImageAndTransform);
-        INIT(CGContextResetClip);
 #if !PLATFORM(IOS)
         INIT(CGContextDrawsWithCorrectShadowOffsets);
 #endif
@@ -91,7 +90,6 @@
         INIT(QTClearMediaDownloadCache);
         INIT(SetCGFontRenderingMode);
 #endif
-        INIT(SetBaseCTM);
         INIT(SetCONNECTProxyAuthorizationForStream);
         INIT(SetCONNECTProxyForStream);
 #if !PLATFORM(IOS)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to