| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 compositor_thread_loop_, | 153 compositor_thread_loop_, |
| 154 nullptr); | 154 nullptr); |
| 155 } else { | 155 } else { |
| 156 host_ = cc::LayerTreeHost::CreateSingleThreaded( | 156 host_ = cc::LayerTreeHost::CreateSingleThreaded( |
| 157 this, | 157 this, |
| 158 this, | 158 this, |
| 159 context_factory_->GetSharedBitmapManager(), | 159 context_factory_->GetSharedBitmapManager(), |
| 160 context_factory_->GetGpuMemoryBufferManager(), | 160 context_factory_->GetGpuMemoryBufferManager(), |
| 161 settings, | 161 settings, |
| 162 task_runner_, | 162 task_runner_, |
| 163 nullptr, |
| 163 nullptr); | 164 nullptr); |
| 164 } | 165 } |
| 165 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", | 166 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", |
| 166 base::TimeTicks::Now() - before_create); | 167 base::TimeTicks::Now() - before_create); |
| 167 host_->SetRootLayer(root_web_layer_); | 168 host_->SetRootLayer(root_web_layer_); |
| 168 host_->set_surface_id_namespace(surface_id_allocator_->id_namespace()); | 169 host_->set_surface_id_namespace(surface_id_allocator_->id_namespace()); |
| 169 host_->SetLayerTreeHostClientReady(); | 170 host_->SetLayerTreeHostClientReady(); |
| 170 } | 171 } |
| 171 | 172 |
| 172 Compositor::~Compositor() { | 173 Compositor::~Compositor() { |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 // Call ScheduleDraw() instead of Draw() in order to allow other | 472 // Call ScheduleDraw() instead of Draw() in order to allow other |
| 472 // CompositorObservers to be notified before starting another | 473 // CompositorObservers to be notified before starting another |
| 473 // draw cycle. | 474 // draw cycle. |
| 474 ScheduleDraw(); | 475 ScheduleDraw(); |
| 475 } | 476 } |
| 476 FOR_EACH_OBSERVER( | 477 FOR_EACH_OBSERVER( |
| 477 CompositorObserver, observer_list_, OnCompositingEnded(this)); | 478 CompositorObserver, observer_list_, OnCompositingEnded(this)); |
| 478 } | 479 } |
| 479 | 480 |
| 480 } // namespace ui | 481 } // namespace ui |
| OLD | NEW |