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

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: rebase on TOT Created 6 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_perftest.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 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 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1151 layer_tree_host()->root_layer()->AddChild(scroll_layer_); 1151 layer_tree_host()->root_layer()->AddChild(scroll_layer_);
1152 // This test requires the page_scale and inner viewport layers to be 1152 // This test requires the page_scale and inner viewport layers to be
1153 // identified. 1153 // identified.
1154 layer_tree_host()->RegisterViewportLayers( 1154 layer_tree_host()->RegisterViewportLayers(
1155 root_layer, scroll_layer_.get(), NULL); 1155 root_layer, scroll_layer_.get(), NULL);
1156 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.5f, 2.f); 1156 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.5f, 2.f);
1157 } 1157 }
1158 1158
1159 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } 1159 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
1160 1160
1161 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta, 1161 virtual void ApplyScrollAndScale(const gfx::Vector2d& scroll_delta,
1162 float scale) OVERRIDE { 1162 float scale) OVERRIDE {
1163 gfx::Vector2d offset = scroll_layer_->scroll_offset(); 1163 gfx::Vector2d offset = scroll_layer_->scroll_offset();
1164 scroll_layer_->SetScrollOffset(offset + scroll_delta); 1164 scroll_layer_->SetScrollOffset(offset + scroll_delta);
1165 layer_tree_host()->SetPageScaleFactorAndLimits(scale, 0.5f, 2.f); 1165 layer_tree_host()->SetPageScaleFactorAndLimits(scale, 0.5f, 2.f);
1166 } 1166 }
1167 1167
1168 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE { 1168 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
1169 // We get one commit before the first draw, and the animation doesn't happen 1169 // We get one commit before the first draw, and the animation doesn't happen
1170 // until the second draw. 1170 // until the second draw.
1171 switch (impl->active_tree()->source_frame_number()) { 1171 switch (impl->active_tree()->source_frame_number()) {
(...skipping 3793 matching lines...) Expand 10 before | Expand all | Expand 10 after
4965 4965
4966 EndTest(); 4966 EndTest();
4967 } 4967 }
4968 4968
4969 virtual void AfterTest() OVERRIDE {} 4969 virtual void AfterTest() OVERRIDE {}
4970 }; 4970 };
4971 4971
4972 MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor); 4972 MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor);
4973 4973
4974 } // namespace cc 4974 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_perftest.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