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

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

Issue 1365793003: cc: Re-enable disabled tile manager unittests (plus fixes) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « cc/test/fake_layer_tree_host_impl.h ('k') | cc/tiles/tile_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/begin_frame_args_test.h" 5 #include "cc/test/begin_frame_args_test.h"
6 #include "cc/test/fake_layer_tree_host_impl.h" 6 #include "cc/test/fake_layer_tree_host_impl.h"
7 #include "cc/test/test_shared_bitmap_manager.h" 7 #include "cc/test/test_shared_bitmap_manager.h"
8 #include "cc/trees/layer_tree_impl.h" 8 #include "cc/trees/layer_tree_impl.h"
9 9
10 namespace cc { 10 namespace cc {
11 11
12 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(Proxy* proxy, 12 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(Proxy* proxy,
13 SharedBitmapManager* manager, 13 SharedBitmapManager* manager,
14 TaskGraphRunner* task_graph_runner) 14 TaskGraphRunner* task_graph_runner)
15 : LayerTreeHostImpl(LayerTreeSettings(), 15 : FakeLayerTreeHostImpl(LayerTreeSettings(),
16 proxy,
17 manager,
18 task_graph_runner,
19 nullptr) {}
20
21 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(const LayerTreeSettings& settings,
22 Proxy* proxy,
23 SharedBitmapManager* manager,
24 TaskGraphRunner* task_graph_runner)
25 : FakeLayerTreeHostImpl(settings,
26 proxy,
27 manager,
28 task_graph_runner,
29 nullptr) {}
30
31 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(
32 const LayerTreeSettings& settings,
33 Proxy* proxy,
34 SharedBitmapManager* manager,
35 TaskGraphRunner* task_graph_runner,
36 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager)
37 : LayerTreeHostImpl(settings,
16 &client_, 38 &client_,
17 proxy, 39 proxy,
18 &stats_instrumentation_, 40 &stats_instrumentation_,
19 manager, 41 manager,
20 NULL, 42 gpu_memory_buffer_manager,
21 task_graph_runner, 43 task_graph_runner,
22 0) { 44 0) {
23 // Explicitly clear all debug settings. 45 // Explicitly clear all debug settings.
24 SetDebugState(LayerTreeDebugState()); 46 SetDebugState(LayerTreeDebugState());
25 SetViewportSize(gfx::Size(100, 100)); 47 SetViewportSize(gfx::Size(100, 100));
26 48
27 // Start an impl frame so tests have a valid frame_time to work with. 49 // Start an impl frame so tests have a valid frame_time to work with.
28 base::TimeTicks time_ticks = base::TimeTicks::FromInternalValue(1); 50 base::TimeTicks time_ticks = base::TimeTicks::FromInternalValue(1);
29 WillBeginImplFrame(
30 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks));
31 }
32
33 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(const LayerTreeSettings& settings,
34 Proxy* proxy,
35 SharedBitmapManager* manager,
36 TaskGraphRunner* task_graph_runner)
37 : LayerTreeHostImpl(settings,
38 &client_,
39 proxy,
40 &stats_instrumentation_,
41 manager,
42 NULL,
43 task_graph_runner,
44 0) {
45 // Explicitly clear all debug settings.
46 SetDebugState(LayerTreeDebugState());
47
48 // Start an impl frame so tests have a valid frame_time to work with.
49 base::TimeTicks time_ticks = base::TimeTicks::FromInternalValue(1);
50 WillBeginImplFrame( 51 WillBeginImplFrame(
51 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); 52 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks));
52 } 53 }
53 54
54 FakeLayerTreeHostImpl::~FakeLayerTreeHostImpl() {} 55 FakeLayerTreeHostImpl::~FakeLayerTreeHostImpl() {}
55 56
56 void FakeLayerTreeHostImpl::CreatePendingTree() { 57 void FakeLayerTreeHostImpl::CreatePendingTree() {
57 LayerTreeHostImpl::CreatePendingTree(); 58 LayerTreeHostImpl::CreatePendingTree();
58 float arbitrary_large_page_scale = 100000.f; 59 float arbitrary_large_page_scale = 100000.f;
59 pending_tree()->PushPageScaleFromMainThread( 60 pending_tree()->PushPageScaleFromMainThread(
(...skipping 29 matching lines...) Expand all
89 90
90 void FakeLayerTreeHostImpl::UpdateNumChildrenAndDrawProperties( 91 void FakeLayerTreeHostImpl::UpdateNumChildrenAndDrawProperties(
91 LayerTreeImpl* layerTree) { 92 LayerTreeImpl* layerTree) {
92 RecursiveUpdateNumChildren(layerTree->root_layer()); 93 RecursiveUpdateNumChildren(layerTree->root_layer());
93 bool update_lcd_text = false; 94 bool update_lcd_text = false;
94 layerTree->BuildPropertyTreesForTesting(); 95 layerTree->BuildPropertyTreesForTesting();
95 layerTree->UpdateDrawProperties(update_lcd_text); 96 layerTree->UpdateDrawProperties(update_lcd_text);
96 } 97 }
97 98
98 } // namespace cc 99 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_layer_tree_host_impl.h ('k') | cc/tiles/tile_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698