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

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

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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_content_layer_client.cc ('k') | cc/test/layer_tree_pixel_resource_test.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 : LayerTreeHostImpl(LayerTreeSettings(), 14 : LayerTreeHostImpl(LayerTreeSettings(),
15 &client_, 15 &client_,
16 proxy, 16 proxy,
17 &stats_instrumentation_, 17 &stats_instrumentation_,
18 manager, 18 manager,
19 NULL, 19 NULL,
20 0) { 20 0) {
21 // Explicitly clear all debug settings. 21 // Explicitly clear all debug settings.
22 SetDebugState(LayerTreeDebugState()); 22 SetDebugState(LayerTreeDebugState());
23 SetViewportSize(gfx::Size(100, 100)); 23 SetViewportSize(gfx::Size(100, 100));
24 24
25 // Avoid using Now() as the frame time in unit tests. 25 // Avoid using Now() as the frame time in unit tests.
26 base::TimeTicks time_ticks = base::TimeTicks::FromInternalValue(1); 26 base::TimeTicks time_ticks = base::TimeTicks::FromInternalValue(1);
27 SetCurrentBeginFrameArgs(CreateBeginFrameArgsForTesting(time_ticks)); 27 SetCurrentBeginFrameArgs(
28 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks));
28 } 29 }
29 30
30 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(const LayerTreeSettings& settings, 31 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(const LayerTreeSettings& settings,
31 Proxy* proxy, 32 Proxy* proxy,
32 SharedBitmapManager* manager) 33 SharedBitmapManager* manager)
33 : LayerTreeHostImpl(settings, 34 : LayerTreeHostImpl(settings,
34 &client_, 35 &client_,
35 proxy, 36 proxy,
36 &stats_instrumentation_, 37 &stats_instrumentation_,
37 manager, 38 manager,
38 NULL, 39 NULL,
39 0) { 40 0) {
40 // Explicitly clear all debug settings. 41 // Explicitly clear all debug settings.
41 SetDebugState(LayerTreeDebugState()); 42 SetDebugState(LayerTreeDebugState());
42 43
43 // Avoid using Now() as the frame time in unit tests. 44 // Avoid using Now() as the frame time in unit tests.
44 base::TimeTicks time_ticks = base::TimeTicks::FromInternalValue(1); 45 base::TimeTicks time_ticks = base::TimeTicks::FromInternalValue(1);
45 SetCurrentBeginFrameArgs(CreateBeginFrameArgsForTesting(time_ticks)); 46 SetCurrentBeginFrameArgs(
47 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks));
46 } 48 }
47 49
48 FakeLayerTreeHostImpl::~FakeLayerTreeHostImpl() {} 50 FakeLayerTreeHostImpl::~FakeLayerTreeHostImpl() {}
49 51
50 void FakeLayerTreeHostImpl::CreatePendingTree() { 52 void FakeLayerTreeHostImpl::CreatePendingTree() {
51 LayerTreeHostImpl::CreatePendingTree(); 53 LayerTreeHostImpl::CreatePendingTree();
52 float arbitrary_large_page_scale = 100000.f; 54 float arbitrary_large_page_scale = 100000.f;
53 pending_tree()->SetPageScaleFactorAndLimits( 55 pending_tree()->SetPageScaleFactorAndLimits(
54 1.f, 1.f / arbitrary_large_page_scale, arbitrary_large_page_scale); 56 1.f, 1.f / arbitrary_large_page_scale, arbitrary_large_page_scale);
55 } 57 }
(...skipping 25 matching lines...) Expand all
81 UpdateNumChildrenAndDrawProperties(active_tree()); 83 UpdateNumChildrenAndDrawProperties(active_tree());
82 } 84 }
83 85
84 void FakeLayerTreeHostImpl::UpdateNumChildrenAndDrawProperties( 86 void FakeLayerTreeHostImpl::UpdateNumChildrenAndDrawProperties(
85 LayerTreeImpl* layerTree) { 87 LayerTreeImpl* layerTree) {
86 RecursiveUpdateNumChildren(layerTree->root_layer()); 88 RecursiveUpdateNumChildren(layerTree->root_layer());
87 layerTree->UpdateDrawProperties(); 89 layerTree->UpdateDrawProperties();
88 } 90 }
89 91
90 } // namespace cc 92 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_content_layer_client.cc ('k') | cc/test/layer_tree_pixel_resource_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698