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

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

Issue 132163009: [#6]Pass gfx structs by const ref (gfx::Vector2d) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 } 1135 }
1136 1136
1137 scroll_layer_->SetScrollable(true); 1137 scroll_layer_->SetScrollable(true);
1138 scroll_layer_->SetScrollOffset(gfx::Vector2d()); 1138 scroll_layer_->SetScrollOffset(gfx::Vector2d());
1139 layer_tree_host()->root_layer()->AddChild(scroll_layer_); 1139 layer_tree_host()->root_layer()->AddChild(scroll_layer_);
1140 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.5f, 2.f); 1140 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.5f, 2.f);
1141 } 1141 }
1142 1142
1143 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } 1143 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
1144 1144
1145 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta, 1145 virtual void ApplyScrollAndScale(const gfx::Vector2d& scroll_delta,
1146 float scale) OVERRIDE { 1146 float scale) OVERRIDE {
1147 gfx::Vector2d offset = scroll_layer_->scroll_offset(); 1147 gfx::Vector2d offset = scroll_layer_->scroll_offset();
1148 scroll_layer_->SetScrollOffset(offset + scroll_delta); 1148 scroll_layer_->SetScrollOffset(offset + scroll_delta);
1149 layer_tree_host()->SetPageScaleFactorAndLimits(scale, 0.5f, 2.f); 1149 layer_tree_host()->SetPageScaleFactorAndLimits(scale, 0.5f, 2.f);
1150 } 1150 }
1151 1151
1152 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE { 1152 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
1153 // We get one commit before the first draw, and the animation doesn't happen 1153 // We get one commit before the first draw, and the animation doesn't happen
1154 // until the second draw. 1154 // until the second draw.
1155 switch (impl->active_tree()->source_frame_number()) { 1155 switch (impl->active_tree()->source_frame_number()) {
(...skipping 3791 matching lines...) Expand 10 before | Expand all | Expand 10 after
4947 4947
4948 EndTest(); 4948 EndTest();
4949 } 4949 }
4950 4950
4951 virtual void AfterTest() OVERRIDE {} 4951 virtual void AfterTest() OVERRIDE {}
4952 }; 4952 };
4953 4953
4954 MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor); 4954 MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor);
4955 4955
4956 } // namespace cc 4956 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698