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

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

Issue 584503005: Make scroll offset type of float in cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: link crbug to TODO Created 6 years, 2 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_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_damage.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 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after
1022 : public LayerTreeHostAnimationTest { 1022 : public LayerTreeHostAnimationTest {
1023 public: 1023 public:
1024 LayerTreeHostAnimationTestScrollOffsetChangesArePropagated() {} 1024 LayerTreeHostAnimationTestScrollOffsetChangesArePropagated() {}
1025 1025
1026 virtual void SetupTree() OVERRIDE { 1026 virtual void SetupTree() OVERRIDE {
1027 LayerTreeHostAnimationTest::SetupTree(); 1027 LayerTreeHostAnimationTest::SetupTree();
1028 1028
1029 scroll_layer_ = FakeContentLayer::Create(&client_); 1029 scroll_layer_ = FakeContentLayer::Create(&client_);
1030 scroll_layer_->SetScrollClipLayerId(layer_tree_host()->root_layer()->id()); 1030 scroll_layer_->SetScrollClipLayerId(layer_tree_host()->root_layer()->id());
1031 scroll_layer_->SetBounds(gfx::Size(1000, 1000)); 1031 scroll_layer_->SetBounds(gfx::Size(1000, 1000));
1032 scroll_layer_->SetScrollOffset(gfx::Vector2d(10, 20)); 1032 scroll_layer_->SetScrollOffset(gfx::ScrollOffset(10, 20));
1033 layer_tree_host()->root_layer()->AddChild(scroll_layer_); 1033 layer_tree_host()->root_layer()->AddChild(scroll_layer_);
1034 } 1034 }
1035 1035
1036 virtual void BeginTest() OVERRIDE { 1036 virtual void BeginTest() OVERRIDE {
1037 PostSetNeedsCommitToMainThread(); 1037 PostSetNeedsCommitToMainThread();
1038 } 1038 }
1039 1039
1040 virtual void DidCommit() OVERRIDE { 1040 virtual void DidCommit() OVERRIDE {
1041 switch (layer_tree_host()->source_frame_number()) { 1041 switch (layer_tree_host()->source_frame_number()) {
1042 case 1: { 1042 case 1: {
1043 scoped_ptr<ScrollOffsetAnimationCurve> curve( 1043 scoped_ptr<ScrollOffsetAnimationCurve> curve(
1044 ScrollOffsetAnimationCurve::Create( 1044 ScrollOffsetAnimationCurve::Create(
1045 gfx::Vector2dF(500.f, 550.f), 1045 gfx::ScrollOffset(500.f, 550.f),
1046 EaseInOutTimingFunction::Create())); 1046 EaseInOutTimingFunction::Create()));
1047 scoped_ptr<Animation> animation( 1047 scoped_ptr<Animation> animation(
1048 Animation::Create(curve.Pass(), 1, 0, Animation::ScrollOffset)); 1048 Animation::Create(curve.Pass(), 1, 0, Animation::ScrollOffset));
1049 animation->set_needs_synchronized_start_time(true); 1049 animation->set_needs_synchronized_start_time(true);
1050 bool animation_added = scroll_layer_->AddAnimation(animation.Pass()); 1050 bool animation_added = scroll_layer_->AddAnimation(animation.Pass());
1051 bool impl_scrolling_supported = 1051 bool impl_scrolling_supported =
1052 layer_tree_host()->proxy()->SupportsImplScrolling(); 1052 layer_tree_host()->proxy()->SupportsImplScrolling();
1053 EXPECT_EQ(impl_scrolling_supported, animation_added); 1053 EXPECT_EQ(impl_scrolling_supported, animation_added);
1054 if (!impl_scrolling_supported) 1054 if (!impl_scrolling_supported)
1055 EndTest(); 1055 EndTest();
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
1284 private: 1284 private:
1285 scoped_refptr<Layer> content_; 1285 scoped_refptr<Layer> content_;
1286 int num_swap_buffers_; 1286 int num_swap_buffers_;
1287 }; 1287 };
1288 1288
1289 SINGLE_AND_MULTI_THREAD_TEST_F( 1289 SINGLE_AND_MULTI_THREAD_TEST_F(
1290 LayerTreeHostAnimationTestAddAnimationAfterAnimating); 1290 LayerTreeHostAnimationTestAddAnimationAfterAnimating);
1291 1291
1292 } // namespace 1292 } // namespace
1293 } // namespace cc 1293 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_damage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698