Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2559273003: Blink Compositor Animation: Introduce CompositorAnimationHost correctly. (Closed)
Patch Set: Allocate on stack in unit tests. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | third_party/WebKit/public/platform/WebLayerTreeView.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index c9d70cd9d7880368d10f7bdd97588d218000e8b9..a99121662e9db71c0b04b9bccffd3ae970b55855 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -101,6 +101,7 @@
#include "platform/PlatformMouseEvent.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/UserGestureIndicator.h"
+#include "platform/animation/CompositorAnimationHost.h"
#include "platform/exported/WebActiveGestureAnimation.h"
#include "platform/fonts/FontCache.h"
#include "platform/geometry/FloatRect.h"
@@ -2529,6 +2530,7 @@ void WebViewImpl::willCloseLayerTreeView() {
page()->willCloseLayerTreeView(*m_layerTreeView);
setRootLayer(nullptr);
+ m_compositorAnimationHost = nullptr;
m_mutator = nullptr;
m_layerTreeView = nullptr;
@@ -3947,22 +3949,24 @@ void WebViewImpl::scheduleAnimationForWidget() {
void WebViewImpl::attachCompositorAnimationTimeline(
CompositorAnimationTimeline* timeline) {
- if (m_layerTreeView)
- m_layerTreeView->attachCompositorAnimationTimeline(
- timeline->animationTimeline());
+ if (m_compositorAnimationHost)
+ m_compositorAnimationHost->addTimeline(*timeline);
}
void WebViewImpl::detachCompositorAnimationTimeline(
CompositorAnimationTimeline* timeline) {
- if (m_layerTreeView)
- m_layerTreeView->detachCompositorAnimationTimeline(
- timeline->animationTimeline());
+ if (m_compositorAnimationHost)
+ m_compositorAnimationHost->removeTimeline(*timeline);
}
void WebViewImpl::initializeLayerTreeView() {
if (m_client) {
m_client->initializeLayerTreeView();
m_layerTreeView = m_client->widgetClient()->layerTreeView();
+ if (m_layerTreeView && m_layerTreeView->compositorAnimationHost()) {
+ m_compositorAnimationHost = WTF::makeUnique<CompositorAnimationHost>(
+ m_layerTreeView->compositorAnimationHost());
+ }
}
if (WebDevToolsAgentImpl* devTools = mainFrameDevToolsAgentImpl())
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | third_party/WebKit/public/platform/WebLayerTreeView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698