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

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: blow up the patchset :( 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
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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 "", 91 "",
92 test_name, 92 test_name,
93 timer_.LapsPerSecond(), 93 timer_.LapsPerSecond(),
94 "runs/s", 94 "runs/s",
95 true); 95 true);
96 } 96 }
97 97
98 void RunRasterIteratorConstructTest(const std::string& test_name, 98 void RunRasterIteratorConstructTest(const std::string& test_name,
99 const gfx::Rect& viewport) { 99 const gfx::Rect& viewport) {
100 host_impl_.SetViewportSize(viewport.size()); 100 host_impl_.SetViewportSize(viewport.size());
101 pending_layer_->SetScrollOffset(gfx::Vector2d(viewport.x(), viewport.y())); 101 pending_layer_->SetScrollOffset(
102 gfx::ScrollOffset(viewport.x(), viewport.y()));
102 host_impl_.pending_tree()->UpdateDrawProperties(); 103 host_impl_.pending_tree()->UpdateDrawProperties();
103 104
104 timer_.Reset(); 105 timer_.Reset();
105 do { 106 do {
106 PictureLayerImpl::LayerRasterTileIterator it(pending_layer_, false); 107 PictureLayerImpl::LayerRasterTileIterator it(pending_layer_, false);
107 timer_.NextLap(); 108 timer_.NextLap();
108 } while (!timer_.HasTimeLimitExpired()); 109 } while (!timer_.HasTimeLimitExpired());
109 110
110 perf_test::PrintResult("layer_raster_tile_iterator_construct", 111 perf_test::PrintResult("layer_raster_tile_iterator_construct",
111 "", 112 "",
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 "", 145 "",
145 test_name, 146 test_name,
146 timer_.LapsPerSecond(), 147 timer_.LapsPerSecond(),
147 "runs/s", 148 "runs/s",
148 true); 149 true);
149 } 150 }
150 151
151 void RunEvictionIteratorConstructTest(const std::string& test_name, 152 void RunEvictionIteratorConstructTest(const std::string& test_name,
152 const gfx::Rect& viewport) { 153 const gfx::Rect& viewport) {
153 host_impl_.SetViewportSize(viewport.size()); 154 host_impl_.SetViewportSize(viewport.size());
154 pending_layer_->SetScrollOffset(gfx::Vector2d(viewport.x(), viewport.y())); 155 pending_layer_->SetScrollOffset(
156 gfx::ScrollOffset(viewport.x(), viewport.y()));
155 host_impl_.pending_tree()->UpdateDrawProperties(); 157 host_impl_.pending_tree()->UpdateDrawProperties();
156 158
157 TreePriority priorities[] = {SAME_PRIORITY_FOR_BOTH_TREES, 159 TreePriority priorities[] = {SAME_PRIORITY_FOR_BOTH_TREES,
158 SMOOTHNESS_TAKES_PRIORITY, 160 SMOOTHNESS_TAKES_PRIORITY,
159 NEW_CONTENT_TAKES_PRIORITY}; 161 NEW_CONTENT_TAKES_PRIORITY};
160 int priority_count = 0; 162 int priority_count = 0;
161 timer_.Reset(); 163 timer_.Reset();
162 do { 164 do {
163 PictureLayerImpl::LayerEvictionTileIterator it( 165 PictureLayerImpl::LayerEvictionTileIterator it(
164 pending_layer_, priorities[priority_count]); 166 pending_layer_, priorities[priority_count]);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 268
267 RunEvictionIteratorConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100)); 269 RunEvictionIteratorConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100));
268 RunEvictionIteratorConstructTest("5000_0_100x100", 270 RunEvictionIteratorConstructTest("5000_0_100x100",
269 gfx::Rect(5000, 0, 100, 100)); 271 gfx::Rect(5000, 0, 100, 100));
270 RunEvictionIteratorConstructTest("9999_0_100x100", 272 RunEvictionIteratorConstructTest("9999_0_100x100",
271 gfx::Rect(9999, 0, 100, 100)); 273 gfx::Rect(9999, 0, 100, 100));
272 } 274 }
273 275
274 } // namespace 276 } // namespace
275 } // namespace cc 277 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698