| 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 "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 { |
| 11 | 11 |
| 12 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(Proxy* proxy, | 12 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(Proxy* proxy, |
| 13 SharedBitmapManager* manager) | 13 SharedBitmapManager* manager) |
| 14 : LayerTreeHostImpl(LayerTreeSettings(), | 14 : LayerTreeHostImpl(LayerTreeSettings(), |
| 15 &client_, | 15 &client_, |
| 16 proxy, | 16 proxy, |
| 17 &stats_instrumentation_, | 17 &stats_instrumentation_, |
| 18 manager, | 18 manager, |
| 19 NULL, |
| 19 0) { | 20 0) { |
| 20 // Explicitly clear all debug settings. | 21 // Explicitly clear all debug settings. |
| 21 SetDebugState(LayerTreeDebugState()); | 22 SetDebugState(LayerTreeDebugState()); |
| 22 SetViewportSize(gfx::Size(100, 100)); | 23 SetViewportSize(gfx::Size(100, 100)); |
| 23 | 24 |
| 24 // Avoid using Now() as the frame time in unit tests. | 25 // Avoid using Now() as the frame time in unit tests. |
| 25 base::TimeTicks time_ticks = base::TimeTicks::FromInternalValue(1); | 26 base::TimeTicks time_ticks = base::TimeTicks::FromInternalValue(1); |
| 26 SetCurrentBeginFrameArgs(CreateBeginFrameArgsForTesting(time_ticks)); | 27 SetCurrentBeginFrameArgs(CreateBeginFrameArgsForTesting(time_ticks)); |
| 27 } | 28 } |
| 28 | 29 |
| 29 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(const LayerTreeSettings& settings, | 30 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(const LayerTreeSettings& settings, |
| 30 Proxy* proxy, | 31 Proxy* proxy, |
| 31 SharedBitmapManager* manager) | 32 SharedBitmapManager* manager) |
| 32 : LayerTreeHostImpl(settings, | 33 : LayerTreeHostImpl(settings, |
| 33 &client_, | 34 &client_, |
| 34 proxy, | 35 proxy, |
| 35 &stats_instrumentation_, | 36 &stats_instrumentation_, |
| 36 manager, | 37 manager, |
| 38 NULL, |
| 37 0) { | 39 0) { |
| 38 // Explicitly clear all debug settings. | 40 // Explicitly clear all debug settings. |
| 39 SetDebugState(LayerTreeDebugState()); | 41 SetDebugState(LayerTreeDebugState()); |
| 40 | 42 |
| 41 // Avoid using Now() as the frame time in unit tests. | 43 // Avoid using Now() as the frame time in unit tests. |
| 42 base::TimeTicks time_ticks = base::TimeTicks::FromInternalValue(1); | 44 base::TimeTicks time_ticks = base::TimeTicks::FromInternalValue(1); |
| 43 SetCurrentBeginFrameArgs(CreateBeginFrameArgsForTesting(time_ticks)); | 45 SetCurrentBeginFrameArgs(CreateBeginFrameArgsForTesting(time_ticks)); |
| 44 } | 46 } |
| 45 | 47 |
| 46 FakeLayerTreeHostImpl::~FakeLayerTreeHostImpl() {} | 48 FakeLayerTreeHostImpl::~FakeLayerTreeHostImpl() {} |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 UpdateNumChildrenAndDrawProperties(active_tree()); | 81 UpdateNumChildrenAndDrawProperties(active_tree()); |
| 80 } | 82 } |
| 81 | 83 |
| 82 void FakeLayerTreeHostImpl::UpdateNumChildrenAndDrawProperties( | 84 void FakeLayerTreeHostImpl::UpdateNumChildrenAndDrawProperties( |
| 83 LayerTreeImpl* layerTree) { | 85 LayerTreeImpl* layerTree) { |
| 84 RecursiveUpdateNumChildren(layerTree->root_layer()); | 86 RecursiveUpdateNumChildren(layerTree->root_layer()); |
| 85 layerTree->UpdateDrawProperties(); | 87 layerTree->UpdateDrawProperties(); |
| 86 } | 88 } |
| 87 | 89 |
| 88 } // namespace cc | 90 } // namespace cc |
| OLD | NEW |