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

Side by Side Diff: cc/trees/layer_tree_host_perftest.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_impl_unittest.cc ('k') | cc/trees/layer_tree_host_unittest.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 <sstream> 7 #include <sstream>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 // viewport scroll layers as part of its tree setup. The code below is 345 // viewport scroll layers as part of its tree setup. The code below is
346 // matched to the tree specified in the data file heavy_layer_tree. 346 // matched to the tree specified in the data file heavy_layer_tree.
347 Layer* root = layer_tree_host()->root_layer(); 347 Layer* root = layer_tree_host()->root_layer();
348 Layer* clip_layer = root->children()[0]; 348 Layer* clip_layer = root->children()[0];
349 Layer* inner_viewport_scroll_layer = clip_layer->children()[0]; 349 Layer* inner_viewport_scroll_layer = clip_layer->children()[0];
350 inner_viewport_scroll_layer->SetScrollClipLayerId(root->id()); 350 inner_viewport_scroll_layer->SetScrollClipLayerId(root->id());
351 inner_viewport_scroll_layer->SetIsContainerForFixedPositionLayers(true); 351 inner_viewport_scroll_layer->SetIsContainerForFixedPositionLayers(true);
352 layer_tree_host()->RegisterViewportLayers( 352 layer_tree_host()->RegisterViewportLayers(
353 root, inner_viewport_scroll_layer, 0); 353 root, inner_viewport_scroll_layer, 0);
354 } 354 }
355 355 virtual void ApplyScrollAndScale(const gfx::Vector2d& scroll_delta,
356 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta,
357 float scale_delta) OVERRIDE { 356 float scale_delta) OVERRIDE {
358 float page_scale_factor = layer_tree_host()->page_scale_factor(); 357 float page_scale_factor = layer_tree_host()->page_scale_factor();
359 page_scale_factor *= scale_delta; 358 page_scale_factor *= scale_delta;
360 layer_tree_host()->SetPageScaleFactorAndLimits( 359 layer_tree_host()->SetPageScaleFactorAndLimits(
361 page_scale_factor, min_scale_, max_scale_); 360 page_scale_factor, min_scale_, max_scale_);
362 } 361 }
363 362
364 virtual void AnimateLayers(LayerTreeHostImpl* host_impl, 363 virtual void AnimateLayers(LayerTreeHostImpl* host_impl,
365 base::TimeTicks monotonic_time) OVERRIDE { 364 base::TimeTicks monotonic_time) OVERRIDE {
366 if (!host_impl->pinch_gesture_active()) { 365 if (!host_impl->pinch_gesture_active()) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 402
404 TEST_F(PageScaleImplSidePaintingPerfTest, HeavyPage) { 403 TEST_F(PageScaleImplSidePaintingPerfTest, HeavyPage) {
405 measure_commit_cost_ = true; 404 measure_commit_cost_ = true;
406 SetTestName("heavy_page_page_scale"); 405 SetTestName("heavy_page_page_scale");
407 ReadTestFile("heavy_layer_tree"); 406 ReadTestFile("heavy_layer_tree");
408 RunTestWithImplSidePainting(); 407 RunTestWithImplSidePainting();
409 } 408 }
410 409
411 } // namespace 410 } // namespace
412 } // namespace cc 411 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698