| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 settings.impl_side_painting = IsUIImplSidePaintingEnabled(); | 156 settings.impl_side_painting = IsUIImplSidePaintingEnabled(); |
| 157 settings.use_zero_copy = IsUIZeroCopyEnabled(); | 157 settings.use_zero_copy = IsUIZeroCopyEnabled(); |
| 158 settings.single_thread_proxy_scheduler = false; | 158 settings.single_thread_proxy_scheduler = false; |
| 159 | 159 |
| 160 base::TimeTicks before_create = base::TimeTicks::Now(); | 160 base::TimeTicks before_create = base::TimeTicks::Now(); |
| 161 if (compositor_thread_loop_.get()) { | 161 if (compositor_thread_loop_.get()) { |
| 162 host_ = cc::LayerTreeHost::CreateThreaded( | 162 host_ = cc::LayerTreeHost::CreateThreaded( |
| 163 this, | 163 this, |
| 164 context_factory_->GetSharedBitmapManager(), | 164 context_factory_->GetSharedBitmapManager(), |
| 165 context_factory_->GetGpuMemoryBufferManager(), |
| 165 settings, | 166 settings, |
| 166 task_runner_, | 167 task_runner_, |
| 167 compositor_thread_loop_); | 168 compositor_thread_loop_); |
| 168 } else { | 169 } else { |
| 169 host_ = cc::LayerTreeHost::CreateSingleThreaded( | 170 host_ = cc::LayerTreeHost::CreateSingleThreaded( |
| 170 this, | 171 this, |
| 171 this, | 172 this, |
| 172 context_factory_->GetSharedBitmapManager(), | 173 context_factory_->GetSharedBitmapManager(), |
| 174 context_factory_->GetGpuMemoryBufferManager(), |
| 173 settings, | 175 settings, |
| 174 task_runner_); | 176 task_runner_); |
| 175 } | 177 } |
| 176 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", | 178 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", |
| 177 base::TimeTicks::Now() - before_create); | 179 base::TimeTicks::Now() - before_create); |
| 178 host_->SetRootLayer(root_web_layer_); | 180 host_->SetRootLayer(root_web_layer_); |
| 179 host_->SetLayerTreeHostClientReady(); | 181 host_->SetLayerTreeHostClientReady(); |
| 180 } | 182 } |
| 181 | 183 |
| 182 Compositor::~Compositor() { | 184 Compositor::~Compositor() { |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 // Call ScheduleDraw() instead of Draw() in order to allow other | 475 // Call ScheduleDraw() instead of Draw() in order to allow other |
| 474 // CompositorObservers to be notified before starting another | 476 // CompositorObservers to be notified before starting another |
| 475 // draw cycle. | 477 // draw cycle. |
| 476 ScheduleDraw(); | 478 ScheduleDraw(); |
| 477 } | 479 } |
| 478 FOR_EACH_OBSERVER( | 480 FOR_EACH_OBSERVER( |
| 479 CompositorObserver, observer_list_, OnCompositingEnded(this)); | 481 CompositorObserver, observer_list_, OnCompositingEnded(this)); |
| 480 } | 482 } |
| 481 | 483 |
| 482 } // namespace ui | 484 } // namespace ui |
| OLD | NEW |