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

Unified Diff: third_party/WebKit/Source/web/WebPagePopupImpl.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/WebPagePopupImpl.h ('k') | third_party/WebKit/Source/web/WebViewImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebPagePopupImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebPagePopupImpl.cpp b/third_party/WebKit/Source/web/WebPagePopupImpl.cpp
index dfb627750e88a6dcd620c7d8ba6f02651491c644..d2a8c4410f1709a7109f25c6d0ad94cbed97fcf7 100644
--- a/third_party/WebKit/Source/web/WebPagePopupImpl.cpp
+++ b/third_party/WebKit/Source/web/WebPagePopupImpl.cpp
@@ -51,6 +51,7 @@
#include "platform/EventDispatchForbiddenScope.h"
#include "platform/LayoutTestSupport.h"
#include "platform/ScriptForbiddenScope.h"
+#include "platform/animation/CompositorAnimationHost.h"
#include "platform/heap/Handle.h"
#include "platform/tracing/TraceEvent.h"
#include "public/platform/WebCompositeAndReadbackAsyncCallback.h"
@@ -137,16 +138,14 @@ class PagePopupChromeClient final : public EmptyChromeClient {
void attachCompositorAnimationTimeline(CompositorAnimationTimeline* timeline,
LocalFrame*) override {
- if (m_popup->m_layerTreeView)
- m_popup->m_layerTreeView->attachCompositorAnimationTimeline(
- timeline->animationTimeline());
+ if (m_popup->m_compositorAnimationHost)
+ m_popup->m_compositorAnimationHost->addTimeline(*timeline);
}
void detachCompositorAnimationTimeline(CompositorAnimationTimeline* timeline,
LocalFrame*) override {
- if (m_popup->m_layerTreeView)
- m_popup->m_layerTreeView->detachCompositorAnimationTimeline(
- timeline->animationTimeline());
+ if (m_popup->m_compositorAnimationHost)
+ m_popup->m_compositorAnimationHost->removeTimeline(*timeline);
}
WebScreenInfo screenInfo() const override {
@@ -388,9 +387,12 @@ void WebPagePopupImpl::setIsAcceleratedCompositingActive(bool enter) {
if (m_layerTreeView) {
m_layerTreeView->setVisible(true);
m_isAcceleratedCompositingActive = true;
+ m_compositorAnimationHost = WTF::makeUnique<CompositorAnimationHost>(
+ m_layerTreeView->compositorAnimationHost());
m_page->layerTreeViewInitialized(*m_layerTreeView);
} else {
m_isAcceleratedCompositingActive = false;
+ m_compositorAnimationHost = nullptr;
}
}
}
@@ -408,7 +410,8 @@ void WebPagePopupImpl::willCloseLayerTreeView() {
m_page->willCloseLayerTreeView(*m_layerTreeView);
setIsAcceleratedCompositingActive(false);
- m_layerTreeView = 0;
+ m_layerTreeView = nullptr;
+ m_compositorAnimationHost = nullptr;
}
void WebPagePopupImpl::updateAllLifecyclePhases() {
« no previous file with comments | « third_party/WebKit/Source/web/WebPagePopupImpl.h ('k') | third_party/WebKit/Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698