| 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/fake_layer_tree_host_impl.h" | 5 #include "cc/test/fake_layer_tree_host_impl.h" |
| 6 #include "cc/test/test_shared_bitmap_manager.h" |
| 6 #include "cc/trees/layer_tree_impl.h" | 7 #include "cc/trees/layer_tree_impl.h" |
| 7 | 8 |
| 8 namespace cc { | 9 namespace cc { |
| 9 | 10 |
| 10 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(Proxy* proxy) | 11 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(Proxy* proxy, |
| 12 SharedBitmapManager* manager) |
| 11 : LayerTreeHostImpl(LayerTreeSettings(), | 13 : LayerTreeHostImpl(LayerTreeSettings(), |
| 12 &client_, | 14 &client_, |
| 13 proxy, | 15 proxy, |
| 14 &stats_instrumentation_, | 16 &stats_instrumentation_, |
| 15 NULL, | 17 manager, |
| 16 0) { | 18 0) { |
| 17 // Explicitly clear all debug settings. | 19 // Explicitly clear all debug settings. |
| 18 SetDebugState(LayerTreeDebugState()); | 20 SetDebugState(LayerTreeDebugState()); |
| 19 SetViewportSize(gfx::Size(100, 100)); | 21 SetViewportSize(gfx::Size(100, 100)); |
| 20 } | 22 } |
| 21 | 23 |
| 22 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(const LayerTreeSettings& settings, | 24 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(const LayerTreeSettings& settings, |
| 23 Proxy* proxy) | 25 Proxy* proxy, |
| 26 SharedBitmapManager* manager) |
| 24 : LayerTreeHostImpl(settings, | 27 : LayerTreeHostImpl(settings, |
| 25 &client_, | 28 &client_, |
| 26 proxy, | 29 proxy, |
| 27 &stats_instrumentation_, | 30 &stats_instrumentation_, |
| 28 NULL, | 31 manager, |
| 29 0) { | 32 0) { |
| 30 // Explicitly clear all debug settings. | 33 // Explicitly clear all debug settings. |
| 31 SetDebugState(LayerTreeDebugState()); | 34 SetDebugState(LayerTreeDebugState()); |
| 32 } | 35 } |
| 33 | 36 |
| 34 FakeLayerTreeHostImpl::~FakeLayerTreeHostImpl() {} | 37 FakeLayerTreeHostImpl::~FakeLayerTreeHostImpl() {} |
| 35 | 38 |
| 36 void FakeLayerTreeHostImpl::CreatePendingTree() { | 39 void FakeLayerTreeHostImpl::CreatePendingTree() { |
| 37 LayerTreeHostImpl::CreatePendingTree(); | 40 LayerTreeHostImpl::CreatePendingTree(); |
| 38 float arbitrary_large_page_scale = 100000.f; | 41 float arbitrary_large_page_scale = 100000.f; |
| 39 pending_tree()->SetPageScaleFactorAndLimits( | 42 pending_tree()->SetPageScaleFactorAndLimits( |
| 40 1.f, 1.f / arbitrary_large_page_scale, arbitrary_large_page_scale); | 43 1.f, 1.f / arbitrary_large_page_scale, arbitrary_large_page_scale); |
| 41 } | 44 } |
| 42 | 45 |
| 43 base::TimeTicks FakeLayerTreeHostImpl::CurrentFrameTimeTicks() { | 46 base::TimeTicks FakeLayerTreeHostImpl::CurrentFrameTimeTicks() { |
| 44 if (current_frame_time_ticks_.is_null()) | 47 if (current_frame_time_ticks_.is_null()) |
| 45 return LayerTreeHostImpl::CurrentFrameTimeTicks(); | 48 return LayerTreeHostImpl::CurrentFrameTimeTicks(); |
| 46 return current_frame_time_ticks_; | 49 return current_frame_time_ticks_; |
| 47 } | 50 } |
| 48 | 51 |
| 49 void FakeLayerTreeHostImpl::SetCurrentFrameTimeTicks( | 52 void FakeLayerTreeHostImpl::SetCurrentFrameTimeTicks( |
| 50 base::TimeTicks current_frame_time_ticks) { | 53 base::TimeTicks current_frame_time_ticks) { |
| 51 current_frame_time_ticks_ = current_frame_time_ticks; | 54 current_frame_time_ticks_ = current_frame_time_ticks; |
| 52 } | 55 } |
| 53 | 56 |
| 54 } // namespace cc | 57 } // namespace cc |
| OLD | NEW |