haikuwebkit/LayoutTests/tiled-drawing/use-tiled-drawing.html

29 lines
665 B
HTML
Raw Permalink Normal View History

Allow tests to run with a tile cache, and optionally dump the tile cache via layerTreeAsText() https://bugs.webkit.org/show_bug.cgi?id=100159 Patch by Simon Fraser <simon.fraser@apple.com> on 2012-10-23 Reviewed by Tim Horton. Source/WebCore: Add a LAYER_TREE_INCLUDES_PAGE_TILE_CACHE flag for layerTreeAsText(), and plumb it through to GraphicsLayerCA, which dumps the TiledBacking tile coverage rect. Test: platform/mac/tiled-drawing/use-tiled-drawing.html * page/Frame.h: * platform/graphics/GraphicsLayer.cpp: (showGraphicsLayerTree): * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::tiledBacking): * platform/graphics/TiledBacking.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::tiledBacking): (WebCore::GraphicsLayerCA::dumpAdditionalProperties): * platform/graphics/ca/GraphicsLayerCA.h: (GraphicsLayerCA): * platform/graphics/ca/mac/TileCache.h: (WebCore::TileCache::tileCoverageRect): (TileCache): * platform/graphics/ca/mac/TileCache.mm: (WebCore::TileCache::computeTileCoverageRect): (WebCore::TileCache::revalidateTiles): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::layerTreeAsText): * testing/Internals.cpp: (WebCore::Internals::layerTreeAsText): * testing/Internals.h: * testing/Internals.idl: Tools: Make WebKitTestRunner use a WKView with a tile cache for tests run in a directory whose path includes "tiled-drawing". It does this by passing around a WKDictionary of options, and if the current PlatformWebView doesn't support those options, it will create a new one. * WebKitTestRunner/PlatformWebView.h: (PlatformWebView): Add a WKDictionaryRef options dictionary argument. (WTR::PlatformWebView::viewSupportsOptions): Returns true if the view supports the options in the WKDictionaryRef. * WebKitTestRunner/TestController.cpp: (WTR::TestController::initialize): Call createWebViewWithOptions() with no options in the normal case. (WTR::TestController::createWebViewWithOptions): Moved code into this fuction so we can call it in two places. (WTR::TestController::ensureViewSupportsOptions): If the current view doesn't support the given options, throw it away and makea new one that does. * WebKitTestRunner/TestController.h: * WebKitTestRunner/TestInvocation.cpp: (WTR::shouldUseTiledDrawing): Return true if the directory contains "tiled-drawing". (WTR::updateTiledDrawingForCurrentTest): Tell the TestController to check whether the view supports the given options. No-op for non-Mac platforms. (WTR::TestInvocation::invoke): Call updateTiledDrawingForCurrentTest(). * WebKitTestRunner/efl/PlatformWebViewEfl.cpp: (WTR::PlatformWebView::PlatformWebView): New constructor parameter. * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp: (WTR::PlatformWebView::PlatformWebView): New constructor parameter. * WebKitTestRunner/mac/PlatformWebViewMac.mm: (-[TestRunnerWKView initWithFrame:contextRef:pageGroupRef:useTiledDrawing:]): (-[TestRunnerWKView _shouldUseTiledDrawingArea]): Subclass the WKView so we can return a custom value from this method. (WTR::PlatformWebView::PlatformWebView): (WTR::PlatformWebView::viewSupportsOptions): * WebKitTestRunner/qt/PlatformWebViewQt.cpp: (WTR::PlatformWebView::PlatformWebView): New constructor parameter. * WebKitTestRunner/win/PlatformWebViewWin.cpp: (WTR::PlatformWebView::PlatformWebView): New constructor parameter. LayoutTests: A new test that dumps tile cache data for a large page. * platform/mac/tiled-drawing/use-tiled-drawing-expected.txt: Added. * platform/mac/tiled-drawing/use-tiled-drawing.html: Added. Canonical link: https://commits.webkit.org/118216@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@132301 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-24 04:31:48 +00:00
<!DOCTYPE html>
<html>
<head>
<style>
body {
width: 1200px;
height: 2000px;
}
</style>
<script>
if (window.testRunner)
testRunner.dumpAsText();
function doTest()
{
if (window.internals) {
document.getElementById('layers').innerText = internals.layerTreeAsText(document,
internals.LAYER_TREE_INCLUDES_VISIBLE_RECTS | internals.LAYER_TREE_INCLUDES_TILE_CACHES);
}
}
window.addEventListener('load', doTest, false);
</script>
</head>
<body>
<pre id="layers">Layer tree goes here</p>
</body>
</html>