Title: [213767] trunk/Source/WebCore
- Revision
- 213767
- Author
- [email protected]
- Date
- 2017-03-11 22:21:05 -0800 (Sat, 11 Mar 2017)
Log Message
Fix memory estimate for layers supporting subpixel-antialised text
https://bugs.webkit.org/show_bug.cgi?id=169507
rdar://problem/30979337
Reviewed by Alexey Proskuryakov.
Deep color layers on iOS use 5 bytes per pixel, layers supporting subpixel-antialiaed
text on Mac use 8 bytes per pixel.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::backingStoreBytesPerPixel):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (213766 => 213767)
--- trunk/Source/WebCore/ChangeLog 2017-03-12 06:07:05 UTC (rev 213766)
+++ trunk/Source/WebCore/ChangeLog 2017-03-12 06:21:05 UTC (rev 213767)
@@ -1,3 +1,18 @@
+2017-03-11 Simon Fraser <[email protected]>
+
+ Fix memory estimate for layers supporting subpixel-antialised text
+ https://bugs.webkit.org/show_bug.cgi?id=169507
+ rdar://problem/30979337
+
+ Reviewed by Alexey Proskuryakov.
+
+ Deep color layers on iOS use 5 bytes per pixel, layers supporting subpixel-antialiaed
+ text on Mac use 8 bytes per pixel.
+
+ * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
+ * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
+ (PlatformCALayerCocoa::backingStoreBytesPerPixel):
+
2017-03-11 Youenn Fablet <[email protected]>
XMLHttpRequest: make setRequestHeader() use `, ` as separator (including a space)
Modified: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h (213766 => 213767)
--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h 2017-03-12 06:07:05 UTC (rev 213766)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h 2017-03-12 06:21:05 UTC (rev 213767)
@@ -175,6 +175,8 @@
void enumerateRectsBeingDrawn(CGContextRef, void (^block)(CGRect)) override;
+ unsigned backingStoreBytesPerPixel() const override;
+
private:
PlatformCALayerCocoa(LayerType, PlatformCALayerClient* owner);
PlatformCALayerCocoa(PlatformLayer*, PlatformCALayerClient* owner);
Modified: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm (213766 => 213767)
--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm 2017-03-12 06:07:05 UTC (rev 213766)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm 2017-03-12 06:21:05 UTC (rev 213767)
@@ -1192,6 +1192,20 @@
wkCALayerEnumerateRectsBeingDrawnWithBlock(m_layer.get(), context, block);
}
+unsigned PlatformCALayerCocoa::backingStoreBytesPerPixel() const
+{
+#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 90300
+ if (wantsDeepColorBackingStore())
+ return isOpaque() ? 4 : 5;
+#endif
+
+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
+ if (!isOpaque() && supportsSubpixelAntialiasedText())
+ return 8;
+#endif
+ return 4;
+}
+
AVPlayerLayer *PlatformCALayerCocoa::avPlayerLayer() const
{
if (layerType() != LayerTypeAVPlayerLayer)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes