| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "blimp/client/compositor/blimp_compositor.h" | 5 #include "blimp/client/compositor/blimp_compositor.h" |
| 6 | 6 |
| 7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 params.task_graph_runner = g_task_graph_runner.Pointer(); | 61 params.task_graph_runner = g_task_graph_runner.Pointer(); |
| 62 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); | 62 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); |
| 63 params.settings = settings_.get(); | 63 params.settings = settings_.get(); |
| 64 | 64 |
| 65 // TODO(dtrainor): Swap this out with the remote client proxy when | 65 // TODO(dtrainor): Swap this out with the remote client proxy when |
| 66 // implemented. | 66 // implemented. |
| 67 host_ = | 67 host_ = |
| 68 cc::LayerTreeHost::CreateThreaded(GetCompositorTaskRunner(), ¶ms); | 68 cc::LayerTreeHost::CreateThreaded(GetCompositorTaskRunner(), ¶ms); |
| 69 | 69 |
| 70 host_->SetVisible(true); | 70 host_->SetVisible(true); |
| 71 host_->SetLayerTreeHostClientReady(); | |
| 72 host_->SetViewportSize(viewport_size_); | 71 host_->SetViewportSize(viewport_size_); |
| 73 host_->SetDeviceScaleFactor(device_scale_factor_); | 72 host_->SetDeviceScaleFactor(device_scale_factor_); |
| 74 | 73 |
| 75 // Build the root Layer. | 74 // Build the root Layer. |
| 76 scoped_refptr<cc::Layer> root(cc::Layer::Create(cc::LayerSettings())); | 75 scoped_refptr<cc::Layer> root(cc::Layer::Create(cc::LayerSettings())); |
| 77 host_->SetRootLayer(root); | 76 host_->SetRootLayer(root); |
| 78 | 77 |
| 79 // For testing, set the dummy Layer. | 78 // For testing, set the dummy Layer. |
| 80 g_dummy_layer_driver.Pointer()->SetParentLayer(root); | 79 g_dummy_layer_driver.Pointer()->SetParentLayer(root); |
| 81 | 80 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 task_runner->PostTask( | 159 task_runner->PostTask( |
| 161 FROM_HERE, | 160 FROM_HERE, |
| 162 base::Bind(base::IgnoreResult(&base::ThreadRestrictions::SetIOAllowed), | 161 base::Bind(base::IgnoreResult(&base::ThreadRestrictions::SetIOAllowed), |
| 163 false)); | 162 false)); |
| 164 // TODO(dtrainor): Determine whether or not we can disallow waiting. | 163 // TODO(dtrainor): Determine whether or not we can disallow waiting. |
| 165 | 164 |
| 166 return task_runner; | 165 return task_runner; |
| 167 } | 166 } |
| 168 | 167 |
| 169 } // namespace blimp | 168 } // namespace blimp |
| OLD | NEW |