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

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

Issue 2655233006: cc : Clean up cc clip tree (Closed)
Patch Set: rebase Created 3 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/test/fake_layer_tree_host_impl.h ('k') | cc/test/layer_test_common.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/fake_layer_tree_host_impl.h" 5 #include "cc/test/fake_layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "cc/animation/animation_host.h" 9 #include "cc/animation/animation_host.h"
10 #include "cc/test/begin_frame_args_test.h" 10 #include "cc/test/begin_frame_args_test.h"
11 #include "cc/test/fake_layer_tree_host_impl.h" 11 #include "cc/test/fake_layer_tree_host_impl.h"
12 #include "cc/test/layer_tree_settings_for_testing.h"
13 #include "cc/trees/layer_tree_impl.h" 12 #include "cc/trees/layer_tree_impl.h"
14 13
15 namespace cc { 14 namespace cc {
16 15
17 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl( 16 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(
18 TaskRunnerProvider* task_runner_provider, 17 TaskRunnerProvider* task_runner_provider,
19 TaskGraphRunner* task_graph_runner) 18 TaskGraphRunner* task_graph_runner)
20 : FakeLayerTreeHostImpl(LayerTreeSettingsForTesting(), 19 : FakeLayerTreeHostImpl(LayerTreeSettings(),
21 task_runner_provider, 20 task_runner_provider,
22 task_graph_runner) {} 21 task_graph_runner) {}
23 22
24 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl( 23 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(
25 const LayerTreeSettings& settings, 24 const LayerTreeSettings& settings,
26 TaskRunnerProvider* task_runner_provider, 25 TaskRunnerProvider* task_runner_provider,
27 TaskGraphRunner* task_graph_runner) 26 TaskGraphRunner* task_graph_runner)
28 : FakeLayerTreeHostImpl(settings, 27 : FakeLayerTreeHostImpl(settings,
29 task_runner_provider, 28 task_runner_provider,
30 task_graph_runner, 29 task_graph_runner,
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 int num_children_that_draw_content = 0; 84 int num_children_that_draw_content = 0;
86 for (size_t i = 0; i < layer->test_properties()->children.size(); ++i) { 85 for (size_t i = 0; i < layer->test_properties()->children.size(); ++i) {
87 num_children_that_draw_content += 86 num_children_that_draw_content +=
88 RecursiveUpdateNumChildren(layer->test_properties()->children[i]); 87 RecursiveUpdateNumChildren(layer->test_properties()->children[i]);
89 } 88 }
90 layer->test_properties()->num_descendants_that_draw_content = 89 layer->test_properties()->num_descendants_that_draw_content =
91 num_children_that_draw_content; 90 num_children_that_draw_content;
92 return num_children_that_draw_content + (layer->DrawsContent() ? 1 : 0); 91 return num_children_that_draw_content + (layer->DrawsContent() ? 1 : 0);
93 } 92 }
94 93
95 void FakeLayerTreeHostImpl::UpdateNumChildrenAndDrawPropertiesForActiveTree( 94 void FakeLayerTreeHostImpl::UpdateNumChildrenAndDrawPropertiesForActiveTree() {
96 bool force_skip_verify_visible_rect_calculations) { 95 UpdateNumChildrenAndDrawProperties(active_tree());
97 UpdateNumChildrenAndDrawProperties(
98 active_tree(), force_skip_verify_visible_rect_calculations);
99 } 96 }
100 97
101 void FakeLayerTreeHostImpl::UpdateNumChildrenAndDrawProperties( 98 void FakeLayerTreeHostImpl::UpdateNumChildrenAndDrawProperties(
102 LayerTreeImpl* layerTree, 99 LayerTreeImpl* layerTree) {
103 bool force_skip_verify_visible_rect_calculations) {
104 RecursiveUpdateNumChildren(layerTree->root_layer_for_testing()); 100 RecursiveUpdateNumChildren(layerTree->root_layer_for_testing());
105 bool update_lcd_text = false; 101 bool update_lcd_text = false;
106 layerTree->BuildLayerListAndPropertyTreesForTesting(); 102 layerTree->BuildLayerListAndPropertyTreesForTesting();
107 layerTree->UpdateDrawProperties(update_lcd_text, 103 layerTree->UpdateDrawProperties(update_lcd_text);
108 force_skip_verify_visible_rect_calculations);
109 } 104 }
110 105
111 AnimationHost* FakeLayerTreeHostImpl::animation_host() const { 106 AnimationHost* FakeLayerTreeHostImpl::animation_host() const {
112 return static_cast<AnimationHost*>(mutator_host()); 107 return static_cast<AnimationHost*>(mutator_host());
113 } 108 }
114 109
115 } // namespace cc 110 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_layer_tree_host_impl.h ('k') | cc/test/layer_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698