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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 context_factory_->SetAuthoritativeVSyncInterval(this, interval); | 367 context_factory_->SetAuthoritativeVSyncInterval(this, interval); |
368 vsync_manager_->SetAuthoritativeVSyncInterval(interval); | 368 vsync_manager_->SetAuthoritativeVSyncInterval(interval); |
369 } | 369 } |
370 | 370 |
371 void Compositor::SetDisplayVSyncParameters(base::TimeTicks timebase, | 371 void Compositor::SetDisplayVSyncParameters(base::TimeTicks timebase, |
372 base::TimeDelta interval) { | 372 base::TimeDelta interval) { |
373 context_factory_->SetDisplayVSyncParameters(this, timebase, interval); | 373 context_factory_->SetDisplayVSyncParameters(this, timebase, interval); |
374 vsync_manager_->UpdateVSyncParameters(timebase, interval); | 374 vsync_manager_->UpdateVSyncParameters(timebase, interval); |
375 } | 375 } |
376 | 376 |
| 377 void Compositor::SwapBeginFrameSource( |
| 378 std::unique_ptr<cc::BeginFrameSource>* begin_frame_source) { |
| 379 context_factory_->SwapBeginFrameSource(this, begin_frame_source); |
| 380 } |
| 381 |
377 void Compositor::SetAcceleratedWidget(gfx::AcceleratedWidget widget) { | 382 void Compositor::SetAcceleratedWidget(gfx::AcceleratedWidget widget) { |
378 // This function should only get called once. | 383 // This function should only get called once. |
379 DCHECK(!widget_valid_); | 384 DCHECK(!widget_valid_); |
380 widget_ = widget; | 385 widget_ = widget; |
381 widget_valid_ = true; | 386 widget_valid_ = true; |
382 if (compositor_frame_sink_requested_) | 387 if (compositor_frame_sink_requested_) |
383 context_factory_->CreateCompositorFrameSink(weak_ptr_factory_.GetWeakPtr()); | 388 context_factory_->CreateCompositorFrameSink(weak_ptr_factory_.GetWeakPtr()); |
384 } | 389 } |
385 | 390 |
386 gfx::AcceleratedWidget Compositor::ReleaseAcceleratedWidget() { | 391 gfx::AcceleratedWidget Compositor::ReleaseAcceleratedWidget() { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 for (auto& observer : observer_list_) | 531 for (auto& observer : observer_list_) |
527 observer.OnCompositingLockStateChanged(this); | 532 observer.OnCompositingLockStateChanged(this); |
528 } | 533 } |
529 | 534 |
530 void Compositor::CancelCompositorLock() { | 535 void Compositor::CancelCompositorLock() { |
531 if (compositor_lock_) | 536 if (compositor_lock_) |
532 compositor_lock_->CancelLock(); | 537 compositor_lock_->CancelLock(); |
533 } | 538 } |
534 | 539 |
535 } // namespace ui | 540 } // namespace ui |
OLD | NEW |