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

Unified Diff: third_party/WebKit/Source/web/WebFrameWidgetImpl.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
Index: third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
index d220f3afbe2aaded5a94cbb4ceb7523e96c46769..d5d03a1a138898d2cb06eb6e961eeb067fbe3151 100644
--- a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
+++ b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
@@ -52,6 +52,7 @@
#include "core/page/PointerLockController.h"
#include "platform/KeyboardCodes.h"
#include "platform/WebFrameScheduler.h"
+#include "platform/animation/CompositorAnimationHost.h"
#include "platform/graphics/CompositorMutatorClient.h"
#include "public/web/WebAutofillClient.h"
#include "public/web/WebPlugin.h"
@@ -152,6 +153,7 @@ void WebFrameWidgetImpl::close() {
m_layerTreeView = nullptr;
m_rootLayer = nullptr;
m_rootGraphicsLayer = nullptr;
+ m_compositorAnimationHost = nullptr;
m_selfKeepAlive.clear();
}
@@ -684,6 +686,7 @@ void WebFrameWidgetImpl::willCloseLayerTreeView() {
setIsAcceleratedCompositingActive(false);
m_mutator = nullptr;
m_layerTreeView = nullptr;
+ m_compositorAnimationHost = nullptr;
m_layerTreeViewClosed = true;
}
@@ -1002,6 +1005,10 @@ void WebFrameWidgetImpl::initializeLayerTreeView() {
DCHECK(!m_mutator);
m_client->initializeLayerTreeView();
m_layerTreeView = m_client->layerTreeView();
+ if (m_layerTreeView && m_layerTreeView->compositorAnimationHost()) {
+ m_compositorAnimationHost = WTF::makeUnique<CompositorAnimationHost>(
+ m_layerTreeView->compositorAnimationHost());
+ }
}
if (WebDevToolsAgentImpl* devTools = m_localRoot->devToolsAgentImpl())
@@ -1087,16 +1094,14 @@ void WebFrameWidgetImpl::setRootLayer(WebLayer* layer) {
void WebFrameWidgetImpl::attachCompositorAnimationTimeline(
CompositorAnimationTimeline* compositorTimeline) {
- if (m_layerTreeView)
- m_layerTreeView->attachCompositorAnimationTimeline(
- compositorTimeline->animationTimeline());
+ if (m_compositorAnimationHost)
+ m_compositorAnimationHost->addTimeline(*compositorTimeline);
}
void WebFrameWidgetImpl::detachCompositorAnimationTimeline(
CompositorAnimationTimeline* compositorTimeline) {
- if (m_layerTreeView)
- m_layerTreeView->detachCompositorAnimationTimeline(
- compositorTimeline->animationTimeline());
+ if (m_compositorAnimationHost)
+ m_compositorAnimationHost->removeTimeline(*compositorTimeline);
}
HitTestResult WebFrameWidgetImpl::coreHitTestResultAt(
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.h ('k') | third_party/WebKit/Source/web/WebPagePopupImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698