| 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 } | 391 } |
| 392 | 392 |
| 393 bool Compositor::GetScrollOffsetForLayer(int layer_id, | 393 bool Compositor::GetScrollOffsetForLayer(int layer_id, |
| 394 gfx::ScrollOffset* offset) const { | 394 gfx::ScrollOffset* offset) const { |
| 395 return host_->GetInputHandler()->GetScrollOffsetForLayer(layer_id, offset); | 395 return host_->GetInputHandler()->GetScrollOffsetForLayer(layer_id, offset); |
| 396 } | 396 } |
| 397 | 397 |
| 398 void Compositor::SetAuthoritativeVSyncInterval( | 398 void Compositor::SetAuthoritativeVSyncInterval( |
| 399 const base::TimeDelta& interval) { | 399 const base::TimeDelta& interval) { |
| 400 context_factory_->SetAuthoritativeVSyncInterval(this, interval); | 400 context_factory_->SetAuthoritativeVSyncInterval(this, interval); |
| 401 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 401 vsync_manager_->SetAuthoritativeVSyncInterval(interval); |
| 402 cc::switches::kDisableBeginFrameScheduling)) { | 402 } |
| 403 vsync_manager_->SetAuthoritativeVSyncInterval(interval); | 403 |
| 404 } | 404 void Compositor::SetDisplayVSyncParameters(base::TimeTicks timebase, |
| 405 base::TimeDelta interval) { |
| 406 context_factory_->SetDisplayVSyncParameters(this, timebase, interval); |
| 407 vsync_manager_->UpdateVSyncParameters(timebase, interval); |
| 405 } | 408 } |
| 406 | 409 |
| 407 void Compositor::SetAcceleratedWidget(gfx::AcceleratedWidget widget) { | 410 void Compositor::SetAcceleratedWidget(gfx::AcceleratedWidget widget) { |
| 408 // This function should only get called once. | 411 // This function should only get called once. |
| 409 DCHECK(!widget_valid_); | 412 DCHECK(!widget_valid_); |
| 410 widget_ = widget; | 413 widget_ = widget; |
| 411 widget_valid_ = true; | 414 widget_valid_ = true; |
| 412 if (output_surface_requested_) | 415 if (output_surface_requested_) |
| 413 context_factory_->CreateOutputSurface(weak_ptr_factory_.GetWeakPtr()); | 416 context_factory_->CreateOutputSurface(weak_ptr_factory_.GetWeakPtr()); |
| 414 } | 417 } |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 observer_list_, | 583 observer_list_, |
| 581 OnCompositingLockStateChanged(this)); | 584 OnCompositingLockStateChanged(this)); |
| 582 } | 585 } |
| 583 | 586 |
| 584 void Compositor::CancelCompositorLock() { | 587 void Compositor::CancelCompositorLock() { |
| 585 if (compositor_lock_) | 588 if (compositor_lock_) |
| 586 compositor_lock_->CancelLock(); | 589 compositor_lock_->CancelLock(); |
| 587 } | 590 } |
| 588 | 591 |
| 589 } // namespace ui | 592 } // namespace ui |
| OLD | NEW |