Show a mini visualizer for the tile cache tiles
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Dec 2012 00:49:33 +0000 (00:49 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Dec 2012 00:49:33 +0000 (00:49 +0000)
commitaa78a4db9b69a30e991538ef626f52735b722840
tree6daee9d6cd7036a91c76392b675d30adf3589920
parentaa0ed42bc04752752c792c496a82534400c3c860
Show a mini visualizer for the tile cache tiles
https://bugs.webkit.org/show_bug.cgi?id=104053

Reviewed by Beth Dakin.

Source/WebCore:

Replace the current red/green/yellow scrolling indicator with a
mini map of the tile cache that shows the current tiles, and the
visible rect.

Visibility is controlled via a new preference.

* WebCore.exp.in: Add Settings::setShowTiledScrollingIndicator(bool),
and remove ScrollingTree::setDebugRootLayer(CALayer*)
* WebCore.xcodeproj/project.pbxproj: Remove ScrollingTreeMac.mm which
is no longer needed; it just contained debug layer stuff.
* page/Settings.cpp:
(WebCore::Settings::Settings): Support the new setting.
(WebCore::Settings::setShowTiledScrollingIndicator):
* page/Settings.h:
(WebCore::Settings::showTiledScrollingIndicator):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitNewTreeState): We no longer update the debug
indicator on tree commit.
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::hasWheelEventHandlers): Needed for the tiled
scrolling indicator.
(ScrollingTree):
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::commitTreeState): Tell the TiledBacking
about the current scrolling mode.
* page/scrolling/mac/ScrollingTreeMac.mm: Removed.
* platform/graphics/TiledBacking.h: Add functions to set the indicator scrolling
mode, and to get the tiled scrolling indicator layer. This has to be parented by
the DrawingArea, to ensure that it's in front of all other layers.
* platform/graphics/ca/mac/TileCache.h:
(WebCore::TileCache::scale): Exposed for the indicator drawing code to use.
* platform/graphics/ca/mac/TileCache.mm:
(-[WebTileCacheMapLayer init]): The indicator has a sublayer which renders the
visible rect frame, owned by it.
(-[WebTileCacheMapLayer drawInContext:]):
(WebCore::TileCache::TileCache): The indicator mode has to be stored here,
since it can be pushed down before we have an indicator layer.
(WebCore::TileCache::~TileCache): Clear the TileCache on the indicator layer, which
may outlive us.
(WebCore::TileCache::revalidateTiles): Call updateTileCoverageMap().
(WebCore::TileCache::updateTileCoverageMap): Resize the indicator layer to fit
within the window, and update the indicator color.
(WebCore::TileCache::tiledScrollingIndicatorLayer): Create and initialize the layer.
(WebCore::TileCache::setScrollingModeIndication):
(WebCore::TileCache::drawTileMapContents): Draw small white rects for the tiles over
an translucent gray background.

Source/WebKit2:

Plumb through a preference that controls the visibility of a tiled
scrolling indicator, and parent that layer in the TiledCoreAnimationDrawingArea.

* Shared/WebPreferencesStore.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetTiledScrollingIndicatorVisible):
(WKPreferencesGetTiledScrollingIndicatorVisible):
* UIProcess/API/C/WKPreferencesPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
(TiledCoreAnimationDrawingArea):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::updatePreferences):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
(WebKit::TiledCoreAnimationDrawingArea::mainFrameTiledBacking):
(WebKit::TiledCoreAnimationDrawingArea::updateDebugInfoLayer):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136594 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebCore/page/scrolling/ScrollingTree.cpp
Source/WebCore/page/scrolling/ScrollingTree.h
Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
Source/WebCore/page/scrolling/mac/ScrollingTreeMac.mm [deleted file]
Source/WebCore/platform/graphics/TiledBacking.h
Source/WebCore/platform/graphics/ca/mac/TileCache.h
Source/WebCore/platform/graphics/ca/mac/TileCache.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesStore.h
Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm