| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 settings.use_one_copy = IsUIOneCopyEnabled(); | 133 settings.use_one_copy = IsUIOneCopyEnabled(); |
| 134 settings.use_image_texture_target = context_factory_->GetImageTextureTarget(); | 134 settings.use_image_texture_target = context_factory_->GetImageTextureTarget(); |
| 135 // Note: gathering of pixel refs is only needed when using multiple | 135 // Note: gathering of pixel refs is only needed when using multiple |
| 136 // raster threads. | 136 // raster threads. |
| 137 settings.gather_pixel_refs = false; | 137 settings.gather_pixel_refs = false; |
| 138 | 138 |
| 139 settings.use_compositor_animation_timelines = | 139 settings.use_compositor_animation_timelines = |
| 140 command_line->HasSwitch(switches::kUIEnableCompositorAnimationTimelines); | 140 command_line->HasSwitch(switches::kUIEnableCompositorAnimationTimelines); |
| 141 | 141 |
| 142 base::TimeTicks before_create = base::TimeTicks::Now(); | 142 base::TimeTicks before_create = base::TimeTicks::Now(); |
| 143 host_ = cc::LayerTreeHost::CreateSingleThreaded( | 143 |
| 144 this, this, context_factory_->GetSharedBitmapManager(), | 144 cc::LayerTreeHost::InitParams params; |
| 145 context_factory_->GetGpuMemoryBufferManager(), | 145 params.client = this; |
| 146 context_factory_->GetTaskGraphRunner(), settings, task_runner_, nullptr); | 146 params.shared_bitmap_manager = context_factory_->GetSharedBitmapManager(); |
| 147 params.gpu_memory_buffer_manager = |
| 148 context_factory_->GetGpuMemoryBufferManager(); |
| 149 params.task_graph_runner = context_factory_->GetTaskGraphRunner(); |
| 150 params.settings = &settings; |
| 151 params.main_task_runner = task_runner_; |
| 152 host_ = cc::LayerTreeHost::CreateSingleThreaded(this, ¶ms); |
| 147 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", | 153 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", |
| 148 base::TimeTicks::Now() - before_create); | 154 base::TimeTicks::Now() - before_create); |
| 149 host_->SetRootLayer(root_web_layer_); | 155 host_->SetRootLayer(root_web_layer_); |
| 150 host_->set_surface_id_namespace(surface_id_allocator_->id_namespace()); | 156 host_->set_surface_id_namespace(surface_id_allocator_->id_namespace()); |
| 151 host_->SetLayerTreeHostClientReady(); | 157 host_->SetLayerTreeHostClientReady(); |
| 152 } | 158 } |
| 153 | 159 |
| 154 Compositor::~Compositor() { | 160 Compositor::~Compositor() { |
| 155 TRACE_EVENT0("shutdown", "Compositor::destructor"); | 161 TRACE_EVENT0("shutdown", "Compositor::destructor"); |
| 156 | 162 |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 observer_list_, | 431 observer_list_, |
| 426 OnCompositingLockStateChanged(this)); | 432 OnCompositingLockStateChanged(this)); |
| 427 } | 433 } |
| 428 | 434 |
| 429 void Compositor::CancelCompositorLock() { | 435 void Compositor::CancelCompositorLock() { |
| 430 if (compositor_lock_) | 436 if (compositor_lock_) |
| 431 compositor_lock_->CancelLock(); | 437 compositor_lock_->CancelLock(); |
| 432 } | 438 } |
| 433 | 439 |
| 434 } // namespace ui | 440 } // namespace ui |
| OLD | NEW |