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/trees/layer_tree_impl.h"
10 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(Proxy
* proxy
)
11 : LayerTreeHostImpl(LayerTreeSettings(),
14 &stats_instrumentation_
) {
15 // Explicitly clear all debug settings.
16 SetDebugState(LayerTreeDebugState());
19 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(
20 const LayerTreeSettings
& settings
,
22 : LayerTreeHostImpl(settings
,
25 &stats_instrumentation_
) {
26 // Explicitly clear all debug settings.
27 SetDebugState(LayerTreeDebugState());
30 FakeLayerTreeHostImpl::~FakeLayerTreeHostImpl() {}
32 void FakeLayerTreeHostImpl::CreatePendingTree() {
33 LayerTreeHostImpl::CreatePendingTree();
34 float arbitrary_large_page_scale
= 100000.f
;
35 pending_tree()->SetPageScaleFactorAndLimits(
36 1.f
, 1.f
/ arbitrary_large_page_scale
, arbitrary_large_page_scale
);
39 base::TimeTicks
FakeLayerTreeHostImpl::CurrentFrameTimeTicks() {
40 if (current_frame_time_ticks_
.is_null())
41 return LayerTreeHostImpl::CurrentFrameTimeTicks();
42 return current_frame_time_ticks_
;
45 void FakeLayerTreeHostImpl::SetCurrentFrameTimeTicks(
46 base::TimeTicks current_frame_time_ticks
) {
47 current_frame_time_ticks_
= current_frame_time_ticks
;