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

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

Issue 1437413002: cc: Remove ScopedPtrVector and cc::remove_if. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: just the vector Created 5 years, 1 month 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
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/begin_frame_args_test.h" 5 #include "cc/test/begin_frame_args_test.h"
6 #include "cc/test/fake_layer_tree_host_impl.h" 6 #include "cc/test/fake_layer_tree_host_impl.h"
7 #include "cc/test/test_shared_bitmap_manager.h" 7 #include "cc/test/test_shared_bitmap_manager.h"
8 #include "cc/trees/layer_tree_impl.h" 8 #include "cc/trees/layer_tree_impl.h"
9 9
10 namespace cc { 10 namespace cc {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 BeginFrameArgs next_begin_frame_args = current_begin_frame_tracker_.Current(); 71 BeginFrameArgs next_begin_frame_args = current_begin_frame_tracker_.Current();
72 next_begin_frame_args.frame_time += advance_by; 72 next_begin_frame_args.frame_time += advance_by;
73 DidFinishImplFrame(); 73 DidFinishImplFrame();
74 WillBeginImplFrame(next_begin_frame_args); 74 WillBeginImplFrame(next_begin_frame_args);
75 } 75 }
76 76
77 int FakeLayerTreeHostImpl::RecursiveUpdateNumChildren(LayerImpl* layer) { 77 int FakeLayerTreeHostImpl::RecursiveUpdateNumChildren(LayerImpl* layer) {
78 int num_children_that_draw_content = 0; 78 int num_children_that_draw_content = 0;
79 for (size_t i = 0; i < layer->children().size(); ++i) { 79 for (size_t i = 0; i < layer->children().size(); ++i) {
80 num_children_that_draw_content += 80 num_children_that_draw_content +=
81 RecursiveUpdateNumChildren(layer->children()[i]); 81 RecursiveUpdateNumChildren(layer->children()[i].get());
82 } 82 }
83 if (layer->DrawsContent() && layer->HasDelegatedContent()) 83 if (layer->DrawsContent() && layer->HasDelegatedContent())
84 num_children_that_draw_content += 1000; 84 num_children_that_draw_content += 1000;
85 layer->SetNumDescendantsThatDrawContent(num_children_that_draw_content); 85 layer->SetNumDescendantsThatDrawContent(num_children_that_draw_content);
86 return num_children_that_draw_content + (layer->DrawsContent() ? 1 : 0); 86 return num_children_that_draw_content + (layer->DrawsContent() ? 1 : 0);
87 } 87 }
88 88
89 void FakeLayerTreeHostImpl::UpdateNumChildrenAndDrawPropertiesForActiveTree() { 89 void FakeLayerTreeHostImpl::UpdateNumChildrenAndDrawPropertiesForActiveTree() {
90 UpdateNumChildrenAndDrawProperties(active_tree()); 90 UpdateNumChildrenAndDrawProperties(active_tree());
91 } 91 }
92 92
93 void FakeLayerTreeHostImpl::UpdateNumChildrenAndDrawProperties( 93 void FakeLayerTreeHostImpl::UpdateNumChildrenAndDrawProperties(
94 LayerTreeImpl* layerTree) { 94 LayerTreeImpl* layerTree) {
95 RecursiveUpdateNumChildren(layerTree->root_layer()); 95 RecursiveUpdateNumChildren(layerTree->root_layer());
96 bool update_lcd_text = false; 96 bool update_lcd_text = false;
97 layerTree->BuildPropertyTreesForTesting(); 97 layerTree->BuildPropertyTreesForTesting();
98 layerTree->UpdateDrawProperties(update_lcd_text); 98 layerTree->UpdateDrawProperties(update_lcd_text);
99 } 99 }
100 100
101 } // namespace cc 101 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698