| 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 | 138 |
| 139 base::TimeTicks before_create = base::TimeTicks::Now(); | 139 base::TimeTicks before_create = base::TimeTicks::Now(); |
| 140 if (compositor_thread_loop_) { | 140 if (compositor_thread_loop_) { |
| 141 host_ = cc::LayerTreeHost::CreateThreaded( | 141 host_ = cc::LayerTreeHost::CreateThreaded( |
| 142 this, | 142 this, |
| 143 context_factory_->GetSharedBitmapManager(), | 143 context_factory_->GetSharedBitmapManager(), |
| 144 settings, | 144 settings, |
| 145 base::MessageLoopProxy::current(), |
| 145 compositor_thread_loop_); | 146 compositor_thread_loop_); |
| 146 } else { | 147 } else { |
| 147 host_ = cc::LayerTreeHost::CreateSingleThreaded( | 148 host_ = cc::LayerTreeHost::CreateSingleThreaded( |
| 148 this, this, context_factory_->GetSharedBitmapManager(), settings); | 149 this, |
| 150 this, |
| 151 context_factory_->GetSharedBitmapManager(), |
| 152 settings, |
| 153 base::MessageLoopProxy::current()); |
| 149 } | 154 } |
| 150 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", | 155 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", |
| 151 base::TimeTicks::Now() - before_create); | 156 base::TimeTicks::Now() - before_create); |
| 152 host_->SetRootLayer(root_web_layer_); | 157 host_->SetRootLayer(root_web_layer_); |
| 153 host_->SetLayerTreeHostClientReady(); | 158 host_->SetLayerTreeHostClientReady(); |
| 154 } | 159 } |
| 155 | 160 |
| 156 Compositor::~Compositor() { | 161 Compositor::~Compositor() { |
| 157 TRACE_EVENT0("shutdown", "Compositor::destructor"); | 162 TRACE_EVENT0("shutdown", "Compositor::destructor"); |
| 158 | 163 |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 // CompositorObservers to be notified before starting another | 409 // CompositorObservers to be notified before starting another |
| 405 // draw cycle. | 410 // draw cycle. |
| 406 ScheduleDraw(); | 411 ScheduleDraw(); |
| 407 } | 412 } |
| 408 FOR_EACH_OBSERVER(CompositorObserver, | 413 FOR_EACH_OBSERVER(CompositorObserver, |
| 409 observer_list_, | 414 observer_list_, |
| 410 OnCompositingEnded(this)); | 415 OnCompositingEnded(this)); |
| 411 } | 416 } |
| 412 | 417 |
| 413 } // namespace ui | 418 } // namespace ui |
| OLD | NEW |