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