| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 135 |
| 136 settings.impl_side_painting = IsUIImplSidePaintingEnabled(); | 136 settings.impl_side_painting = IsUIImplSidePaintingEnabled(); |
| 137 settings.use_zero_copy = IsUIZeroCopyEnabled(); | 137 settings.use_zero_copy = IsUIZeroCopyEnabled(); |
| 138 settings.single_thread_proxy_scheduler = false; | 138 settings.single_thread_proxy_scheduler = false; |
| 139 | 139 |
| 140 base::TimeTicks before_create = base::TimeTicks::Now(); | 140 base::TimeTicks before_create = base::TimeTicks::Now(); |
| 141 if (compositor_thread_loop_.get()) { | 141 if (compositor_thread_loop_.get()) { |
| 142 host_ = cc::LayerTreeHost::CreateThreaded( | 142 host_ = cc::LayerTreeHost::CreateThreaded( |
| 143 this, | 143 this, |
| 144 context_factory_->GetSharedBitmapManager(), | 144 context_factory_->GetSharedBitmapManager(), |
| 145 context_factory_->GetGpuMemoryBufferManager(), |
| 145 settings, | 146 settings, |
| 146 task_runner_, | 147 task_runner_, |
| 147 compositor_thread_loop_); | 148 compositor_thread_loop_); |
| 148 } else { | 149 } else { |
| 149 host_ = cc::LayerTreeHost::CreateSingleThreaded( | 150 host_ = cc::LayerTreeHost::CreateSingleThreaded( |
| 150 this, | 151 this, |
| 151 this, | 152 this, |
| 152 context_factory_->GetSharedBitmapManager(), | 153 context_factory_->GetSharedBitmapManager(), |
| 154 context_factory_->GetGpuMemoryBufferManager(), |
| 153 settings, | 155 settings, |
| 154 task_runner_); | 156 task_runner_); |
| 155 } | 157 } |
| 156 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", | 158 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", |
| 157 base::TimeTicks::Now() - before_create); | 159 base::TimeTicks::Now() - before_create); |
| 158 host_->SetRootLayer(root_web_layer_); | 160 host_->SetRootLayer(root_web_layer_); |
| 159 host_->SetLayerTreeHostClientReady(); | 161 host_->SetLayerTreeHostClientReady(); |
| 160 } | 162 } |
| 161 | 163 |
| 162 Compositor::~Compositor() { | 164 Compositor::~Compositor() { |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 // Call ScheduleDraw() instead of Draw() in order to allow other | 445 // Call ScheduleDraw() instead of Draw() in order to allow other |
| 444 // CompositorObservers to be notified before starting another | 446 // CompositorObservers to be notified before starting another |
| 445 // draw cycle. | 447 // draw cycle. |
| 446 ScheduleDraw(); | 448 ScheduleDraw(); |
| 447 } | 449 } |
| 448 FOR_EACH_OBSERVER( | 450 FOR_EACH_OBSERVER( |
| 449 CompositorObserver, observer_list_, OnCompositingEnded(this)); | 451 CompositorObserver, observer_list_, OnCompositingEnded(this)); |
| 450 } | 452 } |
| 451 | 453 |
| 452 } // namespace ui | 454 } // namespace ui |
| OLD | NEW |