| OLD | NEW |
| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "cc/test/begin_frame_args_test.h" | 7 #include "cc/test/begin_frame_args_test.h" |
| 8 #include "cc/test/fake_layer_tree_host_impl.h" | 8 #include "cc/test/fake_layer_tree_host_impl.h" |
| 9 #include "cc/test/test_shared_bitmap_manager.h" | 9 #include "cc/test/test_shared_bitmap_manager.h" |
| 10 #include "cc/trees/layer_tree_impl.h" | 10 #include "cc/trees/layer_tree_impl.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 BeginFrameArgs next_begin_frame_args = current_begin_frame_tracker_.Current(); | 79 BeginFrameArgs next_begin_frame_args = current_begin_frame_tracker_.Current(); |
| 80 next_begin_frame_args.frame_time += advance_by; | 80 next_begin_frame_args.frame_time += advance_by; |
| 81 DidFinishImplFrame(); | 81 DidFinishImplFrame(); |
| 82 WillBeginImplFrame(next_begin_frame_args); | 82 WillBeginImplFrame(next_begin_frame_args); |
| 83 } | 83 } |
| 84 | 84 |
| 85 int FakeLayerTreeHostImpl::RecursiveUpdateNumChildren(LayerImpl* layer) { | 85 int FakeLayerTreeHostImpl::RecursiveUpdateNumChildren(LayerImpl* layer) { |
| 86 int num_children_that_draw_content = 0; | 86 int num_children_that_draw_content = 0; |
| 87 for (size_t i = 0; i < layer->children().size(); ++i) { | 87 for (size_t i = 0; i < layer->children().size(); ++i) { |
| 88 num_children_that_draw_content += | 88 num_children_that_draw_content += |
| 89 RecursiveUpdateNumChildren(layer->children()[i].get()); | 89 RecursiveUpdateNumChildren(layer->children()[i]); |
| 90 } | 90 } |
| 91 layer->SetNumDescendantsThatDrawContent(num_children_that_draw_content); | 91 layer->SetNumDescendantsThatDrawContent(num_children_that_draw_content); |
| 92 return num_children_that_draw_content + (layer->DrawsContent() ? 1 : 0); | 92 return num_children_that_draw_content + (layer->DrawsContent() ? 1 : 0); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void FakeLayerTreeHostImpl::UpdateNumChildrenAndDrawPropertiesForActiveTree() { | 95 void FakeLayerTreeHostImpl::UpdateNumChildrenAndDrawPropertiesForActiveTree() { |
| 96 UpdateNumChildrenAndDrawProperties(active_tree()); | 96 UpdateNumChildrenAndDrawProperties(active_tree()); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void FakeLayerTreeHostImpl::UpdateNumChildrenAndDrawProperties( | 99 void FakeLayerTreeHostImpl::UpdateNumChildrenAndDrawProperties( |
| 100 LayerTreeImpl* layerTree) { | 100 LayerTreeImpl* layerTree) { |
| 101 RecursiveUpdateNumChildren(layerTree->root_layer()); | 101 RecursiveUpdateNumChildren(layerTree->root_layer()); |
| 102 bool update_lcd_text = false; | 102 bool update_lcd_text = false; |
| 103 layerTree->BuildPropertyTreesForTesting(); | 103 layerTree->BuildPropertyTreesForTesting(); |
| 104 layerTree->UpdateDrawProperties(update_lcd_text); | 104 layerTree->UpdateDrawProperties(update_lcd_text); |
| 105 } | 105 } |
| 106 | 106 |
| 107 } // namespace cc | 107 } // namespace cc |
| OLD | NEW |