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

Unified Diff: cc/test/fake_layer_tree_host.cc

Issue 1511743004: cc: Fix recording of GPU rasterization histogram for renderer compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add ForTesting to SetTaskRunnerProvider. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/fake_layer_tree_host.h ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_layer_tree_host.cc
diff --git a/cc/test/fake_layer_tree_host.cc b/cc/test/fake_layer_tree_host.cc
index b2b6a3f66d743b070241bf2574d7635a77da373e..f57cad8e2da4b2d298eac225a8960e1e04e4f871 100644
--- a/cc/test/fake_layer_tree_host.cc
+++ b/cc/test/fake_layer_tree_host.cc
@@ -9,8 +9,9 @@
namespace cc {
FakeLayerTreeHost::FakeLayerTreeHost(FakeLayerTreeHostClient* client,
- LayerTreeHost::InitParams* params)
- : LayerTreeHost(params, CompositorMode::SingleThreaded),
+ LayerTreeHost::InitParams* params,
+ CompositorMode mode)
+ : LayerTreeHost(params, mode),
client_(client),
host_impl_(*params->settings,
&task_runner_provider_,
@@ -18,6 +19,11 @@ FakeLayerTreeHost::FakeLayerTreeHost(FakeLayerTreeHostClient* client,
params->task_graph_runner),
needs_commit_(false),
renderer_capabilities_set(false) {
+ scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner =
+ mode == CompositorMode::Threaded ? base::ThreadTaskRunnerHandle::Get()
+ : nullptr;
+ SetTaskRunnerProviderForTesting(TaskRunnerProvider::Create(
+ base::ThreadTaskRunnerHandle::Get(), impl_task_runner));
client_->SetLayerTreeHost(this);
}
@@ -33,11 +39,20 @@ scoped_ptr<FakeLayerTreeHost> FakeLayerTreeHost::Create(
FakeLayerTreeHostClient* client,
TestTaskGraphRunner* task_graph_runner,
const LayerTreeSettings& settings) {
+ return Create(client, task_graph_runner, settings,
+ CompositorMode::SingleThreaded);
+}
+
+scoped_ptr<FakeLayerTreeHost> FakeLayerTreeHost::Create(
+ FakeLayerTreeHostClient* client,
+ TestTaskGraphRunner* task_graph_runner,
+ const LayerTreeSettings& settings,
+ CompositorMode mode) {
LayerTreeHost::InitParams params;
params.client = client;
params.settings = &settings;
params.task_graph_runner = task_graph_runner;
- return make_scoped_ptr(new FakeLayerTreeHost(client, &params));
+ return make_scoped_ptr(new FakeLayerTreeHost(client, &params, mode));
}
FakeLayerTreeHost::~FakeLayerTreeHost() {
« no previous file with comments | « cc/test/fake_layer_tree_host.h ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698