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

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

Issue 2889093003: Refactor SetViewportLayerIds to use a struct instead of 6 values (Closed)
Patch Set: Fix small mistake made in a test Created 3 years, 7 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/fake_layer_tree_host.cc ('k') | cc/trees/layer_tree_host.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 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 .release())); 125 .release()));
126 if (!tile_size.IsEmpty()) 126 if (!tile_size.IsEmpty())
127 pending_layer->set_fixed_tile_size(tile_size); 127 pending_layer->set_fixed_tile_size(tile_size);
128 } 128 }
129 pending_root->test_properties()->force_render_surface = true; 129 pending_root->test_properties()->force_render_surface = true;
130 // The bounds() just mirror the raster source size. 130 // The bounds() just mirror the raster source size.
131 pending_layer->SetBounds(raster_source->GetSize()); 131 pending_layer->SetBounds(raster_source->GetSize());
132 pending_layer->SetRasterSourceOnPending(raster_source, invalidation); 132 pending_layer->SetRasterSourceOnPending(raster_source, invalidation);
133 133
134 pending_root->test_properties()->AddChild(std::move(pending_layer)); 134 pending_root->test_properties()->AddChild(std::move(pending_layer));
135 pending_tree->SetViewportLayersFromIds( 135 LayerTreeImpl::ViewportLayerIds viewport_ids;
136 Layer::INVALID_ID, pending_tree->root_layer_for_testing()->id(), 136 viewport_ids.page_scale = pending_tree->root_layer_for_testing()->id();
137 Layer::INVALID_ID, Layer::INVALID_ID, Layer::INVALID_ID, 137 pending_tree->SetViewportLayersFromIds(viewport_ids);
138 Layer::INVALID_ID);
139 138
140 pending_layer_ = static_cast<FakePictureLayerImpl*>( 139 pending_layer_ = static_cast<FakePictureLayerImpl*>(
141 host_impl()->pending_tree()->LayerById(id_)); 140 host_impl()->pending_tree()->LayerById(id_));
142 141
143 // Add tilings/tiles for the layer. 142 // Add tilings/tiles for the layer.
144 bool update_lcd_text = false; 143 bool update_lcd_text = false;
145 RebuildPropertyTreesOnPendingTree(); 144 RebuildPropertyTreesOnPendingTree();
146 host_impl()->pending_tree()->UpdateDrawProperties(update_lcd_text); 145 host_impl()->pending_tree()->UpdateDrawProperties(update_lcd_text);
147 } 146 }
148 147
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 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;
186 state.memory_limit_policy = ALLOW_ANYTHING; 185 state.memory_limit_policy = ALLOW_ANYTHING;
187 state.tree_priority = SAME_PRIORITY_FOR_BOTH_TREES; 186 state.tree_priority = SAME_PRIORITY_FOR_BOTH_TREES;
188 187
189 host_impl_->resource_pool()->SetResourceUsageLimits( 188 host_impl_->resource_pool()->SetResourceUsageLimits(
190 state.soft_memory_limit_in_bytes, state.num_resources_limit); 189 state.soft_memory_limit_in_bytes, state.num_resources_limit);
191 host_impl_->tile_manager()->SetGlobalStateForTesting(state); 190 host_impl_->tile_manager()->SetGlobalStateForTesting(state);
192 } 191 }
193 192
194 } // namespace cc 193 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_layer_tree_host.cc ('k') | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698