Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Side by Side Diff: cc/scheduler/frame_rate_controller.h

Issue 14772021: cc::OutputSurfaceClient::InitializeForGL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add swap callback dcheck, fix test Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 #ifndef CC_SCHEDULER_FRAME_RATE_CONTROLLER_H_ 5 #ifndef CC_SCHEDULER_FRAME_RATE_CONTROLLER_H_
6 #define CC_SCHEDULER_FRAME_RATE_CONTROLLER_H_ 6 #define CC_SCHEDULER_FRAME_RATE_CONTROLLER_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 int NumFramesPendingForTesting() const { return num_frames_pending_; } 56 int NumFramesPendingForTesting() const { return num_frames_pending_; }
57 57
58 // This returns null for unthrottled frame-rate. 58 // This returns null for unthrottled frame-rate.
59 base::TimeTicks NextTickTime(); 59 base::TimeTicks NextTickTime();
60 60
61 // This returns now for unthrottled frame-rate. 61 // This returns now for unthrottled frame-rate.
62 base::TimeTicks LastTickTime(); 62 base::TimeTicks LastTickTime();
63 63
64 void SetTimebaseAndInterval(base::TimeTicks timebase, 64 void SetTimebaseAndInterval(base::TimeTicks timebase,
65 base::TimeDelta interval); 65 base::TimeDelta interval);
66 bool SwapBuffersCompleteSupported() const;
66 void SetSwapBuffersCompleteSupported(bool supported); 67 void SetSwapBuffersCompleteSupported(bool supported);
67 68
68 protected: 69 protected:
69 friend class FrameRateControllerTimeSourceAdapter; 70 friend class FrameRateControllerTimeSourceAdapter;
70 void OnTimerTick(); 71 void OnTimerTick();
71 72
72 void PostManualTick(); 73 void PostManualTick();
73 void ManualTick(); 74 void ManualTick();
74 75
75 FrameRateControllerClient* client_; 76 FrameRateControllerClient* client_;
76 int num_frames_pending_; 77 int num_frames_pending_;
77 int max_frames_pending_; 78 int max_frames_pending_;
78 scoped_refptr<TimeSource> time_source_; 79 scoped_refptr<TimeSource> time_source_;
79 scoped_ptr<FrameRateControllerTimeSourceAdapter> time_source_client_adapter_; 80 scoped_ptr<FrameRateControllerTimeSourceAdapter> time_source_client_adapter_;
80 bool active_; 81 bool active_;
81 bool swap_buffers_complete_supported_; 82 bool swap_buffers_complete_supported_;
82 83
83 // Members for unthrottled frame-rate. 84 // Members for unthrottled frame-rate.
84 bool is_time_source_throttling_; 85 bool is_time_source_throttling_;
85 base::WeakPtrFactory<FrameRateController> weak_factory_; 86 base::WeakPtrFactory<FrameRateController> weak_factory_;
86 Thread* thread_; 87 Thread* thread_;
87 88
88 DISALLOW_COPY_AND_ASSIGN(FrameRateController); 89 DISALLOW_COPY_AND_ASSIGN(FrameRateController);
89 }; 90 };
90 91
91 } // namespace cc 92 } // namespace cc
92 93
93 #endif // CC_SCHEDULER_FRAME_RATE_CONTROLLER_H_ 94 #endif // CC_SCHEDULER_FRAME_RATE_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698