Title: [213192] trunk/Source/WebCore
Revision
213192
Author
simon.fra...@apple.com
Date
2017-02-28 16:20:28 -0800 (Tue, 28 Feb 2017)

Log Message

Don't use the LinearGlyphMask format if accelerated drawing is disabled
https://bugs.webkit.org/show_bug.cgi?id=168997

Reviewed by Tim Horton.

Non-accelerated drawing doesn't work into LinearGlyphMask-format backing store,
so don't use that backing store format when accelerated drawing is disabled.

* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::PlatformCALayer::drawRepaintIndicator):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(layerContentsFormat):
(PlatformCALayerCocoa::updateContentsFormat):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (213191 => 213192)


--- trunk/Source/WebCore/ChangeLog	2017-03-01 00:20:24 UTC (rev 213191)
+++ trunk/Source/WebCore/ChangeLog	2017-03-01 00:20:28 UTC (rev 213192)
@@ -1,5 +1,21 @@
 2017-02-28  Simon Fraser  <simon.fra...@apple.com>
 
+        Don't use the LinearGlyphMask format if accelerated drawing is disabled
+        https://bugs.webkit.org/show_bug.cgi?id=168997
+
+        Reviewed by Tim Horton.
+
+        Non-accelerated drawing doesn't work into LinearGlyphMask-format backing store,
+        so don't use that backing store format when accelerated drawing is disabled.
+
+        * platform/graphics/ca/PlatformCALayer.cpp:
+        (WebCore::PlatformCALayer::drawRepaintIndicator):
+        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
+        (layerContentsFormat):
+        (PlatformCALayerCocoa::updateContentsFormat):
+
+2017-02-28  Simon Fraser  <simon.fra...@apple.com>
+
         Make the repaint indicators show subpixel antialiased text indication a bit more clearly
         https://bugs.webkit.org/show_bug.cgi?id=168988
 

Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp (213191 => 213192)


--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp	2017-03-01 00:20:24 UTC (rev 213191)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp	2017-03-01 00:20:28 UTC (rev 213192)
@@ -119,7 +119,7 @@
     CGFloat strokeWidthAsPercentageOfFontSize = 0;
     Color strokeColor;
 
-    if (!platformCALayer->isOpaque() && platformCALayer->supportsSubpixelAntialiasedText()) {
+    if (!platformCALayer->isOpaque() && platformCALayer->supportsSubpixelAntialiasedText() && platformCALayer->acceleratesDrawing()) {
         strokeColor = Color(0, 0, 0, 200);
         strokeWidthAsPercentageOfFontSize = -4.5; // Negative means "stroke and fill"; see docs for kCTStrokeWidthAttributeName.
     }

Modified: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm (213191 => 213192)


--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm	2017-03-01 00:20:24 UTC (rev 213191)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm	2017-03-01 00:20:28 UTC (rev 213192)
@@ -995,7 +995,7 @@
 }
 
 #if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 90300) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200)
-static NSString *layerContentsFormat(bool wantsDeepColor, bool supportsSubpixelAntialiasedFonts)
+static NSString *layerContentsFormat(bool acceleratesDrawing, bool wantsDeepColor, bool supportsSubpixelAntialiasedFonts)
 {
 #if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 90300
     if (wantsDeepColor)
@@ -1005,10 +1005,11 @@
 #endif
 
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
-    if (supportsSubpixelAntialiasedFonts)
+    if (supportsSubpixelAntialiasedFonts && acceleratesDrawing)
         return kCAContentsFormatRGBA8ColorRGBA8LinearGlyphMask;
 #else
     UNUSED_PARAM(supportsSubpixelAntialiasedFonts);
+    UNUSED_PARAM(acceleratesDrawing);
 #endif
 
     return nil;
@@ -1020,7 +1021,7 @@
     if (m_layerType == LayerTypeWebLayer || m_layerType == LayerTypeTiledBackingTileLayer) {
         BEGIN_BLOCK_OBJC_EXCEPTIONS
 #if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 90300) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200)
-        if (NSString *formatString = layerContentsFormat(wantsDeepColorBackingStore(), supportsSubpixelAntialiasedText()))
+        if (NSString *formatString = layerContentsFormat(acceleratesDrawing(), wantsDeepColorBackingStore(), supportsSubpixelAntialiasedText()))
             [m_layer setContentsFormat:formatString];
 #endif
         END_BLOCK_OBJC_EXCEPTIONS
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to