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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 void Compositor::DidCompleteSwapBuffers() { | 390 void Compositor::DidCompleteSwapBuffers() { |
391 if (g_compositor_thread) { | 391 if (g_compositor_thread) { |
392 NotifyEnd(); | 392 NotifyEnd(); |
393 } else { | 393 } else { |
394 DCHECK_EQ(swap_state_, SWAP_POSTED); | 394 DCHECK_EQ(swap_state_, SWAP_POSTED); |
395 NotifyEnd(); | 395 NotifyEnd(); |
396 swap_state_ = SWAP_COMPLETED; | 396 swap_state_ = SWAP_COMPLETED; |
397 } | 397 } |
398 } | 398 } |
399 | 399 |
400 scoped_refptr<cc::ContextProvider> Compositor::OffscreenContextProvider() { | |
401 return ContextFactory::GetInstance()->OffscreenCompositorContextProvider(); | |
402 } | |
403 | |
404 void Compositor::ScheduleComposite() { | 400 void Compositor::ScheduleComposite() { |
405 if (!disable_schedule_composite_) | 401 if (!disable_schedule_composite_) |
406 ScheduleDraw(); | 402 ScheduleDraw(); |
407 } | 403 } |
408 | 404 |
409 void Compositor::ScheduleAnimation() { | 405 void Compositor::ScheduleAnimation() { |
410 ScheduleComposite(); | 406 ScheduleComposite(); |
411 } | 407 } |
412 | 408 |
413 void Compositor::DidPostSwapBuffers() { | 409 void Compositor::DidPostSwapBuffers() { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 // CompositorObservers to be notified before starting another | 472 // CompositorObservers to be notified before starting another |
477 // draw cycle. | 473 // draw cycle. |
478 ScheduleDraw(); | 474 ScheduleDraw(); |
479 } | 475 } |
480 FOR_EACH_OBSERVER(CompositorObserver, | 476 FOR_EACH_OBSERVER(CompositorObserver, |
481 observer_list_, | 477 observer_list_, |
482 OnCompositingEnded(this)); | 478 OnCompositingEnded(this)); |
483 } | 479 } |
484 | 480 |
485 } // namespace ui | 481 } // namespace ui |
OLD | NEW |