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

Side by Side Diff: cc/trees/layer_tree_host_unittest_animation.cc

Issue 800613009: Convert scroll offsets to use SyncedProperty. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Android WebView tests Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_scroll.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include "cc/animation/animation_curve.h" 7 #include "cc/animation/animation_curve.h"
8 #include "cc/animation/layer_animation_controller.h" 8 #include "cc/animation/layer_animation_controller.h"
9 #include "cc/animation/scroll_offset_animation_curve.h" 9 #include "cc/animation/scroll_offset_animation_curve.h"
10 #include "cc/animation/timing_function.h" 10 #include "cc/animation/timing_function.h"
(...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 scroll_layer_impl->layer_animation_controller()->GetAnimation( 1082 scroll_layer_impl->layer_animation_controller()->GetAnimation(
1083 Animation::ScrollOffset); 1083 Animation::ScrollOffset);
1084 1084
1085 if (!animation || animation->run_state() != Animation::Running) { 1085 if (!animation || animation->run_state() != Animation::Running) {
1086 host_impl->BlockNotifyReadyToActivateForTesting(false); 1086 host_impl->BlockNotifyReadyToActivateForTesting(false);
1087 return; 1087 return;
1088 } 1088 }
1089 1089
1090 // Block activation until the running animation has a chance to produce a 1090 // Block activation until the running animation has a chance to produce a
1091 // scroll delta. 1091 // scroll delta.
1092 gfx::Vector2dF scroll_delta = scroll_layer_impl->ScrollDelta() - 1092 gfx::Vector2dF scroll_delta = scroll_layer_impl->ScrollDelta();
1093 scroll_layer_impl->sent_scroll_delta();
1094 if (scroll_delta.x() < 1.f || scroll_delta.y() < 1.f) 1093 if (scroll_delta.x() < 1.f || scroll_delta.y() < 1.f)
1095 return; 1094 return;
1096 1095
1097 host_impl->BlockNotifyReadyToActivateForTesting(false); 1096 host_impl->BlockNotifyReadyToActivateForTesting(false);
1098 } 1097 }
1099 1098
1100 void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { 1099 void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
1101 LayerImpl* scroll_layer_impl = 1100 LayerImpl* scroll_layer_impl =
1102 host_impl->active_tree()->root_layer()->children()[0]; 1101 host_impl->active_tree()->root_layer()->children()[0];
1103 if (scroll_layer_impl->layer_animation_controller()->GetAnimation( 1102 if (scroll_layer_impl->layer_animation_controller()->GetAnimation(
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 private: 1264 private:
1266 scoped_refptr<Layer> content_; 1265 scoped_refptr<Layer> content_;
1267 int num_swap_buffers_; 1266 int num_swap_buffers_;
1268 }; 1267 };
1269 1268
1270 SINGLE_AND_MULTI_THREAD_TEST_F( 1269 SINGLE_AND_MULTI_THREAD_TEST_F(
1271 LayerTreeHostAnimationTestAddAnimationAfterAnimating); 1270 LayerTreeHostAnimationTestAddAnimationAfterAnimating);
1272 1271
1273 } // namespace 1272 } // namespace
1274 } // namespace cc 1273 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_scroll.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698