| 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 } | 364 } |
| 365 | 365 |
| 366 void Compositor::SetAuthoritativeVSyncInterval( | 366 void Compositor::SetAuthoritativeVSyncInterval( |
| 367 const base::TimeDelta& interval) { | 367 const base::TimeDelta& interval) { |
| 368 context_factory_->SetAuthoritativeVSyncInterval(this, interval); | 368 context_factory_->SetAuthoritativeVSyncInterval(this, interval); |
| 369 vsync_manager_->SetAuthoritativeVSyncInterval(interval); | 369 vsync_manager_->SetAuthoritativeVSyncInterval(interval); |
| 370 } | 370 } |
| 371 | 371 |
| 372 void Compositor::SetDisplayVSyncParameters(base::TimeTicks timebase, | 372 void Compositor::SetDisplayVSyncParameters(base::TimeTicks timebase, |
| 373 base::TimeDelta interval) { | 373 base::TimeDelta interval) { |
| 374 if (interval.is_zero()) { |
| 375 // TODO(brianderson): We should not be receiving 0 intervals. |
| 376 interval = cc::BeginFrameArgs::DefaultInterval(); |
| 377 } |
| 378 |
| 374 context_factory_->SetDisplayVSyncParameters(this, timebase, interval); | 379 context_factory_->SetDisplayVSyncParameters(this, timebase, interval); |
| 375 vsync_manager_->UpdateVSyncParameters(timebase, interval); | 380 vsync_manager_->UpdateVSyncParameters(timebase, interval); |
| 376 } | 381 } |
| 377 | 382 |
| 378 void Compositor::SetAcceleratedWidget(gfx::AcceleratedWidget widget) { | 383 void Compositor::SetAcceleratedWidget(gfx::AcceleratedWidget widget) { |
| 379 // This function should only get called once. | 384 // This function should only get called once. |
| 380 DCHECK(!widget_valid_); | 385 DCHECK(!widget_valid_); |
| 381 widget_ = widget; | 386 widget_ = widget; |
| 382 widget_valid_ = true; | 387 widget_valid_ = true; |
| 383 if (compositor_frame_sink_requested_) | 388 if (compositor_frame_sink_requested_) |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 for (auto& observer : observer_list_) | 532 for (auto& observer : observer_list_) |
| 528 observer.OnCompositingLockStateChanged(this); | 533 observer.OnCompositingLockStateChanged(this); |
| 529 } | 534 } |
| 530 | 535 |
| 531 void Compositor::CancelCompositorLock() { | 536 void Compositor::CancelCompositorLock() { |
| 532 if (compositor_lock_) | 537 if (compositor_lock_) |
| 533 compositor_lock_->CancelLock(); | 538 compositor_lock_->CancelLock(); |
| 534 } | 539 } |
| 535 | 540 |
| 536 } // namespace ui | 541 } // namespace ui |
| OLD | NEW |