| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 } | 219 } |
| 220 | 220 |
| 221 void Compositor::DisableSwapUntilResize() { | 221 void Compositor::DisableSwapUntilResize() { |
| 222 host_->FinishAllRendering(); | 222 host_->FinishAllRendering(); |
| 223 context_factory_->ResizeDisplay(this, gfx::Size()); | 223 context_factory_->ResizeDisplay(this, gfx::Size()); |
| 224 } | 224 } |
| 225 | 225 |
| 226 void Compositor::SetLatencyInfo(const ui::LatencyInfo& latency_info) { | 226 void Compositor::SetLatencyInfo(const ui::LatencyInfo& latency_info) { |
| 227 scoped_ptr<cc::SwapPromise> swap_promise( | 227 scoped_ptr<cc::SwapPromise> swap_promise( |
| 228 new cc::LatencyInfoSwapPromise(latency_info)); | 228 new cc::LatencyInfoSwapPromise(latency_info)); |
| 229 host_->QueueSwapPromise(swap_promise.Pass()); | 229 host_->QueuePromise(swap_promise.Pass()); |
| 230 } | 230 } |
| 231 | 231 |
| 232 void Compositor::SetScaleAndSize(float scale, const gfx::Size& size_in_pixel) { | 232 void Compositor::SetScaleAndSize(float scale, const gfx::Size& size_in_pixel) { |
| 233 DCHECK_GT(scale, 0); | 233 DCHECK_GT(scale, 0); |
| 234 if (!size_in_pixel.IsEmpty()) { | 234 if (!size_in_pixel.IsEmpty()) { |
| 235 size_ = size_in_pixel; | 235 size_ = size_in_pixel; |
| 236 host_->SetViewportSize(size_in_pixel); | 236 host_->SetViewportSize(size_in_pixel); |
| 237 root_web_layer_->SetBounds(size_in_pixel); | 237 root_web_layer_->SetBounds(size_in_pixel); |
| 238 context_factory_->ResizeDisplay(this, size_in_pixel); | 238 context_factory_->ResizeDisplay(this, size_in_pixel); |
| 239 } | 239 } |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 observer_list_, | 425 observer_list_, |
| 426 OnCompositingLockStateChanged(this)); | 426 OnCompositingLockStateChanged(this)); |
| 427 } | 427 } |
| 428 | 428 |
| 429 void Compositor::CancelCompositorLock() { | 429 void Compositor::CancelCompositorLock() { |
| 430 if (compositor_lock_) | 430 if (compositor_lock_) |
| 431 compositor_lock_->CancelLock(); | 431 compositor_lock_->CancelLock(); |
| 432 } | 432 } |
| 433 | 433 |
| 434 } // namespace ui | 434 } // namespace ui |
| OLD | NEW |