haikuwebkit/LayoutTests/compositing/tiling/non-active-window-tiles-siz...

32 lines
937 B
HTML
Raw Permalink Normal View History

Use smaller tiles in windows that are not active to facilitate App Napping https://bugs.webkit.org/show_bug.cgi?id=167997 <rdar://problem/30358835> Reviewed by Simon Fraser. Source/WebCore: Use smaller / non-adaptative tiles in windows that are not active to facilitate App Napping after <https://trac.webkit.org/r197594>. Test: compositing/tiling/non-active-window-tiles-size.html * page/FrameView.cpp: (WebCore::FrameView::contentsResized): (WebCore::FrameView::addedOrRemovedScrollbar): (WebCore::FrameView::computeScrollability): (WebCore::FrameView::updateTiledBackingAdaptiveSizing): (WebCore::FrameView::unobscuredContentSizeChanged): (WebCore::FrameView::setViewExposedRect): * page/FrameView.h: * page/Page.cpp: (WebCore::Page::setActivityState): (WebCore::Page::isWindowActive): * page/Page.h: * platform/graphics/TiledBacking.h: * platform/graphics/ca/TileController.cpp: (WebCore::TileController::setTileSizeUpdateDelayDisabledForTesting): (WebCore::TileController::notePendingTileSizeChange): * platform/graphics/ca/TileController.h: * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::disableTileSizeUpdateDelay): * testing/Internals.h: * testing/Internals.idl: Tools: * WebKitTestRunner/mac/PlatformWebViewMac.mm: (WTR::PlatformWebView::setWindowIsKey): Actually update windowIsKey state of NSWindow so the WebView properly updates its activity state. LayoutTests: Add layout test coverage. * compositing/tiling/non-active-window-tiles-size-expected.txt: Added. * compositing/tiling/non-active-window-tiles-size.html: Added. * platform/ios-simulator-wk2/compositing/tiling/non-active-window-tiles-size-expected.txt: Added. * platform/mac-wk1/compositing/tiling/non-active-window-tiles-size-expected.txt: Added. Canonical link: https://commits.webkit.org/185049@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211910 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-09 00:56:42 +00:00
<!DOCTYPE html>
<html>
<body>
<p>Tiles when window is active:</p>
<pre id="activeResult"></pre>
<p>Tiles when window is not active:</p>
<pre id="nonActiveResult"></pre>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
if (window.internals)
internals.disableTileSizeUpdateDelay();
onload = function() {
document.getElementById("activeResult").innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_VISIBLE_RECTS | internals.LAYER_TREE_INCLUDES_TILE_CACHES);
if (window.testRunner)
testRunner.setWindowIsKey(false);
setTimeout(function() {
document.getElementById("nonActiveResult").innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_VISIBLE_RECTS | internals.LAYER_TREE_INCLUDES_TILE_CACHES);
if (window.testRunner)
testRunner.notifyDone();
}, 0);
}
</script>
</body>
</html>