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

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

Issue 2282433002: Revert of cc: Delete all the RendererCapabilities. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-prepare-mailbox-param
Patch Set: Created 4 years, 3 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.h ('k') | cc/test/fake_layer_tree_host_impl_client.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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.h" 5 #include "cc/test/fake_layer_tree_host.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "cc/animation/animation_host.h" 8 #include "cc/animation/animation_host.h"
9 #include "cc/layers/layer.h" 9 #include "cc/layers/layer.h"
10 #include "cc/test/fake_image_serialization_processor.h" 10 #include "cc/test/fake_image_serialization_processor.h"
(...skipping 21 matching lines...) Expand all
32 : LayerTreeHost( 32 : LayerTreeHost(
33 params, 33 params,
34 mode, 34 mode,
35 base::MakeUnique<FakeLayerTree>(std::move(params->animation_host), 35 base::MakeUnique<FakeLayerTree>(std::move(params->animation_host),
36 this)), 36 this)),
37 client_(client), 37 client_(client),
38 host_impl_(*params->settings, 38 host_impl_(*params->settings,
39 &task_runner_provider_, 39 &task_runner_provider_,
40 &manager_, 40 &manager_,
41 params->task_graph_runner), 41 params->task_graph_runner),
42 needs_commit_(false) { 42 needs_commit_(false),
43 renderer_capabilities_set(false) {
43 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner = 44 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner =
44 mode == CompositorMode::THREADED ? base::ThreadTaskRunnerHandle::Get() 45 mode == CompositorMode::THREADED ? base::ThreadTaskRunnerHandle::Get()
45 : nullptr; 46 : nullptr;
46 SetTaskRunnerProviderForTesting(TaskRunnerProvider::Create( 47 SetTaskRunnerProviderForTesting(TaskRunnerProvider::Create(
47 base::ThreadTaskRunnerHandle::Get(), impl_task_runner)); 48 base::ThreadTaskRunnerHandle::Get(), impl_task_runner));
48 client_->SetLayerTreeHost(this); 49 client_->SetLayerTreeHost(this);
49 } 50 }
50 51
51 std::unique_ptr<FakeLayerTreeHost> FakeLayerTreeHost::Create( 52 std::unique_ptr<FakeLayerTreeHost> FakeLayerTreeHost::Create(
52 FakeLayerTreeHostClient* client, 53 FakeLayerTreeHostClient* client,
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 params.task_graph_runner = task_graph_runner; 91 params.task_graph_runner = task_graph_runner;
91 params.image_serialization_processor = image_serialization_processor; 92 params.image_serialization_processor = image_serialization_processor;
92 params.animation_host = AnimationHost::CreateForTesting(ThreadInstance::MAIN); 93 params.animation_host = AnimationHost::CreateForTesting(ThreadInstance::MAIN);
93 return base::WrapUnique(new FakeLayerTreeHost(client, &params, mode)); 94 return base::WrapUnique(new FakeLayerTreeHost(client, &params, mode));
94 } 95 }
95 96
96 FakeLayerTreeHost::~FakeLayerTreeHost() { 97 FakeLayerTreeHost::~FakeLayerTreeHost() {
97 client_->SetLayerTreeHost(NULL); 98 client_->SetLayerTreeHost(NULL);
98 } 99 }
99 100
101 const RendererCapabilities& FakeLayerTreeHost::GetRendererCapabilities() const {
102 if (renderer_capabilities_set)
103 return renderer_capabilities;
104 return LayerTreeHost::GetRendererCapabilities();
105 }
106
100 void FakeLayerTreeHost::SetNeedsCommit() { needs_commit_ = true; } 107 void FakeLayerTreeHost::SetNeedsCommit() { needs_commit_ = true; }
101 108
102 LayerImpl* FakeLayerTreeHost::CommitAndCreateLayerImplTree() { 109 LayerImpl* FakeLayerTreeHost::CommitAndCreateLayerImplTree() {
103 TreeSynchronizer::SynchronizeTrees(root_layer(), active_tree()); 110 TreeSynchronizer::SynchronizeTrees(root_layer(), active_tree());
104 active_tree()->SetPropertyTrees(property_trees()); 111 active_tree()->SetPropertyTrees(property_trees());
105 TreeSynchronizer::PushLayerProperties(root_layer()->GetLayerTree(), 112 TreeSynchronizer::PushLayerProperties(root_layer()->GetLayerTree(),
106 active_tree()); 113 active_tree());
107 layer_tree_->animation_host()->PushPropertiesTo(host_impl_.animation_host()); 114 layer_tree_->animation_host()->PushPropertiesTo(host_impl_.animation_host());
108 115
109 active_tree()->UpdatePropertyTreeScrollOffset(property_trees()); 116 active_tree()->UpdatePropertyTreeScrollOffset(property_trees());
(...skipping 20 matching lines...) Expand all
130 pending_tree()->SetPropertyTrees(property_trees()); 137 pending_tree()->SetPropertyTrees(property_trees());
131 TreeSynchronizer::PushLayerProperties(root_layer()->GetLayerTree(), 138 TreeSynchronizer::PushLayerProperties(root_layer()->GetLayerTree(),
132 pending_tree()); 139 pending_tree());
133 layer_tree_->animation_host()->PushPropertiesTo(host_impl_.animation_host()); 140 layer_tree_->animation_host()->PushPropertiesTo(host_impl_.animation_host());
134 141
135 pending_tree()->UpdatePropertyTreeScrollOffset(property_trees()); 142 pending_tree()->UpdatePropertyTreeScrollOffset(property_trees());
136 return pending_tree()->root_layer_for_testing(); 143 return pending_tree()->root_layer_for_testing();
137 } 144 }
138 145
139 } // namespace cc 146 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_layer_tree_host.h ('k') | cc/test/fake_layer_tree_host_impl_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698