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

Side by Side Diff: cc/frame_rate_controller.h

Issue 11747002: cc: Set the max frames pending from the thread proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DCHECK_GE Created 7 years, 11 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
« no previous file with comments | « no previous file | cc/frame_rate_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_FRAME_RATE_CONTROLLER_H_ 5 #ifndef CC_FRAME_RATE_CONTROLLER_H_
6 #define CC_FRAME_RATE_CONTROLLER_H_ 6 #define CC_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 11 matching lines...) Expand all
22 virtual void vsyncTick(bool throttled) = 0; 22 virtual void vsyncTick(bool throttled) = 0;
23 23
24 protected: 24 protected:
25 virtual ~FrameRateControllerClient() {} 25 virtual ~FrameRateControllerClient() {}
26 }; 26 };
27 27
28 class FrameRateControllerTimeSourceAdapter; 28 class FrameRateControllerTimeSourceAdapter;
29 29
30 class CC_EXPORT FrameRateController { 30 class CC_EXPORT FrameRateController {
31 public: 31 public:
32 enum {
33 kDefaultMaxFramesPending = 2
34 };
35
32 explicit FrameRateController(scoped_refptr<TimeSource>); 36 explicit FrameRateController(scoped_refptr<TimeSource>);
33 // Alternate form of FrameRateController with unthrottled frame-rate. 37 // Alternate form of FrameRateController with unthrottled frame-rate.
34 explicit FrameRateController(Thread*); 38 explicit FrameRateController(Thread*);
35 virtual ~FrameRateController(); 39 virtual ~FrameRateController();
36 40
37 void setClient(FrameRateControllerClient* client) { m_client = client; } 41 void setClient(FrameRateControllerClient* client) { m_client = client; }
38 42
39 void setActive(bool); 43 void setActive(bool);
40 44
41 // Use the following methods to adjust target frame rate. 45 // Use the following methods to adjust target frame rate.
42 // 46 //
43 // Multiple frames can be in-progress, but for every didBeginFrame, a 47 // Multiple frames can be in-progress, but for every didBeginFrame, a
44 // didFinishFrame should be posted. 48 // didFinishFrame should be posted.
45 // 49 //
46 // If the rendering pipeline crashes, call didAbortAllPendingFrames. 50 // If the rendering pipeline crashes, call didAbortAllPendingFrames.
47 void didBeginFrame(); 51 void didBeginFrame();
48 void didFinishFrame(); 52 void didFinishFrame();
49 void didAbortAllPendingFrames(); 53 void didAbortAllPendingFrames();
50 void setMaxFramesPending(int); // 0 for unlimited. 54 void setMaxFramesPending(int); // 0 for unlimited.
55 int maxFramesPending() const { return m_maxFramesPending; }
51 56
52 // This returns null for unthrottled frame-rate. 57 // This returns null for unthrottled frame-rate.
53 base::TimeTicks nextTickTime(); 58 base::TimeTicks nextTickTime();
54 59
55 void setTimebaseAndInterval(base::TimeTicks timebase, base::TimeDelta interv al); 60 void setTimebaseAndInterval(base::TimeTicks timebase, base::TimeDelta interv al);
56 void setSwapBuffersCompleteSupported(bool); 61 void setSwapBuffersCompleteSupported(bool);
57 62
58 protected: 63 protected:
59 friend class FrameRateControllerTimeSourceAdapter; 64 friend class FrameRateControllerTimeSourceAdapter;
60 void onTimerTick(); 65 void onTimerTick();
(...skipping 13 matching lines...) Expand all
74 bool m_isTimeSourceThrottling; 79 bool m_isTimeSourceThrottling;
75 base::WeakPtrFactory<FrameRateController> m_weakFactory; 80 base::WeakPtrFactory<FrameRateController> m_weakFactory;
76 Thread* m_thread; 81 Thread* m_thread;
77 82
78 DISALLOW_COPY_AND_ASSIGN(FrameRateController); 83 DISALLOW_COPY_AND_ASSIGN(FrameRateController);
79 }; 84 };
80 85
81 } // namespace cc 86 } // namespace cc
82 87
83 #endif // CC_FRAME_RATE_CONTROLLER_H_ 88 #endif // CC_FRAME_RATE_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/frame_rate_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698