Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(449)

Side by Side Diff: cc/test/fake_layer_tree_host_impl.cc

Issue 202763002: Switch to use SharedBitmapManager all the time in cc_unittests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/test/fake_layer_tree_host_impl.h" 5 #include "cc/test/fake_layer_tree_host_impl.h"
6 #include "cc/test/test_shared_bitmap_manager.h"
6 #include "cc/trees/layer_tree_impl.h" 7 #include "cc/trees/layer_tree_impl.h"
7 8
8 namespace cc { 9 namespace cc {
9 10
10 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(Proxy* proxy) 11 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(Proxy* proxy)
11 : LayerTreeHostImpl(LayerTreeSettings(), 12 : LayerTreeHostImpl(LayerTreeSettings(),
12 &client_, 13 &client_,
13 proxy, 14 proxy,
14 &stats_instrumentation_, 15 &stats_instrumentation_,
15 NULL, 16 NULL,
16 0) { 17 0) {
17 // Explicitly clear all debug settings. 18 // Explicitly clear all debug settings.
18 SetDebugState(LayerTreeDebugState()); 19 SetDebugState(LayerTreeDebugState());
19 SetViewportSize(gfx::Size(100, 100)); 20 SetViewportSize(gfx::Size(100, 100));
21 bitmap_manager_.reset(new TestSharedBitmapManager);
danakj 2014/03/18 23:42:44 This is kinda unfortunate. Can we own it outside t
22 shared_bitmap_manager_ = bitmap_manager_.get();
20 } 23 }
21 24
22 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(const LayerTreeSettings& settings, 25 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(const LayerTreeSettings& settings,
23 Proxy* proxy) 26 Proxy* proxy)
24 : LayerTreeHostImpl(settings, 27 : LayerTreeHostImpl(settings,
25 &client_, 28 &client_,
26 proxy, 29 proxy,
27 &stats_instrumentation_, 30 &stats_instrumentation_,
28 NULL, 31 NULL,
29 0) { 32 0) {
30 // Explicitly clear all debug settings. 33 // Explicitly clear all debug settings.
31 SetDebugState(LayerTreeDebugState()); 34 SetDebugState(LayerTreeDebugState());
35 bitmap_manager_.reset(new TestSharedBitmapManager);
36 shared_bitmap_manager_ = bitmap_manager_.get();
32 } 37 }
33 38
34 FakeLayerTreeHostImpl::~FakeLayerTreeHostImpl() {} 39 FakeLayerTreeHostImpl::~FakeLayerTreeHostImpl() {}
35 40
36 void FakeLayerTreeHostImpl::CreatePendingTree() { 41 void FakeLayerTreeHostImpl::CreatePendingTree() {
37 LayerTreeHostImpl::CreatePendingTree(); 42 LayerTreeHostImpl::CreatePendingTree();
38 float arbitrary_large_page_scale = 100000.f; 43 float arbitrary_large_page_scale = 100000.f;
39 pending_tree()->SetPageScaleFactorAndLimits( 44 pending_tree()->SetPageScaleFactorAndLimits(
40 1.f, 1.f / arbitrary_large_page_scale, arbitrary_large_page_scale); 45 1.f, 1.f / arbitrary_large_page_scale, arbitrary_large_page_scale);
41 } 46 }
42 47
43 base::TimeTicks FakeLayerTreeHostImpl::CurrentFrameTimeTicks() { 48 base::TimeTicks FakeLayerTreeHostImpl::CurrentFrameTimeTicks() {
44 if (current_frame_time_ticks_.is_null()) 49 if (current_frame_time_ticks_.is_null())
45 return LayerTreeHostImpl::CurrentFrameTimeTicks(); 50 return LayerTreeHostImpl::CurrentFrameTimeTicks();
46 return current_frame_time_ticks_; 51 return current_frame_time_ticks_;
47 } 52 }
48 53
49 void FakeLayerTreeHostImpl::SetCurrentFrameTimeTicks( 54 void FakeLayerTreeHostImpl::SetCurrentFrameTimeTicks(
50 base::TimeTicks current_frame_time_ticks) { 55 base::TimeTicks current_frame_time_ticks) {
51 current_frame_time_ticks_ = current_frame_time_ticks; 56 current_frame_time_ticks_ = current_frame_time_ticks;
52 } 57 }
53 58
54 } // namespace cc 59 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698