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

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

Issue 1766053002: Clean LayerImpl's scroll offset callers in unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove transform tree update setting Created 4 years, 9 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_position_constraint_unittest.cc ('k') | cc/test/layer_tree_host_common_test.h » ('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 "base/macros.h" 7 #include "base/macros.h"
8 #include "base/thread_task_runner_handle.h" 8 #include "base/thread_task_runner_handle.h"
9 #include "cc/debug/lap_timer.h" 9 #include "cc/debug/lap_timer.h"
10 #include "cc/test/fake_display_list_raster_source.h" 10 #include "cc/test/fake_display_list_raster_source.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 timer_.NextLap(); 95 timer_.NextLap();
96 } while (!timer_.HasTimeLimitExpired()); 96 } while (!timer_.HasTimeLimitExpired());
97 97
98 perf_test::PrintResult("tiling_set_raster_queue_construct_and_iterate", "", 98 perf_test::PrintResult("tiling_set_raster_queue_construct_and_iterate", "",
99 test_name, timer_.LapsPerSecond(), "runs/s", true); 99 test_name, timer_.LapsPerSecond(), "runs/s", true);
100 } 100 }
101 101
102 void RunRasterQueueConstructTest(const std::string& test_name, 102 void RunRasterQueueConstructTest(const std::string& test_name,
103 const gfx::Rect& viewport) { 103 const gfx::Rect& viewport) {
104 host_impl_.SetViewportSize(viewport.size()); 104 host_impl_.SetViewportSize(viewport.size());
105 pending_layer_->PushScrollOffsetFromMainThread( 105 host_impl_.pending_tree()
106 gfx::ScrollOffset(viewport.x(), viewport.y())); 106 ->property_trees()
107 ->scroll_tree.UpdateScrollOffsetBaseForTesting(
108 pending_layer_->id(),
109 gfx::ScrollOffset(viewport.x(), viewport.y()));
107 bool update_lcd_text = false; 110 bool update_lcd_text = false;
108 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); 111 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text);
109 112
110 timer_.Reset(); 113 timer_.Reset();
111 do { 114 do {
112 scoped_ptr<TilingSetRasterQueueAll> queue(new TilingSetRasterQueueAll( 115 scoped_ptr<TilingSetRasterQueueAll> queue(new TilingSetRasterQueueAll(
113 pending_layer_->picture_layer_tiling_set(), false)); 116 pending_layer_->picture_layer_tiling_set(), false));
114 timer_.NextLap(); 117 timer_.NextLap();
115 } while (!timer_.HasTimeLimitExpired()); 118 } while (!timer_.HasTimeLimitExpired());
116 119
(...skipping 23 matching lines...) Expand all
140 } while (!timer_.HasTimeLimitExpired()); 143 } while (!timer_.HasTimeLimitExpired());
141 144
142 perf_test::PrintResult("tiling_set_eviction_queue_construct_and_iterate", 145 perf_test::PrintResult("tiling_set_eviction_queue_construct_and_iterate",
143 "", test_name, timer_.LapsPerSecond(), "runs/s", 146 "", test_name, timer_.LapsPerSecond(), "runs/s",
144 true); 147 true);
145 } 148 }
146 149
147 void RunEvictionQueueConstructTest(const std::string& test_name, 150 void RunEvictionQueueConstructTest(const std::string& test_name,
148 const gfx::Rect& viewport) { 151 const gfx::Rect& viewport) {
149 host_impl_.SetViewportSize(viewport.size()); 152 host_impl_.SetViewportSize(viewport.size());
150 pending_layer_->PushScrollOffsetFromMainThread( 153 host_impl_.pending_tree()
151 gfx::ScrollOffset(viewport.x(), viewport.y())); 154 ->property_trees()
155 ->scroll_tree.UpdateScrollOffsetBaseForTesting(
156 pending_layer_->id(),
157 gfx::ScrollOffset(viewport.x(), viewport.y()));
152 bool update_lcd_text = false; 158 bool update_lcd_text = false;
153 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); 159 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text);
154 160
155 timer_.Reset(); 161 timer_.Reset();
156 do { 162 do {
157 scoped_ptr<TilingSetEvictionQueue> queue(new TilingSetEvictionQueue( 163 scoped_ptr<TilingSetEvictionQueue> queue(new TilingSetEvictionQueue(
158 pending_layer_->picture_layer_tiling_set())); 164 pending_layer_->picture_layer_tiling_set()));
159 timer_.NextLap(); 165 timer_.NextLap();
160 } while (!timer_.HasTimeLimitExpired()); 166 } while (!timer_.HasTimeLimitExpired());
161 167
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 ASSERT_TRUE(host_impl_.tile_manager() != nullptr); 255 ASSERT_TRUE(host_impl_.tile_manager() != nullptr);
250 host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(all_tiles); 256 host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(all_tiles);
251 257
252 RunEvictionQueueConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100)); 258 RunEvictionQueueConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100));
253 RunEvictionQueueConstructTest("5000_0_100x100", gfx::Rect(5000, 0, 100, 100)); 259 RunEvictionQueueConstructTest("5000_0_100x100", gfx::Rect(5000, 0, 100, 100));
254 RunEvictionQueueConstructTest("9999_0_100x100", gfx::Rect(9999, 0, 100, 100)); 260 RunEvictionQueueConstructTest("9999_0_100x100", gfx::Rect(9999, 0, 100, 100));
255 } 261 }
256 262
257 } // namespace 263 } // namespace
258 } // namespace cc 264 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_position_constraint_unittest.cc ('k') | cc/test/layer_tree_host_common_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698