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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 host_->SetVisible(visible); | 325 host_->SetVisible(visible); |
326 } | 326 } |
327 | 327 |
328 bool Compositor::IsVisible() { | 328 bool Compositor::IsVisible() { |
329 return host_->visible(); | 329 return host_->visible(); |
330 } | 330 } |
331 | 331 |
332 void Compositor::SetAuthoritativeVSyncInterval( | 332 void Compositor::SetAuthoritativeVSyncInterval( |
333 const base::TimeDelta& interval) { | 333 const base::TimeDelta& interval) { |
334 context_factory_->SetAuthoritativeVSyncInterval(this, interval); | 334 context_factory_->SetAuthoritativeVSyncInterval(this, interval); |
335 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 335 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
336 cc::switches::kDisableBeginFrameScheduling)) { | 336 cc::switches::kEnableBeginFrameScheduling)) { |
337 vsync_manager_->SetAuthoritativeVSyncInterval(interval); | 337 vsync_manager_->SetAuthoritativeVSyncInterval(interval); |
338 } | 338 } |
339 } | 339 } |
340 | 340 |
341 void Compositor::SetAcceleratedWidget(gfx::AcceleratedWidget widget) { | 341 void Compositor::SetAcceleratedWidget(gfx::AcceleratedWidget widget) { |
342 // This function should only get called once. | 342 // This function should only get called once. |
343 DCHECK(!widget_valid_); | 343 DCHECK(!widget_valid_); |
344 widget_ = widget; | 344 widget_ = widget; |
345 widget_valid_ = true; | 345 widget_valid_ = true; |
346 if (output_surface_requested_) | 346 if (output_surface_requested_) |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 observer_list_, | 496 observer_list_, |
497 OnCompositingLockStateChanged(this)); | 497 OnCompositingLockStateChanged(this)); |
498 } | 498 } |
499 | 499 |
500 void Compositor::CancelCompositorLock() { | 500 void Compositor::CancelCompositorLock() { |
501 if (compositor_lock_) | 501 if (compositor_lock_) |
502 compositor_lock_->CancelLock(); | 502 compositor_lock_->CancelLock(); |
503 } | 503 } |
504 | 504 |
505 } // namespace ui | 505 } // namespace ui |
OLD | NEW |