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

Unified Diff: third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp

Issue 1950243005: Communicate MT changes to impl-only scroll offset animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: attempt to fix rebase issue Created 4 years, 7 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
Index: third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp
index 41858117597c83e260d30c92e1c10d6dba15207d..70fa7f9c8fcd895a82bf3e86de76840c8ddab77a 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp
@@ -6,6 +6,7 @@
#include "cc/animation/scroll_offset_animation_curve.h"
#include "platform/RuntimeEnabledFeatures.h"
+#include "platform/animation/CompositorAnimationHost.h"
#include "platform/animation/CompositorAnimationPlayer.h"
#include "platform/animation/CompositorAnimationTimeline.h"
#include "platform/graphics/CompositorFactory.h"
@@ -47,6 +48,9 @@ void ScrollAnimatorCompositorCoordinator::resetAnimationState()
bool ScrollAnimatorCompositorCoordinator::hasAnimationThatRequiresService() const
{
+ if (!m_implOnlyAnimationAdjustment.isZero())
+ return true;
+
switch (m_runState) {
case RunState::Idle:
case RunState::RunningOnCompositor:
@@ -238,6 +242,33 @@ FloatPoint ScrollAnimatorCompositorCoordinator::blinkOffsetFromCompositorOffset(
return offset;
}
+void ScrollAnimatorCompositorCoordinator::updateCompositorAnimations()
+{
+ if (!getScrollableArea()->scrollAnimatorEnabled() || m_implOnlyAnimationAdjustment.isZero())
+ return;
+
+ GraphicsLayer* layer = getScrollableArea()->layerForScrolling();
+ CompositorAnimationTimeline* timeline = getScrollableArea()->compositorAnimationTimeline();
+ if (layer && timeline && !timeline->compositorAnimationHost().isNull()) {
+ CompositorAnimationHost host = timeline->compositorAnimationHost();
+ host.updateImplOnlyScrollOffsetAnimation(
+ gfx::Vector2dF(m_implOnlyAnimationAdjustment.width(), m_implOnlyAnimationAdjustment.height()),
+ layer->platformLayer()->id());
+ }
+ m_implOnlyAnimationAdjustment = FloatSize();
+}
+
+void ScrollAnimatorCompositorCoordinator::updateImplOnlyScrollOffsetAnimation(
+ const FloatSize& adjustment)
+{
+ if (!getScrollableArea()->scrollAnimatorEnabled())
+ return;
+
+ m_implOnlyAnimationAdjustment.expand(adjustment.width(), adjustment.height());
+
+ getScrollableArea()->registerForAnimation();
+}
+
String ScrollAnimatorCompositorCoordinator::runStateAsText() const
{
switch (m_runState) {

Powered by Google App Engine
This is Rietveld 408576698