[Cherry-pick] Create a GraphicsLayerUpdater class that will do periodic layer flushes...
authorprabha.p@samsung.com <prabha.p@samsung.com>
Tue, 18 Jun 2013 08:09:44 +0000 (17:09 +0900)
committerHurnjoo Lee <hurnjoo.lee@samsung.com>
Wed, 2 Oct 2013 07:56:20 +0000 (16:56 +0900)
commit9b352dc7cbbad33a1604190a3522a56d75e183f5
tree3bfa787b2c2af8d1ed8a6ab9d322a39429ee21ad
parentceb2d484ce5f4caf519e9b5e3cc38e96361719bb
[Cherry-pick] Create a GraphicsLayerUpdater class that will do periodic layer flushes for layer trees containing tile caches

[Title] Create a GraphicsLayerUpdater class that will do periodic layer flushes for layer trees containing tile caches
[Issue#] P130604-5534
[Problem] Delay in painting when the transition happens
[Cause]
[Solution] Cherry-pick
[Cherry-Picker] Prabhavathi Perumal <prabha.p@samsung.com>

Create a GraphicsLayerUpdater class that will do periodic layer flushes for layer trees containing tile caches

https://bugs.webkit.org/show_bug.cgi?id=99518

Reviewed by Dean Jackson.

When using tile caches in place of tiled layers, we need to recompute their
visible area periodically while animations and scrolling are happening.
Make a new class, GraphicsLayerUpdater, to handle this updating.
Internally, it uses DisplayRefreshMonitor to generate the periodic updates.

GraphicsLayer clients are notified that layers need periodic updates. Clients
are free to make use of GraphicsLayerUpdater to handle this updating, as
RenderLayerCompositor does.

Also do some minor refactoring of methods in RenderLayerCompositor that
get to Page.

* CMakeLists.txt: Add GraphicsLayerUpdater.cpp to the build.
* GNUmakefile.list.am: Ditto.
* PlatformBlackBerry.cmake: Ditto.
* Target.pri: Ditto.
* WebCore.gypi: Ditto.
* WebCore.vcproj/WebCore.vcproj: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* dom/Document.cpp:
(WebCore::Document::windowScreenDidChange): Tell the compositor that the screen
changed, so it can tell the GraphicsLayerUpdater if it has one.
* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::notifyFlushBeforeDisplayRefresh): Method called
for layers that need periodic updates, like tile cache layers.
* platform/graphics/GraphicsLayerUpdater.cpp: Added. Uses DisplayRefreshMonitorManager
to flush layers before the next refresh.
(WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater):
(WebCore::GraphicsLayerUpdater::~GraphicsLayerUpdater):
(WebCore::GraphicsLayerUpdater::scheduleUpdate):
(WebCore::GraphicsLayerUpdater::screenDidChange):
(WebCore::GraphicsLayerUpdater::displayRefreshFired):
* platform/graphics/GraphicsLayerUpdater.h: Added.
(GraphicsLayerUpdaterClient): Clients need to implement flushLayers().
(WebCore::GraphicsLayerUpdaterClient::~GraphicsLayerUpdaterClient):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::recursiveCommitChanges): For tile cache layers,
tell the client that this layer should be updated soon to update the visible rect.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::notifyFlushBeforeDisplayRefresh): Pass this message
on to the compositor.
* rendering/RenderLayerBacking.h:
(RenderLayerBacking): Implement notifyFlushBeforeDisplayRefresh.
Add OVERRIDE to all the client overrides.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags): Use helper to get to Page.
(WebCore::RenderLayerCompositor::scheduleLayerFlush): Ditto.
(WebCore::RenderLayerCompositor::flushPendingLayerChanges): Soon we're going to be asking
about the current state of animations inside the flush (for visible rect computation), so we
need a AnimationUpdateBlock to make sure all the animation times are in sync.
(WebCore::RenderLayerCompositor::notifyFlushBeforeDisplayRefresh): Make a GraphicsLayerUpdater
if necessary, and tell it to update soon.
(WebCore::RenderLayerCompositor::flushLayers): The GraphicsLayerUpdater client method.
Just does a flush. For now, considers this Frame as the flush root, which will need fixing for iframes.
(WebCore::RenderLayerCompositor::shouldPropagateCompositingToEnclosingFrame): Use helper to get to Page.
(WebCore::RenderLayerCompositor::deviceScaleFactor): Ditto.
(WebCore::RenderLayerCompositor::pageScaleFactor): Ditto.
(WebCore::RenderLayerCompositor::destroyRootLayer): Ditto.
(WebCore::RenderLayerCompositor::windowScreenDidChange): Tell the updater if we have one.
(WebCore::RenderLayerCompositor::scrollingCoordinator): Use helper to get to Page.
(WebCore::RenderLayerCompositor::graphicsLayerFactory): Use helper to get to Page.
(WebCore::RenderLayerCompositor::page): The helper.
* rendering/RenderLayerCompositor.h:
(RenderLayerCompositor): Add OVERRIDE to all the client overrides.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131680 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Conflicts:

Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/rendering/RenderLayerBacking.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h

Change-Id: I20fc4acdb2eb8ced842d039ef79251af617b4088
14 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/GNUmakefile.list.am
Source/WebCore/PlatformBlackBerry.cmake
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/dom/Document.cpp
Source/WebCore/platform/graphics/GraphicsLayerClient.h
Source/WebCore/platform/graphics/GraphicsLayerUpdater.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/GraphicsLayerUpdater.h [new file with mode: 0644]
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerBacking.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h