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

Side by Side Diff: cc/layers/picture_layer_impl_perftest.cc

Issue 584503005: Make scroll offset type of float in cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: link crbug to TODO Created 6 years, 2 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/layers/layer_unittest.cc ('k') | cc/layers/scrollbar_layer_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/layers/picture_layer_impl.h" 5 #include "cc/layers/picture_layer_impl.h"
6 6
7 #include "cc/debug/lap_timer.h" 7 #include "cc/debug/lap_timer.h"
8 #include "cc/test/fake_impl_proxy.h" 8 #include "cc/test/fake_impl_proxy.h"
9 #include "cc/test/fake_layer_tree_host_impl.h" 9 #include "cc/test/fake_layer_tree_host_impl.h"
10 #include "cc/test/fake_output_surface.h" 10 #include "cc/test/fake_output_surface.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 "", 90 "",
91 test_name, 91 test_name,
92 timer_.LapsPerSecond(), 92 timer_.LapsPerSecond(),
93 "runs/s", 93 "runs/s",
94 true); 94 true);
95 } 95 }
96 96
97 void RunRasterIteratorConstructTest(const std::string& test_name, 97 void RunRasterIteratorConstructTest(const std::string& test_name,
98 const gfx::Rect& viewport) { 98 const gfx::Rect& viewport) {
99 host_impl_.SetViewportSize(viewport.size()); 99 host_impl_.SetViewportSize(viewport.size());
100 pending_layer_->SetScrollOffset(gfx::Vector2d(viewport.x(), viewport.y())); 100 pending_layer_->SetScrollOffset(
101 gfx::ScrollOffset(viewport.x(), viewport.y()));
101 host_impl_.pending_tree()->UpdateDrawProperties(); 102 host_impl_.pending_tree()->UpdateDrawProperties();
102 103
103 timer_.Reset(); 104 timer_.Reset();
104 do { 105 do {
105 PictureLayerImpl::LayerRasterTileIterator it(pending_layer_, false); 106 PictureLayerImpl::LayerRasterTileIterator it(pending_layer_, false);
106 timer_.NextLap(); 107 timer_.NextLap();
107 } while (!timer_.HasTimeLimitExpired()); 108 } while (!timer_.HasTimeLimitExpired());
108 109
109 perf_test::PrintResult("layer_raster_tile_iterator_construct", 110 perf_test::PrintResult("layer_raster_tile_iterator_construct",
110 "", 111 "",
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 "", 144 "",
144 test_name, 145 test_name,
145 timer_.LapsPerSecond(), 146 timer_.LapsPerSecond(),
146 "runs/s", 147 "runs/s",
147 true); 148 true);
148 } 149 }
149 150
150 void RunEvictionIteratorConstructTest(const std::string& test_name, 151 void RunEvictionIteratorConstructTest(const std::string& test_name,
151 const gfx::Rect& viewport) { 152 const gfx::Rect& viewport) {
152 host_impl_.SetViewportSize(viewport.size()); 153 host_impl_.SetViewportSize(viewport.size());
153 pending_layer_->SetScrollOffset(gfx::Vector2d(viewport.x(), viewport.y())); 154 pending_layer_->SetScrollOffset(
155 gfx::ScrollOffset(viewport.x(), viewport.y()));
154 host_impl_.pending_tree()->UpdateDrawProperties(); 156 host_impl_.pending_tree()->UpdateDrawProperties();
155 157
156 TreePriority priorities[] = {SAME_PRIORITY_FOR_BOTH_TREES, 158 TreePriority priorities[] = {SAME_PRIORITY_FOR_BOTH_TREES,
157 SMOOTHNESS_TAKES_PRIORITY, 159 SMOOTHNESS_TAKES_PRIORITY,
158 NEW_CONTENT_TAKES_PRIORITY}; 160 NEW_CONTENT_TAKES_PRIORITY};
159 int priority_count = 0; 161 int priority_count = 0;
160 timer_.Reset(); 162 timer_.Reset();
161 do { 163 do {
162 PictureLayerImpl::LayerEvictionTileIterator it( 164 PictureLayerImpl::LayerEvictionTileIterator it(
163 pending_layer_, priorities[priority_count]); 165 pending_layer_, priorities[priority_count]);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 267
266 RunEvictionIteratorConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100)); 268 RunEvictionIteratorConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100));
267 RunEvictionIteratorConstructTest("5000_0_100x100", 269 RunEvictionIteratorConstructTest("5000_0_100x100",
268 gfx::Rect(5000, 0, 100, 100)); 270 gfx::Rect(5000, 0, 100, 100));
269 RunEvictionIteratorConstructTest("9999_0_100x100", 271 RunEvictionIteratorConstructTest("9999_0_100x100",
270 gfx::Rect(9999, 0, 100, 100)); 272 gfx::Rect(9999, 0, 100, 100));
271 } 273 }
272 274
273 } // namespace 275 } // namespace
274 } // namespace cc 276 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_unittest.cc ('k') | cc/layers/scrollbar_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698