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

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: 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 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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 class PageScaleImplSidePaintingPerfTest 331 class PageScaleImplSidePaintingPerfTest
332 : public LayerTreeHostPerfTestJsonReader { 332 : public LayerTreeHostPerfTestJsonReader {
333 public: 333 public:
334 PageScaleImplSidePaintingPerfTest() 334 PageScaleImplSidePaintingPerfTest()
335 : max_scale_(16.f), min_scale_(1.f / max_scale_) {} 335 : max_scale_(16.f), min_scale_(1.f / max_scale_) {}
336 336
337 virtual void SetupTree() OVERRIDE { 337 virtual void SetupTree() OVERRIDE {
338 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, min_scale_, max_scale_); 338 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, min_scale_, max_scale_);
339 } 339 }
340 340
341 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta, 341 virtual void ApplyScrollAndScale(const gfx::Vector2d& scroll_delta,
342 float scale_delta) OVERRIDE { 342 float scale_delta) OVERRIDE {
343 float page_scale_factor = layer_tree_host()->page_scale_factor(); 343 float page_scale_factor = layer_tree_host()->page_scale_factor();
344 page_scale_factor *= scale_delta; 344 page_scale_factor *= scale_delta;
345 layer_tree_host()->SetPageScaleFactorAndLimits( 345 layer_tree_host()->SetPageScaleFactorAndLimits(
346 page_scale_factor, min_scale_, max_scale_); 346 page_scale_factor, min_scale_, max_scale_);
347 } 347 }
348 348
349 virtual void AnimateLayers(LayerTreeHostImpl* host_impl, 349 virtual void AnimateLayers(LayerTreeHostImpl* host_impl,
350 base::TimeTicks monotonic_time) OVERRIDE { 350 base::TimeTicks monotonic_time) OVERRIDE {
351 if (!host_impl->pinch_gesture_active()) { 351 if (!host_impl->pinch_gesture_active()) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 388
389 TEST_F(PageScaleImplSidePaintingPerfTest, HeavyPage) { 389 TEST_F(PageScaleImplSidePaintingPerfTest, HeavyPage) {
390 measure_commit_cost_ = true; 390 measure_commit_cost_ = true;
391 SetTestName("heavy_page_page_scale"); 391 SetTestName("heavy_page_page_scale");
392 ReadTestFile("heavy_layer_tree"); 392 ReadTestFile("heavy_layer_tree");
393 RunTestWithImplSidePainting(); 393 RunTestWithImplSidePainting();
394 } 394 }
395 395
396 } // namespace 396 } // namespace
397 } // namespace cc 397 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698