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

Unified Diff: cc/animation/scroll_offset_animations.cc

Issue 1950243005: Communicate MT changes to impl-only scroll offset animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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: cc/animation/scroll_offset_animations.cc
diff --git a/cc/animation/scroll_offset_animations.cc b/cc/animation/scroll_offset_animations.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f29d8291b07533984693d1e73cf4a89c829ab6a7
--- /dev/null
+++ b/cc/animation/scroll_offset_animations.cc
@@ -0,0 +1,42 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/animation/scroll_offset_animations.h"
+
+namespace cc {
+
+ScrollOffsetAnimationUpdate::ScrollOffsetAnimationUpdate() {}
+
+ScrollOffsetAnimations::ScrollOffsetAnimations() {}
+
+ScrollOffsetAnimations::~ScrollOffsetAnimations() {}
+
+void ScrollOffsetAnimations::AddUpdate(ScrollOffsetAnimationUpdate update) {
+ queue_.push_back(update);
+}
+
+bool ScrollOffsetAnimations::HasUpdates() const {
+ return !queue_.empty();
+}
+
+void ScrollOffsetAnimations::PushPropertiesTo(
+ ScrollOffsetAnimationsImpl* animations,
+ base::TimeTicks frame_monotonic_time) {
+ if (!animations)
+ return;
+ if (queue_.empty())
+ return;
+
+ for (auto& update : queue_) {
+ switch (update.type_) {
+ case ScrollOffsetAnimationUpdate::Type::SCROLL_OFFSET_CHANGED: {
+ animations->ScrollAnimationApplyAdjustment(
+ update.element_id_, update.adjustment_, frame_monotonic_time);
+ }
+ }
+ }
+ queue_.clear();
+}
+
+} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698