| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/compositor/compositor.h" | 5 #include "ui/compositor/compositor.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 params.gpu_memory_buffer_manager = | 170 params.gpu_memory_buffer_manager = |
| 171 context_factory_->GetGpuMemoryBufferManager(); | 171 context_factory_->GetGpuMemoryBufferManager(); |
| 172 params.task_graph_runner = context_factory_->GetTaskGraphRunner(); | 172 params.task_graph_runner = context_factory_->GetTaskGraphRunner(); |
| 173 params.settings = &settings; | 173 params.settings = &settings; |
| 174 params.main_task_runner = task_runner_; | 174 params.main_task_runner = task_runner_; |
| 175 host_ = cc::LayerTreeHost::CreateSingleThreaded(this, ¶ms); | 175 host_ = cc::LayerTreeHost::CreateSingleThreaded(this, ¶ms); |
| 176 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", | 176 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", |
| 177 base::TimeTicks::Now() - before_create); | 177 base::TimeTicks::Now() - before_create); |
| 178 host_->SetRootLayer(root_web_layer_); | 178 host_->SetRootLayer(root_web_layer_); |
| 179 host_->set_surface_id_namespace(surface_id_allocator_->id_namespace()); | 179 host_->set_surface_id_namespace(surface_id_allocator_->id_namespace()); |
| 180 host_->SetLayerTreeHostClientReady(); | |
| 181 } | 180 } |
| 182 | 181 |
| 183 Compositor::~Compositor() { | 182 Compositor::~Compositor() { |
| 184 TRACE_EVENT0("shutdown", "Compositor::destructor"); | 183 TRACE_EVENT0("shutdown", "Compositor::destructor"); |
| 185 | 184 |
| 186 CancelCompositorLock(); | 185 CancelCompositorLock(); |
| 187 DCHECK(!compositor_lock_); | 186 DCHECK(!compositor_lock_); |
| 188 | 187 |
| 189 FOR_EACH_OBSERVER(CompositorObserver, observer_list_, | 188 FOR_EACH_OBSERVER(CompositorObserver, observer_list_, |
| 190 OnCompositingShuttingDown(this)); | 189 OnCompositingShuttingDown(this)); |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 observer_list_, | 477 observer_list_, |
| 479 OnCompositingLockStateChanged(this)); | 478 OnCompositingLockStateChanged(this)); |
| 480 } | 479 } |
| 481 | 480 |
| 482 void Compositor::CancelCompositorLock() { | 481 void Compositor::CancelCompositorLock() { |
| 483 if (compositor_lock_) | 482 if (compositor_lock_) |
| 484 compositor_lock_->CancelLock(); | 483 compositor_lock_->CancelLock(); |
| 485 } | 484 } |
| 486 | 485 |
| 487 } // namespace ui | 486 } // namespace ui |
| OLD | NEW |