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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)); | 121 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)); |
122 | 122 |
123 settings.impl_side_painting = IsUIImplSidePaintingEnabled(); | 123 settings.impl_side_painting = IsUIImplSidePaintingEnabled(); |
124 settings.use_zero_copy = IsUIZeroCopyEnabled(); | 124 settings.use_zero_copy = IsUIZeroCopyEnabled(); |
125 | 125 |
126 base::TimeTicks before_create = base::TimeTicks::Now(); | 126 base::TimeTicks before_create = base::TimeTicks::Now(); |
127 if (compositor_thread_loop_.get()) { | 127 if (compositor_thread_loop_.get()) { |
128 host_ = cc::LayerTreeHost::CreateThreaded( | 128 host_ = cc::LayerTreeHost::CreateThreaded( |
129 this, | 129 this, |
130 context_factory_->GetSharedBitmapManager(), | 130 context_factory_->GetSharedBitmapManager(), |
| 131 context_factory_->GetGpuMemoryBufferManager(), |
131 settings, | 132 settings, |
132 task_runner_, | 133 task_runner_, |
133 compositor_thread_loop_); | 134 compositor_thread_loop_); |
134 } else { | 135 } else { |
135 host_ = cc::LayerTreeHost::CreateSingleThreaded( | 136 host_ = cc::LayerTreeHost::CreateSingleThreaded( |
136 this, | 137 this, |
137 this, | 138 this, |
138 context_factory_->GetSharedBitmapManager(), | 139 context_factory_->GetSharedBitmapManager(), |
| 140 context_factory_->GetGpuMemoryBufferManager(), |
139 settings, | 141 settings, |
140 task_runner_); | 142 task_runner_); |
141 } | 143 } |
142 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", | 144 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", |
143 base::TimeTicks::Now() - before_create); | 145 base::TimeTicks::Now() - before_create); |
144 host_->SetRootLayer(root_web_layer_); | 146 host_->SetRootLayer(root_web_layer_); |
145 host_->SetLayerTreeHostClientReady(); | 147 host_->SetLayerTreeHostClientReady(); |
146 } | 148 } |
147 | 149 |
148 Compositor::~Compositor() { | 150 Compositor::~Compositor() { |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 observer_list_, | 366 observer_list_, |
365 OnCompositingLockStateChanged(this)); | 367 OnCompositingLockStateChanged(this)); |
366 } | 368 } |
367 | 369 |
368 void Compositor::CancelCompositorLock() { | 370 void Compositor::CancelCompositorLock() { |
369 if (compositor_lock_) | 371 if (compositor_lock_) |
370 compositor_lock_->CancelLock(); | 372 compositor_lock_->CancelLock(); |
371 } | 373 } |
372 | 374 |
373 } // namespace ui | 375 } // namespace ui |
OLD | NEW |