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

Unified Diff: Source/core/layout/compositing/DeprecatedPaintLayerCompositor.cpp

Issue 946323002: Animations: Introduce compositor AnimationPlayer and AnimationTimeline. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Format. Created 5 years, 9 months 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 | « Source/core/layout/compositing/DeprecatedPaintLayerCompositor.h ('k') | Source/core/page/ChromeClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/compositing/DeprecatedPaintLayerCompositor.cpp
diff --git a/Source/core/layout/compositing/DeprecatedPaintLayerCompositor.cpp b/Source/core/layout/compositing/DeprecatedPaintLayerCompositor.cpp
index 40d54d195235ad770ccf7cc918ac93e09bea87de..89ce0492592df9f1bb6956f9ecfcfd652fcdec43 100644
--- a/Source/core/layout/compositing/DeprecatedPaintLayerCompositor.cpp
+++ b/Source/core/layout/compositing/DeprecatedPaintLayerCompositor.cpp
@@ -27,6 +27,7 @@
#include "core/layout/compositing/DeprecatedPaintLayerCompositor.h"
+#include "core/animation/AnimationTimeline.h"
#include "core/animation/DocumentAnimations.h"
#include "core/dom/DOMNodeIds.h"
#include "core/dom/Fullscreen.h"
@@ -717,12 +718,14 @@ void DeprecatedPaintLayerCompositor::setIsInWindow(bool isInWindow)
return;
RootLayerAttachment attachment = m_layoutView.frame()->isLocalRoot() ? RootLayerAttachedViaChromeClient : RootLayerAttachedViaEnclosingFrame;
+ attachCompositorTimeline();
attachRootLayer(attachment);
} else {
if (m_rootLayerAttachment == RootLayerUnattached)
return;
detachRootLayer();
+ detachCompositorTimeline();
}
}
@@ -1000,9 +1003,12 @@ void DeprecatedPaintLayerCompositor::ensureRootLayer()
}
// Check to see if we have to change the attachment
- if (m_rootLayerAttachment != RootLayerUnattached)
+ if (m_rootLayerAttachment != RootLayerUnattached) {
detachRootLayer();
+ detachCompositorTimeline();
+ }
+ attachCompositorTimeline();
attachRootLayer(expectedAttachment);
}
@@ -1114,6 +1120,30 @@ void DeprecatedPaintLayerCompositor::updateRootLayerAttachment()
ensureRootLayer();
}
+void DeprecatedPaintLayerCompositor::attachCompositorTimeline()
+{
+ LocalFrame& frame = m_layoutView.frameView()->frame();
+ Page* page = frame.page();
+ if (!page)
+ return;
+
+ WebCompositorAnimationTimeline* compositorTimeline = frame.document() ? frame.document()->timeline().compositorTimeline() : nullptr;
+ if (compositorTimeline)
+ page->chrome().client().attachCompositorAnimationTimeline(compositorTimeline, &frame);
+}
+
+void DeprecatedPaintLayerCompositor::detachCompositorTimeline()
+{
+ LocalFrame& frame = m_layoutView.frameView()->frame();
+ Page* page = frame.page();
+ if (!page)
+ return;
+
+ WebCompositorAnimationTimeline* compositorTimeline = frame.document() ? frame.document()->timeline().compositorTimeline() : nullptr;
+ if (compositorTimeline)
+ page->chrome().client().detachCompositorAnimationTimeline(compositorTimeline, &frame);
+}
+
ScrollingCoordinator* DeprecatedPaintLayerCompositor::scrollingCoordinator() const
{
if (Page* page = this->page())
« no previous file with comments | « Source/core/layout/compositing/DeprecatedPaintLayerCompositor.h ('k') | Source/core/page/ChromeClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698