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

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

Issue 23983047: Pinch/Zoom Infrastructure & Plumbing CL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to r248052. 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 | Annotate | Revision Log
« 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 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 BuildTree() OVERRIDE {
342 LayerTreeHostPerfTestJsonReader::BuildTree();
343
344 // TODO(wjmaclean) The JSON tree reader should be able to mark inner/out
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.
347 Layer* root = layer_tree_host()->root_layer();
348 Layer* clip_layer = root->children()[0];
349 Layer* inner_viewport_scroll_layer = clip_layer->children()[0];
350 inner_viewport_scroll_layer->SetScrollClipLayerId(root->id());
351 inner_viewport_scroll_layer->SetIsContainerForFixedPositionLayers(true);
352 layer_tree_host()->RegisterViewportLayers(
353 root, inner_viewport_scroll_layer, 0);
354 }
355
341 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta, 356 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta,
342 float scale_delta) OVERRIDE { 357 float scale_delta) OVERRIDE {
343 float page_scale_factor = layer_tree_host()->page_scale_factor(); 358 float page_scale_factor = layer_tree_host()->page_scale_factor();
344 page_scale_factor *= scale_delta; 359 page_scale_factor *= scale_delta;
345 layer_tree_host()->SetPageScaleFactorAndLimits( 360 layer_tree_host()->SetPageScaleFactorAndLimits(
346 page_scale_factor, min_scale_, max_scale_); 361 page_scale_factor, min_scale_, max_scale_);
347 } 362 }
348 363
349 virtual void AnimateLayers(LayerTreeHostImpl* host_impl, 364 virtual void AnimateLayers(LayerTreeHostImpl* host_impl,
350 base::TimeTicks monotonic_time) OVERRIDE { 365 base::TimeTicks monotonic_time) OVERRIDE {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 403
389 TEST_F(PageScaleImplSidePaintingPerfTest, HeavyPage) { 404 TEST_F(PageScaleImplSidePaintingPerfTest, HeavyPage) {
390 measure_commit_cost_ = true; 405 measure_commit_cost_ = true;
391 SetTestName("heavy_page_page_scale"); 406 SetTestName("heavy_page_page_scale");
392 ReadTestFile("heavy_layer_tree"); 407 ReadTestFile("heavy_layer_tree");
393 RunTestWithImplSidePainting(); 408 RunTestWithImplSidePainting();
394 } 409 }
395 410
396 } // namespace 411 } // namespace
397 } // namespace cc 412 } // 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