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 22 matching lines...) Expand all Loading... |
33 #include "ui/compositor/layer_animator_collection.h" | 33 #include "ui/compositor/layer_animator_collection.h" |
34 #include "ui/gfx/frame_time.h" | 34 #include "ui/gfx/frame_time.h" |
35 #include "ui/gl/gl_context.h" | 35 #include "ui/gl/gl_context.h" |
36 #include "ui/gl/gl_switches.h" | 36 #include "ui/gl/gl_switches.h" |
37 | 37 |
38 namespace { | 38 namespace { |
39 | 39 |
40 const double kDefaultRefreshRate = 60.0; | 40 const double kDefaultRefreshRate = 60.0; |
41 const double kTestRefreshRate = 200.0; | 41 const double kTestRefreshRate = 200.0; |
42 | 42 |
43 const int kCompositorLockTimeoutMs = 67; | |
44 | |
45 } // namespace | 43 } // namespace |
46 | 44 |
47 namespace ui { | 45 namespace ui { |
48 | 46 |
49 CompositorLock::CompositorLock(Compositor* compositor) | 47 CompositorLock::CompositorLock(Compositor* compositor) |
50 : compositor_(compositor) { | 48 : compositor_(compositor) { |
51 if (compositor_->locks_will_time_out_) { | 49 if (compositor_->locks_will_time_out_) { |
52 compositor_->task_runner_->PostDelayedTask( | 50 compositor_->task_runner_->PostDelayedTask( |
53 FROM_HERE, | 51 FROM_HERE, |
54 base::Bind(&CompositorLock::CancelLock, AsWeakPtr()), | 52 base::Bind(&CompositorLock::CancelLock, AsWeakPtr()), |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 observer_list_, | 417 observer_list_, |
420 OnCompositingLockStateChanged(this)); | 418 OnCompositingLockStateChanged(this)); |
421 } | 419 } |
422 | 420 |
423 void Compositor::CancelCompositorLock() { | 421 void Compositor::CancelCompositorLock() { |
424 if (compositor_lock_) | 422 if (compositor_lock_) |
425 compositor_lock_->CancelLock(); | 423 compositor_lock_->CancelLock(); |
426 } | 424 } |
427 | 425 |
428 } // namespace ui | 426 } // namespace ui |
OLD | NEW |