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
3 // found in the LICENSE file.
5 #include "cc/test/fake_layer_tree_host_impl.h"
6 #include "cc/test/test_shared_bitmap_manager.h"
7 #include "cc/trees/layer_tree_impl.h"
11 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(Proxy
* proxy
,
12 SharedBitmapManager
* manager
)
13 : LayerTreeHostImpl(LayerTreeSettings(),
16 &stats_instrumentation_
,
19 // Explicitly clear all debug settings.
20 SetDebugState(LayerTreeDebugState());
21 SetViewportSize(gfx::Size(100, 100));
24 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(const LayerTreeSettings
& settings
,
26 SharedBitmapManager
* manager
)
27 : LayerTreeHostImpl(settings
,
30 &stats_instrumentation_
,
33 // Explicitly clear all debug settings.
34 SetDebugState(LayerTreeDebugState());
37 FakeLayerTreeHostImpl::~FakeLayerTreeHostImpl() {}
39 void FakeLayerTreeHostImpl::CreatePendingTree() {
40 LayerTreeHostImpl::CreatePendingTree();
41 float arbitrary_large_page_scale
= 100000.f
;
42 pending_tree()->SetPageScaleFactorAndLimits(
43 1.f
, 1.f
/ arbitrary_large_page_scale
, arbitrary_large_page_scale
);
46 base::TimeTicks
FakeLayerTreeHostImpl::CurrentFrameTimeTicks() {
47 if (current_frame_time_ticks_
.is_null())
48 return LayerTreeHostImpl::CurrentFrameTimeTicks();
49 return current_frame_time_ticks_
;
52 void FakeLayerTreeHostImpl::SetCurrentFrameTimeTicks(
53 base::TimeTicks current_frame_time_ticks
) {
54 current_frame_time_ticks_
= current_frame_time_ticks
;