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_,
17 // Explicitly clear all debug settings.
18 SetDebugState(LayerTreeDebugState());
19 SetViewportSize(gfx::Size(100, 100));
22 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(const LayerTreeSettings& settings,
24 : LayerTreeHostImpl(settings,
27 &stats_instrumentation_,
30 // Explicitly clear all debug settings.
31 SetDebugState(LayerTreeDebugState());
34 FakeLayerTreeHostImpl::~FakeLayerTreeHostImpl() {}
36 void FakeLayerTreeHostImpl::CreatePendingTree() {
37 LayerTreeHostImpl::CreatePendingTree();
38 float arbitrary_large_page_scale = 100000.f;
39 pending_tree()->SetPageScaleFactorAndLimits(
40 1.f, 1.f / arbitrary_large_page_scale, arbitrary_large_page_scale);
43 base::TimeTicks FakeLayerTreeHostImpl::CurrentFrameTimeTicks() {
44 if (current_frame_time_ticks_.is_null())
45 return LayerTreeHostImpl::CurrentFrameTimeTicks();
46 return current_frame_time_ticks_;
49 void FakeLayerTreeHostImpl::SetCurrentFrameTimeTicks(
50 base::TimeTicks current_frame_time_ticks) {
51 current_frame_time_ticks_ = current_frame_time_ticks;