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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 137 // Note: gathering of pixel refs is only needed when using multiple |
138 // raster threads. | 138 // raster threads. |
139 settings.gather_pixel_refs = false; | 139 settings.gather_pixel_refs = false; |
140 | 140 |
| 141 settings.use_compositor_animation_timelines = |
| 142 command_line->HasSwitch(switches::kUIEnableCompositorAnimationTimelines); |
| 143 |
141 base::TimeTicks before_create = base::TimeTicks::Now(); | 144 base::TimeTicks before_create = base::TimeTicks::Now(); |
142 host_ = cc::LayerTreeHost::CreateSingleThreaded( | 145 host_ = cc::LayerTreeHost::CreateSingleThreaded( |
143 this, this, context_factory_->GetSharedBitmapManager(), | 146 this, this, context_factory_->GetSharedBitmapManager(), |
144 context_factory_->GetGpuMemoryBufferManager(), | 147 context_factory_->GetGpuMemoryBufferManager(), |
145 context_factory_->GetTaskGraphRunner(), settings, task_runner_, nullptr); | 148 context_factory_->GetTaskGraphRunner(), settings, task_runner_, nullptr); |
146 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", | 149 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", |
147 base::TimeTicks::Now() - before_create); | 150 base::TimeTicks::Now() - before_create); |
148 host_->SetRootLayer(root_web_layer_); | 151 host_->SetRootLayer(root_web_layer_); |
149 host_->set_surface_id_namespace(surface_id_allocator_->id_namespace()); | 152 host_->set_surface_id_namespace(surface_id_allocator_->id_namespace()); |
150 host_->SetLayerTreeHostClientReady(); | 153 host_->SetLayerTreeHostClientReady(); |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 observer_list_, | 420 observer_list_, |
418 OnCompositingLockStateChanged(this)); | 421 OnCompositingLockStateChanged(this)); |
419 } | 422 } |
420 | 423 |
421 void Compositor::CancelCompositorLock() { | 424 void Compositor::CancelCompositorLock() { |
422 if (compositor_lock_) | 425 if (compositor_lock_) |
423 compositor_lock_->CancelLock(); | 426 compositor_lock_->CancelLock(); |
424 } | 427 } |
425 | 428 |
426 } // namespace ui | 429 } // namespace ui |
OLD | NEW |