haikuwebkit/LayoutTests/compositing/backing-store-attachment-1....

36 lines
699 B
HTML
Raw Permalink Normal View History

[Mac] Remove backing store for layers that are outside the viewport https://bugs.webkit.org/show_bug.cgi?id=170082 <rdar://problem/31245009> Reviewed by Simon Fraser. Source/WebCore: Implement the backingStoreAttached flag in PlatformCALayerCocoa. This means that compositing layers outside the tiling coverage rect will no longer have backing stores, saving large amounts of memory. Also added a canDetachBackingStore flag that is set to false for scroll control layers, to avoid complicating coverage rect computations. Test: compositing/backing-store-attachment-1.html * page/Frame.h: * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::GraphicsLayer): (WebCore::GraphicsLayer::dumpProperties): * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::backingStoreAttached): (WebCore::GraphicsLayer::setCanDetachBackingStore): (WebCore::GraphicsLayer::canDetachBackingStore): * platform/graphics/GraphicsLayerClient.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::backingStoreAttached): (WebCore::GraphicsLayerCA::setNeedsDisplay): (WebCore::GraphicsLayerCA::updateCoverage): * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/ca/PlatformCALayer.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (PlatformCALayerCocoa::setBackingStoreAttached): (PlatformCALayerCocoa::backingStoreAttached): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateOverflowControlsLayers): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::layerTreeAsText): (WebCore::RenderLayerCompositor::updateOverflowControlsLayers): * testing/Internals.cpp: (WebCore::toLayerTreeFlags): * testing/Internals.h: * testing/Internals.idl: Source/WebKit2: * WebProcess/WebPage/mac/PlatformCALayerRemote.h: LayoutTests: Add a simple test with two compositing layers far apart vertically. Only one of them should have its backing store attached. * compositing/backing-store-attachment-1-expected.txt: Added. * compositing/backing-store-attachment-1.html: Added. Canonical link: https://commits.webkit.org/189732@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217696 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-06-02 05:04:14 +00:00
<!DOCTYPE html>
<html>
<head>
<style>
.layerized {
transform: translateZ(0);
width: 600px;
height: 600px;
}
.vspace {
height: 1000px;
}
</style>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
window.onload = function() {
if (window.testRunner) {
var out = document.getElementById('out');
out.innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_BACKING_STORE_ATTACHED);
testRunner.notifyDone();
}
};
</script>
</head>
<body>
<pre id="out"></pre>
<div class="layerized">I'm attached.</div>
<div class="vspace"></div>
<div class="layerized">I'm detached.</div>
</body>
</html>