Allow tests to run with a tile cache, and optionally dump the tile cache via layerTre...
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Oct 2012 22:22:11 +0000 (22:22 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Oct 2012 22:22:11 +0000 (22:22 +0000)
commitc58ff6a1a1fe491259e8e5656947818b5776d0d6
treea3539bd7229e43ad16795a8f639693356d1e0cea
parent028f1b71b7f04501e3d9019abd22f852b9816d2c
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

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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@132276 268f45cc-cd09-0410-ab3c-d52691b4dbfc
26 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/tiled-drawing/use-tiled-drawing-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/tiled-drawing/use-tiled-drawing.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/Frame.h
Source/WebCore/platform/graphics/GraphicsLayer.cpp
Source/WebCore/platform/graphics/GraphicsLayer.h
Source/WebCore/platform/graphics/TiledBacking.h
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
Source/WebCore/platform/graphics/ca/mac/TileCache.h
Source/WebCore/platform/graphics/ca/mac/TileCache.mm
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Tools/ChangeLog
Tools/WebKitTestRunner/PlatformWebView.h
Tools/WebKitTestRunner/TestController.cpp
Tools/WebKitTestRunner/TestController.h
Tools/WebKitTestRunner/TestInvocation.cpp
Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp
Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp
Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm
Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
Tools/WebKitTestRunner/win/PlatformWebViewWin.cpp