| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 settings.initial_debug_state.show_replica_screen_space_rects = | 127 settings.initial_debug_state.show_replica_screen_space_rects = |
| 128 command_line->HasSwitch(cc::switches::kUIShowReplicaScreenSpaceRects); | 128 command_line->HasSwitch(cc::switches::kUIShowReplicaScreenSpaceRects); |
| 129 | 129 |
| 130 settings.initial_debug_state.SetRecordRenderingStats( | 130 settings.initial_debug_state.SetRecordRenderingStats( |
| 131 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)); | 131 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)); |
| 132 | 132 |
| 133 settings.impl_side_painting = IsUIImplSidePaintingEnabled(); | 133 settings.impl_side_painting = IsUIImplSidePaintingEnabled(); |
| 134 settings.use_zero_copy = IsUIZeroCopyEnabled(); | 134 settings.use_zero_copy = IsUIZeroCopyEnabled(); |
| 135 settings.use_one_copy = IsUIOneCopyEnabled(); | 135 settings.use_one_copy = IsUIOneCopyEnabled(); |
| 136 settings.use_image_texture_target = context_factory_->GetImageTextureTarget(); | 136 settings.use_image_texture_target = context_factory_->GetImageTextureTarget(); |
| 137 // Note: gathering of pixel refs is only needed when using multiple |
| 138 // raster threads. |
| 139 settings.gather_pixel_refs = false; |
| 137 | 140 |
| 138 base::TimeTicks before_create = base::TimeTicks::Now(); | 141 base::TimeTicks before_create = base::TimeTicks::Now(); |
| 139 host_ = cc::LayerTreeHost::CreateSingleThreaded( | 142 host_ = cc::LayerTreeHost::CreateSingleThreaded( |
| 140 this, this, context_factory_->GetSharedBitmapManager(), | 143 this, this, context_factory_->GetSharedBitmapManager(), |
| 141 context_factory_->GetGpuMemoryBufferManager(), settings, task_runner_, | 144 context_factory_->GetGpuMemoryBufferManager(), |
| 142 nullptr); | 145 context_factory_->GetTaskGraphRunner(), settings, task_runner_, nullptr); |
| 143 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", | 146 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", |
| 144 base::TimeTicks::Now() - before_create); | 147 base::TimeTicks::Now() - before_create); |
| 145 host_->SetRootLayer(root_web_layer_); | 148 host_->SetRootLayer(root_web_layer_); |
| 146 host_->set_surface_id_namespace(surface_id_allocator_->id_namespace()); | 149 host_->set_surface_id_namespace(surface_id_allocator_->id_namespace()); |
| 147 host_->SetLayerTreeHostClientReady(); | 150 host_->SetLayerTreeHostClientReady(); |
| 148 } | 151 } |
| 149 | 152 |
| 150 Compositor::~Compositor() { | 153 Compositor::~Compositor() { |
| 151 TRACE_EVENT0("shutdown", "Compositor::destructor"); | 154 TRACE_EVENT0("shutdown", "Compositor::destructor"); |
| 152 | 155 |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 observer_list_, | 380 observer_list_, |
| 378 OnCompositingLockStateChanged(this)); | 381 OnCompositingLockStateChanged(this)); |
| 379 } | 382 } |
| 380 | 383 |
| 381 void Compositor::CancelCompositorLock() { | 384 void Compositor::CancelCompositorLock() { |
| 382 if (compositor_lock_) | 385 if (compositor_lock_) |
| 383 compositor_lock_->CancelLock(); | 386 compositor_lock_->CancelLock(); |
| 384 } | 387 } |
| 385 | 388 |
| 386 } // namespace ui | 389 } // namespace ui |
| OLD | NEW |