Diff
Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (193917 => 193918)
--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog 2015-12-10 19:18:49 UTC (rev 193917)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog 2015-12-10 19:18:54 UTC (rev 193918)
@@ -1,5 +1,23 @@
2015-12-10 Matthew Hanson <matthew_han...@apple.com>
+ Merge r193382. rdar://problem/23814344
+
+ 2015-12-03 Simon Fraser <simon.fra...@apple.com>
+
+ Have layer memory use consult the backing store format
+ https://bugs.webkit.org/show_bug.cgi?id=151827
+ rdar://problem/23746497
+
+ Reviewed by Dean Jackson.
+
+ When computing the backing store memory size, take the pixel format into account,
+ rather than assuming 4 bytes per pixel.
+
+ * platform/graphics/ca/GraphicsLayerCA.cpp:
+ * platform/graphics/ca/PlatformCALayer.h:
+
+2015-12-10 Matthew Hanson <matthew_han...@apple.com>
+
Merge r193286. rdar://problem/23814343
2015-12-02 Sam Weinig <s...@webkit.org>
Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (193917 => 193918)
--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp 2015-12-10 19:18:49 UTC (rev 193917)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp 2015-12-10 19:18:54 UTC (rev 193918)
@@ -3765,7 +3765,7 @@
if (!m_layer->backingContributesToMemoryEstimate())
return 0;
- return 4.0 * size().width() * m_layer->contentsScale() * size().height() * m_layer->contentsScale();
+ return m_layer->backingStoreBytesPerPixel() * size().width() * m_layer->contentsScale() * size().height() * m_layer->contentsScale();
}
} // namespace WebCore
Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/ca/PlatformCALayer.h (193917 => 193918)
--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/ca/PlatformCALayer.h 2015-12-10 19:18:49 UTC (rev 193917)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/ca/PlatformCALayer.h 2015-12-10 19:18:54 UTC (rev 193918)
@@ -228,6 +228,8 @@
virtual void updateCustomAppearance(GraphicsLayer::CustomAppearance) = 0;
virtual TiledBacking* tiledBacking() = 0;
+
+ virtual unsigned backingStoreBytesPerPixel() const { return 4; }
#if PLATFORM(WIN)
virtual PlatformCALayer* rootLayer() const = 0;
Modified: branches/safari-601.1.46-branch/Source/WebKit2/ChangeLog (193917 => 193918)
--- branches/safari-601.1.46-branch/Source/WebKit2/ChangeLog 2015-12-10 19:18:49 UTC (rev 193917)
+++ branches/safari-601.1.46-branch/Source/WebKit2/ChangeLog 2015-12-10 19:18:54 UTC (rev 193918)
@@ -1,3 +1,25 @@
+2015-12-10 Matthew Hanson <matthew_han...@apple.com>
+
+ Merge r193382. rdar://problem/23814344
+
+ 2015-12-03 Simon Fraser <simon.fra...@apple.com>
+
+ Have layer memory use consult the backing store format
+ https://bugs.webkit.org/show_bug.cgi?id=151827
+ rdar://problem/23746497
+
+ Reviewed by Dean Jackson.
+
+ When computing the backing store memory size, take the pixel format into account,
+ rather than assuming 4 bytes per pixel.
+
+ * Shared/mac/RemoteLayerBackingStore.h:
+ * Shared/mac/RemoteLayerBackingStore.mm:
+ (WebKit::RemoteLayerBackingStore::bytesPerPixel):
+ * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
+ (WebKit::PlatformCALayerRemote::backingStoreBytesPerPixel):
+ * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
+
2015-12-09 Babak Shafiei <bshaf...@apple.com>
Merge r190505.
Modified: branches/safari-601.1.46-branch/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.h (193917 => 193918)
--- branches/safari-601.1.46-branch/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.h 2015-12-10 19:18:49 UTC (rev 193917)
+++ branches/safari-601.1.46-branch/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.h 2015-12-10 19:18:54 UTC (rev 193918)
@@ -61,6 +61,7 @@
float scale() const { return m_scale; }
bool acceleratesDrawing() const { return m_acceleratesDrawing; }
bool isOpaque() const { return m_isOpaque; }
+ unsigned bytesPerPixel() const;
PlatformCALayerRemote* layer() const { return m_layer; }
Modified: branches/safari-601.1.46-branch/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm (193917 => 193918)
--- branches/safari-601.1.46-branch/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm 2015-12-10 19:18:49 UTC (rev 193917)
+++ branches/safari-601.1.46-branch/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm 2015-12-10 19:18:54 UTC (rev 193918)
@@ -187,6 +187,20 @@
return roundedIntSize(scaledSize);
}
+unsigned RemoteLayerBackingStore::bytesPerPixel() const
+{
+#if USE(IOSURFACE)
+ WebCore::IOSurface::Format format = bufferFormat(m_isOpaque);
+ switch (format) {
+ case IOSurface::Format::RGBA: return 4;
+ case IOSurface::Format::YUV422: return 2;
+ case IOSurface::Format::RGB10: return 4;
+ case IOSurface::Format::RGB10A8: return 5;
+ }
+#endif
+ return 4;
+}
+
void RemoteLayerBackingStore::swapToValidFrontBuffer()
{
IntSize expandedScaledSize = backingStoreSize();
Modified: branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp (193917 => 193918)
--- branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp 2015-12-10 19:18:49 UTC (rev 193917)
+++ branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp 2015-12-10 19:18:54 UTC (rev 193918)
@@ -777,6 +777,14 @@
return 0;
}
+unsigned PlatformCALayerRemote::backingStoreBytesPerPixel() const
+{
+ if (!m_properties.backingStore)
+ return 4;
+
+ return m_properties.backingStore->bytesPerPixel();
+}
+
LayerPool& PlatformCALayerRemote::layerPool()
{
return m_context->layerPool();
Modified: branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h (193917 => 193918)
--- branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h 2015-12-10 19:18:49 UTC (rev 193917)
+++ branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h 2015-12-10 19:18:54 UTC (rev 193918)
@@ -171,6 +171,8 @@
virtual uint32_t hostingContextID();
+ virtual unsigned backingStoreBytesPerPixel() const override;
+
void setClonedLayer(const PlatformCALayer*);
RemoteLayerTreeTransaction::LayerProperties& properties() { return m_properties; }