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

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

Issue 2899403003: cc: Give non-drawing layers that are rasterized a lower priority. (Closed)
Patch Set: type Created 3 years, 6 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/picture_layer_impl.cc ('k') | cc/layers/picture_layer_impl_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 "base/macros.h" 7 #include "base/macros.h"
8 #include "base/threading/thread_task_runner_handle.h" 8 #include "base/threading/thread_task_runner_handle.h"
9 #include "cc/base/lap_timer.h" 9 #include "cc/base/lap_timer.h"
10 #include "cc/test/fake_compositor_frame_sink.h" 10 #include "cc/test/fake_compositor_frame_sink.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 const gfx::Size& viewport_size) { 79 const gfx::Size& viewport_size) {
80 host_impl_.SetViewportSize(viewport_size); 80 host_impl_.SetViewportSize(viewport_size);
81 bool update_lcd_text = false; 81 bool update_lcd_text = false;
82 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); 82 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text);
83 83
84 timer_.Reset(); 84 timer_.Reset();
85 do { 85 do {
86 int count = num_tiles; 86 int count = num_tiles;
87 std::unique_ptr<TilingSetRasterQueueAll> queue( 87 std::unique_ptr<TilingSetRasterQueueAll> queue(
88 new TilingSetRasterQueueAll( 88 new TilingSetRasterQueueAll(
89 pending_layer_->picture_layer_tiling_set(), false)); 89 pending_layer_->picture_layer_tiling_set(), false, true));
90 while (count--) { 90 while (count--) {
91 ASSERT_TRUE(!queue->IsEmpty()) << "count: " << count; 91 ASSERT_TRUE(!queue->IsEmpty()) << "count: " << count;
92 ASSERT_TRUE(queue->Top().tile()) << "count: " << count; 92 ASSERT_TRUE(queue->Top().tile()) << "count: " << count;
93 queue->Pop(); 93 queue->Pop();
94 } 94 }
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 host_impl_.pending_tree() 105 host_impl_.pending_tree()
106 ->property_trees() 106 ->property_trees()
107 ->scroll_tree.UpdateScrollOffsetBaseForTesting( 107 ->scroll_tree.UpdateScrollOffsetBaseForTesting(
108 pending_layer_->id(), 108 pending_layer_->id(),
109 gfx::ScrollOffset(viewport.x(), viewport.y())); 109 gfx::ScrollOffset(viewport.x(), viewport.y()));
110 bool update_lcd_text = false; 110 bool update_lcd_text = false;
111 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); 111 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text);
112 112
113 timer_.Reset(); 113 timer_.Reset();
114 do { 114 do {
115 std::unique_ptr<TilingSetRasterQueueAll> queue( 115 std::unique_ptr<TilingSetRasterQueueAll> queue(
116 new TilingSetRasterQueueAll( 116 new TilingSetRasterQueueAll(
117 pending_layer_->picture_layer_tiling_set(), false)); 117 pending_layer_->picture_layer_tiling_set(), false, true));
118 timer_.NextLap(); 118 timer_.NextLap();
119 } while (!timer_.HasTimeLimitExpired()); 119 } while (!timer_.HasTimeLimitExpired());
120 120
121 perf_test::PrintResult("tiling_set_raster_queue_construct", "", test_name, 121 perf_test::PrintResult("tiling_set_raster_queue_construct", "", test_name,
122 timer_.LapsPerSecond(), "runs/s", true); 122 timer_.LapsPerSecond(), "runs/s", true);
123 } 123 }
124 124
125 void RunEvictionQueueConstructAndIterateTest( 125 void RunEvictionQueueConstructAndIterateTest(
126 const std::string& test_name, 126 const std::string& test_name,
127 int num_tiles, 127 int num_tiles,
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 ASSERT_TRUE(host_impl_.tile_manager() != nullptr); 257 ASSERT_TRUE(host_impl_.tile_manager() != nullptr);
258 host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(all_tiles); 258 host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(all_tiles);
259 259
260 RunEvictionQueueConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100)); 260 RunEvictionQueueConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100));
261 RunEvictionQueueConstructTest("5000_0_100x100", gfx::Rect(5000, 0, 100, 100)); 261 RunEvictionQueueConstructTest("5000_0_100x100", gfx::Rect(5000, 0, 100, 100));
262 RunEvictionQueueConstructTest("9999_0_100x100", gfx::Rect(9999, 0, 100, 100)); 262 RunEvictionQueueConstructTest("9999_0_100x100", gfx::Rect(9999, 0, 100, 100));
263 } 263 }
264 264
265 } // namespace 265 } // namespace
266 } // namespace cc 266 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698