| 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 } | 257 } |
| 258 | 258 |
| 259 void Compositor::SetVisible(bool visible) { | 259 void Compositor::SetVisible(bool visible) { |
| 260 host_->SetVisible(visible); | 260 host_->SetVisible(visible); |
| 261 } | 261 } |
| 262 | 262 |
| 263 bool Compositor::IsVisible() { | 263 bool Compositor::IsVisible() { |
| 264 return host_->visible(); | 264 return host_->visible(); |
| 265 } | 265 } |
| 266 | 266 |
| 267 void Compositor::SetAuthoritativeVSyncInterval( |
| 268 const base::TimeDelta& interval) { |
| 269 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 270 cc::switches::kEnableBeginFrameScheduling)) { |
| 271 host_->SetAuthoritativeVSyncInterval(interval); |
| 272 return; |
| 273 } |
| 274 |
| 275 vsync_manager_->SetAuthoritativeVSyncInterval(interval); |
| 276 } |
| 277 |
| 267 scoped_refptr<CompositorVSyncManager> Compositor::vsync_manager() const { | 278 scoped_refptr<CompositorVSyncManager> Compositor::vsync_manager() const { |
| 268 return vsync_manager_; | 279 return vsync_manager_; |
| 269 } | 280 } |
| 270 | 281 |
| 271 void Compositor::AddObserver(CompositorObserver* observer) { | 282 void Compositor::AddObserver(CompositorObserver* observer) { |
| 272 observer_list_.AddObserver(observer); | 283 observer_list_.AddObserver(observer); |
| 273 } | 284 } |
| 274 | 285 |
| 275 void Compositor::RemoveObserver(CompositorObserver* observer) { | 286 void Compositor::RemoveObserver(CompositorObserver* observer) { |
| 276 observer_list_.RemoveObserver(observer); | 287 observer_list_.RemoveObserver(observer); |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 observer_list_, | 442 observer_list_, |
| 432 OnCompositingLockStateChanged(this)); | 443 OnCompositingLockStateChanged(this)); |
| 433 } | 444 } |
| 434 | 445 |
| 435 void Compositor::CancelCompositorLock() { | 446 void Compositor::CancelCompositorLock() { |
| 436 if (compositor_lock_) | 447 if (compositor_lock_) |
| 437 compositor_lock_->CancelLock(); | 448 compositor_lock_->CancelLock(); |
| 438 } | 449 } |
| 439 | 450 |
| 440 } // namespace ui | 451 } // namespace ui |
| OLD | NEW |