| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 base::TimeTicks before_create = base::TimeTicks::Now(); | 200 base::TimeTicks before_create = base::TimeTicks::Now(); |
| 201 | 201 |
| 202 animation_host_ = cc::AnimationHost::CreateMainInstance(); | 202 animation_host_ = cc::AnimationHost::CreateMainInstance(); |
| 203 | 203 |
| 204 cc::LayerTreeHostInProcess::InitParams params; | 204 cc::LayerTreeHostInProcess::InitParams params; |
| 205 params.client = this; | 205 params.client = this; |
| 206 params.task_graph_runner = context_factory_->GetTaskGraphRunner(); | 206 params.task_graph_runner = context_factory_->GetTaskGraphRunner(); |
| 207 params.settings = &settings; | 207 params.settings = &settings; |
| 208 params.main_task_runner = task_runner_; | 208 params.main_task_runner = task_runner_; |
| 209 params.mutator_host = animation_host_.get(); | 209 params.mutator_host = animation_host_.get(); |
| 210 // TODO(vmpstr): For now, we don't need a task runner in the UI since we don't |
| 211 // use image queue here. |
| 212 params.image_worker_task_runner = nullptr; |
| 210 host_ = cc::LayerTreeHostInProcess::CreateSingleThreaded(this, ¶ms); | 213 host_ = cc::LayerTreeHostInProcess::CreateSingleThreaded(this, ¶ms); |
| 211 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", | 214 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", |
| 212 base::TimeTicks::Now() - before_create); | 215 base::TimeTicks::Now() - before_create); |
| 213 | 216 |
| 214 animation_timeline_ = | 217 animation_timeline_ = |
| 215 cc::AnimationTimeline::Create(cc::AnimationIdProvider::NextTimelineId()); | 218 cc::AnimationTimeline::Create(cc::AnimationIdProvider::NextTimelineId()); |
| 216 animation_host_->AddAnimationTimeline(animation_timeline_.get()); | 219 animation_host_->AddAnimationTimeline(animation_timeline_.get()); |
| 217 | 220 |
| 218 host_->GetLayerTree()->SetRootLayer(root_web_layer_); | 221 host_->GetLayerTree()->SetRootLayer(root_web_layer_); |
| 219 host_->SetFrameSinkId(frame_sink_id_); | 222 host_->SetFrameSinkId(frame_sink_id_); |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 for (auto& observer : observer_list_) | 567 for (auto& observer : observer_list_) |
| 565 observer.OnCompositingLockStateChanged(this); | 568 observer.OnCompositingLockStateChanged(this); |
| 566 } | 569 } |
| 567 | 570 |
| 568 void Compositor::CancelCompositorLock() { | 571 void Compositor::CancelCompositorLock() { |
| 569 if (compositor_lock_) | 572 if (compositor_lock_) |
| 570 compositor_lock_->CancelLock(); | 573 compositor_lock_->CancelLock(); |
| 571 } | 574 } |
| 572 | 575 |
| 573 } // namespace ui | 576 } // namespace ui |
| OLD | NEW |