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

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

Issue 2349713002: [cc] Remove unused parameter to DidUpdateScrollOffset (Closed)
Patch Set: address reviewer comments. Created 4 years, 3 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
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 host_impl_->PrepareToDraw(&frame_data); 479 host_impl_->PrepareToDraw(&frame_data);
480 host_impl_->DidDrawAllLayers(frame_data); 480 host_impl_->DidDrawAllLayers(frame_data);
481 } 481 }
482 482
483 static void SetScrollOffsetDelta(LayerImpl* layer_impl, 483 static void SetScrollOffsetDelta(LayerImpl* layer_impl,
484 const gfx::Vector2dF& delta) { 484 const gfx::Vector2dF& delta) {
485 if (layer_impl->layer_tree_impl() 485 if (layer_impl->layer_tree_impl()
486 ->property_trees() 486 ->property_trees()
487 ->scroll_tree.SetScrollOffsetDeltaForTesting(layer_impl->id(), 487 ->scroll_tree.SetScrollOffsetDeltaForTesting(layer_impl->id(),
488 delta)) 488 delta))
489 layer_impl->layer_tree_impl()->DidUpdateScrollOffset( 489 layer_impl->layer_tree_impl()->DidUpdateScrollOffset(layer_impl->id());
490 layer_impl->id(), layer_impl->transform_tree_index());
491 } 490 }
492 491
493 void BeginImplFrameAndAnimate(BeginFrameArgs begin_frame_args, 492 void BeginImplFrameAndAnimate(BeginFrameArgs begin_frame_args,
494 base::TimeTicks frame_time) { 493 base::TimeTicks frame_time) {
495 begin_frame_args.frame_time = frame_time; 494 begin_frame_args.frame_time = frame_time;
496 host_impl_->WillBeginImplFrame(begin_frame_args); 495 host_impl_->WillBeginImplFrame(begin_frame_args);
497 host_impl_->Animate(); 496 host_impl_->Animate();
498 host_impl_->UpdateAnimationState(true); 497 host_impl_->UpdateAnimationState(true);
499 host_impl_->DidFinishImplFrame(); 498 host_impl_->DidFinishImplFrame();
500 } 499 }
(...skipping 2371 matching lines...) Expand 10 before | Expand all | Expand 10 after
2872 } 2871 }
2873 2872
2874 // Setting the scroll offset outside a scroll should also cause the 2873 // Setting the scroll offset outside a scroll should also cause the
2875 // scrollbar to appear and to schedule a scrollbar animation. 2874 // scrollbar to appear and to schedule a scrollbar animation.
2876 if (host_impl_->active_tree() 2875 if (host_impl_->active_tree()
2877 ->property_trees() 2876 ->property_trees()
2878 ->scroll_tree.UpdateScrollOffsetBaseForTesting( 2877 ->scroll_tree.UpdateScrollOffsetBaseForTesting(
2879 host_impl_->InnerViewportScrollLayer()->id(), 2878 host_impl_->InnerViewportScrollLayer()->id(),
2880 gfx::ScrollOffset(5, 5))) 2879 gfx::ScrollOffset(5, 5)))
2881 host_impl_->active_tree()->DidUpdateScrollOffset( 2880 host_impl_->active_tree()->DidUpdateScrollOffset(
2882 host_impl_->InnerViewportScrollLayer()->id(), 2881 host_impl_->InnerViewportScrollLayer()->id());
2883 host_impl_->InnerViewportScrollLayer()->transform_tree_index());
2884 EXPECT_FALSE(did_request_next_frame_); 2882 EXPECT_FALSE(did_request_next_frame_);
2885 EXPECT_FALSE(did_request_redraw_); 2883 EXPECT_FALSE(did_request_redraw_);
2886 if (expecting_animations) { 2884 if (expecting_animations) {
2887 EXPECT_EQ(base::TimeDelta::FromMilliseconds(20), 2885 EXPECT_EQ(base::TimeDelta::FromMilliseconds(20),
2888 requested_animation_delay_); 2886 requested_animation_delay_);
2889 EXPECT_FALSE(animation_task_.Equals(base::Closure())); 2887 EXPECT_FALSE(animation_task_.Equals(base::Closure()));
2890 requested_animation_delay_ = base::TimeDelta(); 2888 requested_animation_delay_ = base::TimeDelta();
2891 animation_task_ = base::Closure(); 2889 animation_task_ = base::Closure();
2892 } else { 2890 } else {
2893 EXPECT_EQ(base::TimeDelta(), requested_animation_delay_); 2891 EXPECT_EQ(base::TimeDelta(), requested_animation_delay_);
(...skipping 8364 matching lines...) Expand 10 before | Expand all | Expand 10 after
11258 EXPECT_TRUE(host_impl_->use_gpu_rasterization()); 11256 EXPECT_TRUE(host_impl_->use_gpu_rasterization());
11259 11257
11260 // Re-initialize with a software output surface. 11258 // Re-initialize with a software output surface.
11261 compositor_frame_sink_ = FakeCompositorFrameSink::CreateSoftware(); 11259 compositor_frame_sink_ = FakeCompositorFrameSink::CreateSoftware();
11262 host_impl_->InitializeRenderer(compositor_frame_sink_.get()); 11260 host_impl_->InitializeRenderer(compositor_frame_sink_.get());
11263 EXPECT_FALSE(host_impl_->use_gpu_rasterization()); 11261 EXPECT_FALSE(host_impl_->use_gpu_rasterization());
11264 } 11262 }
11265 11263
11266 } // namespace 11264 } // namespace
11267 } // namespace cc 11265 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_common_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