| 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 host_->animation_host()->RemoveAnimationTimeline(animation_timeline_.get()); | 225 host_->animation_host()->RemoveAnimationTimeline(animation_timeline_.get()); |
| 226 | 226 |
| 227 // Stop all outstanding draws before telling the ContextFactory to tear | 227 // Stop all outstanding draws before telling the ContextFactory to tear |
| 228 // down any contexts that the |host_| may rely upon. | 228 // down any contexts that the |host_| may rely upon. |
| 229 host_.reset(); | 229 host_.reset(); |
| 230 | 230 |
| 231 context_factory_->RemoveCompositor(this); | 231 context_factory_->RemoveCompositor(this); |
| 232 } | 232 } |
| 233 | 233 |
| 234 void Compositor::SetOutputSurface( | 234 void Compositor::SetOutputSurface( |
| 235 scoped_ptr<cc::OutputSurface> output_surface) { | 235 std::unique_ptr<cc::OutputSurface> output_surface) { |
| 236 output_surface_requested_ = false; | 236 output_surface_requested_ = false; |
| 237 host_->SetOutputSurface(std::move(output_surface)); | 237 host_->SetOutputSurface(std::move(output_surface)); |
| 238 } | 238 } |
| 239 | 239 |
| 240 void Compositor::ScheduleDraw() { | 240 void Compositor::ScheduleDraw() { |
| 241 host_->SetNeedsCommit(); | 241 host_->SetNeedsCommit(); |
| 242 } | 242 } |
| 243 | 243 |
| 244 void Compositor::SetRootLayer(Layer* root_layer) { | 244 void Compositor::SetRootLayer(Layer* root_layer) { |
| 245 if (root_layer_ == root_layer) | 245 if (root_layer_ == root_layer) |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 void Compositor::FinishAllRendering() { | 279 void Compositor::FinishAllRendering() { |
| 280 host_->FinishAllRendering(); | 280 host_->FinishAllRendering(); |
| 281 } | 281 } |
| 282 | 282 |
| 283 void Compositor::DisableSwapUntilResize() { | 283 void Compositor::DisableSwapUntilResize() { |
| 284 host_->FinishAllRendering(); | 284 host_->FinishAllRendering(); |
| 285 context_factory_->ResizeDisplay(this, gfx::Size()); | 285 context_factory_->ResizeDisplay(this, gfx::Size()); |
| 286 } | 286 } |
| 287 | 287 |
| 288 void Compositor::SetLatencyInfo(const ui::LatencyInfo& latency_info) { | 288 void Compositor::SetLatencyInfo(const ui::LatencyInfo& latency_info) { |
| 289 scoped_ptr<cc::SwapPromise> swap_promise( | 289 std::unique_ptr<cc::SwapPromise> swap_promise( |
| 290 new cc::LatencyInfoSwapPromise(latency_info)); | 290 new cc::LatencyInfoSwapPromise(latency_info)); |
| 291 host_->QueueSwapPromise(std::move(swap_promise)); | 291 host_->QueueSwapPromise(std::move(swap_promise)); |
| 292 } | 292 } |
| 293 | 293 |
| 294 void Compositor::SetScaleAndSize(float scale, const gfx::Size& size_in_pixel) { | 294 void Compositor::SetScaleAndSize(float scale, const gfx::Size& size_in_pixel) { |
| 295 DCHECK_GT(scale, 0); | 295 DCHECK_GT(scale, 0); |
| 296 if (!size_in_pixel.IsEmpty()) { | 296 if (!size_in_pixel.IsEmpty()) { |
| 297 size_ = size_in_pixel; | 297 size_ = size_in_pixel; |
| 298 host_->SetViewportSize(size_in_pixel); | 298 host_->SetViewportSize(size_in_pixel); |
| 299 root_web_layer_->SetBounds(size_in_pixel); | 299 root_web_layer_->SetBounds(size_in_pixel); |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 observer_list_, | 526 observer_list_, |
| 527 OnCompositingLockStateChanged(this)); | 527 OnCompositingLockStateChanged(this)); |
| 528 } | 528 } |
| 529 | 529 |
| 530 void Compositor::CancelCompositorLock() { | 530 void Compositor::CancelCompositorLock() { |
| 531 if (compositor_lock_) | 531 if (compositor_lock_) |
| 532 compositor_lock_->CancelLock(); | 532 compositor_lock_->CancelLock(); |
| 533 } | 533 } |
| 534 | 534 |
| 535 } // namespace ui | 535 } // namespace ui |
| OLD | NEW |