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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 host_->SetNeedsRedraw(); | 217 host_->SetNeedsRedraw(); |
218 host_->SetNeedsCommit(); | 218 host_->SetNeedsCommit(); |
219 } | 219 } |
220 | 220 |
221 void Compositor::ScheduleRedrawRect(const gfx::Rect& damage_rect) { | 221 void Compositor::ScheduleRedrawRect(const gfx::Rect& damage_rect) { |
222 // TODO(enne): Make this not commit. See ScheduleFullRedraw. | 222 // TODO(enne): Make this not commit. See ScheduleFullRedraw. |
223 host_->SetNeedsRedrawRect(damage_rect); | 223 host_->SetNeedsRedrawRect(damage_rect); |
224 host_->SetNeedsCommit(); | 224 host_->SetNeedsCommit(); |
225 } | 225 } |
226 | 226 |
| 227 void Compositor::FinishAllRendering() { |
| 228 host_->FinishAllRendering(); |
| 229 } |
| 230 |
227 void Compositor::DisableSwapUntilResize() { | 231 void Compositor::DisableSwapUntilResize() { |
228 host_->FinishAllRendering(); | 232 host_->FinishAllRendering(); |
229 context_factory_->ResizeDisplay(this, gfx::Size()); | 233 context_factory_->ResizeDisplay(this, gfx::Size()); |
230 } | 234 } |
231 | 235 |
232 void Compositor::SetLatencyInfo(const ui::LatencyInfo& latency_info) { | 236 void Compositor::SetLatencyInfo(const ui::LatencyInfo& latency_info) { |
233 scoped_ptr<cc::SwapPromise> swap_promise( | 237 scoped_ptr<cc::SwapPromise> swap_promise( |
234 new cc::LatencyInfoSwapPromise(latency_info)); | 238 new cc::LatencyInfoSwapPromise(latency_info)); |
235 host_->QueueSwapPromise(swap_promise.Pass()); | 239 host_->QueueSwapPromise(swap_promise.Pass()); |
236 } | 240 } |
(...skipping 16 matching lines...) Expand all Loading... |
253 | 257 |
254 void Compositor::SetBackgroundColor(SkColor color) { | 258 void Compositor::SetBackgroundColor(SkColor color) { |
255 host_->set_background_color(color); | 259 host_->set_background_color(color); |
256 ScheduleDraw(); | 260 ScheduleDraw(); |
257 } | 261 } |
258 | 262 |
259 void Compositor::SetVisible(bool visible) { | 263 void Compositor::SetVisible(bool visible) { |
260 host_->SetVisible(visible); | 264 host_->SetVisible(visible); |
261 } | 265 } |
262 | 266 |
| 267 bool Compositor::IsVisible() { |
| 268 return host_->visible(); |
| 269 } |
| 270 |
263 scoped_refptr<CompositorVSyncManager> Compositor::vsync_manager() const { | 271 scoped_refptr<CompositorVSyncManager> Compositor::vsync_manager() const { |
264 return vsync_manager_; | 272 return vsync_manager_; |
265 } | 273 } |
266 | 274 |
267 void Compositor::AddObserver(CompositorObserver* observer) { | 275 void Compositor::AddObserver(CompositorObserver* observer) { |
268 observer_list_.AddObserver(observer); | 276 observer_list_.AddObserver(observer); |
269 } | 277 } |
270 | 278 |
271 void Compositor::RemoveObserver(CompositorObserver* observer) { | 279 void Compositor::RemoveObserver(CompositorObserver* observer) { |
272 observer_list_.RemoveObserver(observer); | 280 observer_list_.RemoveObserver(observer); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 observer_list_, | 410 observer_list_, |
403 OnCompositingLockStateChanged(this)); | 411 OnCompositingLockStateChanged(this)); |
404 } | 412 } |
405 | 413 |
406 void Compositor::CancelCompositorLock() { | 414 void Compositor::CancelCompositorLock() { |
407 if (compositor_lock_) | 415 if (compositor_lock_) |
408 compositor_lock_->CancelLock(); | 416 compositor_lock_->CancelLock(); |
409 } | 417 } |
410 | 418 |
411 } // namespace ui | 419 } // namespace ui |
OLD | NEW |