Lots of random cleanups, mostly for native_theme_win.cc:
[chromium-blink-merge.git] / cc / test / fake_layer_tree_host_impl.cc
blob7361794e7b1aa707018c8fe3a0f6214f5863ada6
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"
9 namespace cc {
11 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(Proxy* proxy,
12 SharedBitmapManager* manager)
13 : LayerTreeHostImpl(LayerTreeSettings(),
14 &client_,
15 proxy,
16 &stats_instrumentation_,
17 manager,
18 0) {
19 // Explicitly clear all debug settings.
20 SetDebugState(LayerTreeDebugState());
21 SetViewportSize(gfx::Size(100, 100));
24 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(const LayerTreeSettings& settings,
25 Proxy* proxy,
26 SharedBitmapManager* manager)
27 : LayerTreeHostImpl(settings,
28 &client_,
29 proxy,
30 &stats_instrumentation_,
31 manager,
32 0) {
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;
57 } // namespace cc