| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 params.gpu_memory_buffer_manager = | 168 params.gpu_memory_buffer_manager = |
| 169 context_factory_->GetGpuMemoryBufferManager(); | 169 context_factory_->GetGpuMemoryBufferManager(); |
| 170 params.task_graph_runner = context_factory_->GetTaskGraphRunner(); | 170 params.task_graph_runner = context_factory_->GetTaskGraphRunner(); |
| 171 params.settings = &settings; | 171 params.settings = &settings; |
| 172 params.main_task_runner = task_runner_; | 172 params.main_task_runner = task_runner_; |
| 173 host_ = cc::LayerTreeHost::CreateSingleThreaded(this, ¶ms); | 173 host_ = cc::LayerTreeHost::CreateSingleThreaded(this, ¶ms); |
| 174 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", | 174 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", |
| 175 base::TimeTicks::Now() - before_create); | 175 base::TimeTicks::Now() - before_create); |
| 176 host_->SetRootLayer(root_web_layer_); | 176 host_->SetRootLayer(root_web_layer_); |
| 177 host_->set_surface_id_namespace(surface_id_allocator_->id_namespace()); | 177 host_->set_surface_id_namespace(surface_id_allocator_->id_namespace()); |
| 178 host_->SetLayerTreeHostClientReady(); | 178 host_->SetVisible(true); |
| 179 } | 179 } |
| 180 | 180 |
| 181 Compositor::~Compositor() { | 181 Compositor::~Compositor() { |
| 182 TRACE_EVENT0("shutdown", "Compositor::destructor"); | 182 TRACE_EVENT0("shutdown", "Compositor::destructor"); |
| 183 | 183 |
| 184 CancelCompositorLock(); | 184 CancelCompositorLock(); |
| 185 DCHECK(!compositor_lock_); | 185 DCHECK(!compositor_lock_); |
| 186 | 186 |
| 187 FOR_EACH_OBSERVER(CompositorObserver, observer_list_, | 187 FOR_EACH_OBSERVER(CompositorObserver, observer_list_, |
| 188 OnCompositingShuttingDown(this)); | 188 OnCompositingShuttingDown(this)); |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 observer_list_, | 487 observer_list_, |
| 488 OnCompositingLockStateChanged(this)); | 488 OnCompositingLockStateChanged(this)); |
| 489 } | 489 } |
| 490 | 490 |
| 491 void Compositor::CancelCompositorLock() { | 491 void Compositor::CancelCompositorLock() { |
| 492 if (compositor_lock_) | 492 if (compositor_lock_) |
| 493 compositor_lock_->CancelLock(); | 493 compositor_lock_->CancelLock(); |
| 494 } | 494 } |
| 495 | 495 |
| 496 } // namespace ui | 496 } // namespace ui |
| OLD | NEW |