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

Side by Side Diff: cc/test/test_layer_tree_host_base.cc

Issue 2726343004: cc: Optimize decode scheduling for checker-images. (Closed)
Patch Set: rebase Created 3 years, 8 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/test/test_layer_tree_host_base.h ('k') | cc/tiles/checker_image_tracker.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/test/test_layer_tree_host_base.h" 5 #include "cc/test/test_layer_tree_host_base.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/threading/thread_task_runner_handle.h" 8 #include "base/threading/thread_task_runner_handle.h"
9 #include "cc/test/fake_compositor_frame_sink.h" 9 #include "cc/test/fake_compositor_frame_sink.h"
10 #include "cc/test/fake_raster_source.h" 10 #include "cc/test/fake_raster_source.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 CHECK(host_impl()->recycle_tree()); 152 CHECK(host_impl()->recycle_tree());
153 old_pending_layer_ = pending_layer_; 153 old_pending_layer_ = pending_layer_;
154 pending_layer_ = nullptr; 154 pending_layer_ = nullptr;
155 active_layer_ = static_cast<FakePictureLayerImpl*>( 155 active_layer_ = static_cast<FakePictureLayerImpl*>(
156 host_impl()->active_tree()->LayerById(id_)); 156 host_impl()->active_tree()->LayerById(id_));
157 157
158 bool update_lcd_text = false; 158 bool update_lcd_text = false;
159 host_impl()->active_tree()->UpdateDrawProperties(update_lcd_text); 159 host_impl()->active_tree()->UpdateDrawProperties(update_lcd_text);
160 } 160 }
161 161
162 void TestLayerTreeHostBase::PerformImplSideInvalidation() {
163 DCHECK(host_impl()->active_tree());
164 DCHECK(!host_impl()->pending_tree());
165 DCHECK(host_impl()->recycle_tree());
166
167 host_impl()->CreatePendingTree();
168 host_impl()->sync_tree()->InvalidateRegionForImages(
169 host_impl()->tile_manager()->TakeImagesToInvalidateOnSyncTree());
170 pending_layer_ = old_pending_layer_;
171 old_pending_layer_ = nullptr;
172 }
173
162 void TestLayerTreeHostBase::RebuildPropertyTreesOnPendingTree() { 174 void TestLayerTreeHostBase::RebuildPropertyTreesOnPendingTree() {
163 host_impl()->pending_tree()->property_trees()->needs_rebuild = true; 175 host_impl()->pending_tree()->property_trees()->needs_rebuild = true;
164 host_impl()->pending_tree()->BuildLayerListAndPropertyTreesForTesting(); 176 host_impl()->pending_tree()->BuildLayerListAndPropertyTreesForTesting();
165 } 177 }
166 178
167 void TestLayerTreeHostBase::SetInitialTreePriority() { 179 void TestLayerTreeHostBase::SetInitialTreePriority() {
168 GlobalStateThatImpactsTilePriority state; 180 GlobalStateThatImpactsTilePriority state;
169 181
170 state.soft_memory_limit_in_bytes = 100 * 1000 * 1000; 182 state.soft_memory_limit_in_bytes = 100 * 1000 * 1000;
171 state.num_resources_limit = 10000; 183 state.num_resources_limit = 10000;
172 state.hard_memory_limit_in_bytes = state.soft_memory_limit_in_bytes * 2; 184 state.hard_memory_limit_in_bytes = state.soft_memory_limit_in_bytes * 2;
173 state.memory_limit_policy = ALLOW_ANYTHING; 185 state.memory_limit_policy = ALLOW_ANYTHING;
174 state.tree_priority = SAME_PRIORITY_FOR_BOTH_TREES; 186 state.tree_priority = SAME_PRIORITY_FOR_BOTH_TREES;
175 187
176 host_impl_->resource_pool()->SetResourceUsageLimits( 188 host_impl_->resource_pool()->SetResourceUsageLimits(
177 state.soft_memory_limit_in_bytes, state.num_resources_limit); 189 state.soft_memory_limit_in_bytes, state.num_resources_limit);
178 host_impl_->tile_manager()->SetGlobalStateForTesting(state); 190 host_impl_->tile_manager()->SetGlobalStateForTesting(state);
179 } 191 }
180 192
181 } // namespace cc 193 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/test_layer_tree_host_base.h ('k') | cc/tiles/checker_image_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698