OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/app/compositor/browser_compositor.h" | 5 #include "blimp/client/app/compositor/browser_compositor.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
10 #include "blimp/client/public/compositor/compositor_dependencies.h" | 10 #include "blimp/client/public/compositor/compositor_dependencies.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 compositor_dependencies_->GetGpuMemoryBufferManager(); | 84 compositor_dependencies_->GetGpuMemoryBufferManager(); |
85 params.task_graph_runner = g_task_graph_runner.Pointer(); | 85 params.task_graph_runner = g_task_graph_runner.Pointer(); |
86 cc::LayerTreeSettings settings; | 86 cc::LayerTreeSettings settings; |
87 params.settings = &settings; | 87 params.settings = &settings; |
88 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); | 88 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); |
89 params.animation_host = cc::AnimationHost::CreateMainInstance(); | 89 params.animation_host = cc::AnimationHost::CreateMainInstance(); |
90 host_ = cc::LayerTreeHost::CreateSingleThreaded(this, ¶ms); | 90 host_ = cc::LayerTreeHost::CreateSingleThreaded(this, ¶ms); |
91 | 91 |
92 root_layer_->SetBackgroundColor(SK_ColorWHITE); | 92 root_layer_->SetBackgroundColor(SK_ColorWHITE); |
93 host_->GetLayerTree()->SetRootLayer(root_layer_); | 93 host_->GetLayerTree()->SetRootLayer(root_layer_); |
94 host_->SetSurfaceClientId(surface_id_allocator_->client_id()); | 94 host_->GetSurfaceSequenceGenerator()->set_surface_client_id( |
| 95 surface_id_allocator_->client_id()); |
95 } | 96 } |
96 | 97 |
97 BrowserCompositor::~BrowserCompositor() { | 98 BrowserCompositor::~BrowserCompositor() { |
98 compositor_dependencies_->GetSurfaceManager()->InvalidateSurfaceClientId( | 99 compositor_dependencies_->GetSurfaceManager()->InvalidateSurfaceClientId( |
99 surface_id_allocator_->client_id()); | 100 surface_id_allocator_->client_id()); |
100 } | 101 } |
101 | 102 |
102 void BrowserCompositor::SetContentLayer( | 103 void BrowserCompositor::SetContentLayer( |
103 scoped_refptr<cc::Layer> content_layer) { | 104 scoped_refptr<cc::Layer> content_layer) { |
104 root_layer_->RemoveAllChildren(); | 105 root_layer_->RemoveAllChildren(); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 base::MakeUnique<cc::SurfaceDisplayOutputSurface>( | 200 base::MakeUnique<cc::SurfaceDisplayOutputSurface>( |
200 compositor_dependencies_->GetSurfaceManager(), | 201 compositor_dependencies_->GetSurfaceManager(), |
201 surface_id_allocator_.get(), display_.get(), context_provider, | 202 surface_id_allocator_.get(), display_.get(), context_provider, |
202 nullptr); | 203 nullptr); |
203 | 204 |
204 host_->SetOutputSurface(std::move(delegated_output_surface)); | 205 host_->SetOutputSurface(std::move(delegated_output_surface)); |
205 } | 206 } |
206 | 207 |
207 } // namespace client | 208 } // namespace client |
208 } // namespace blimp | 209 } // namespace blimp |
OLD | NEW |