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

Side by Side Diff: cc/vsync_time_source.h

Issue 11854013: Use input events to improve vsync scheduling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't set last-input-for-vsync bit on pages with touch handlers. 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_VSYNC_TIME_SOURCE_H_ 5 #ifndef CC_VSYNC_TIME_SOURCE_H_
6 #define CC_VSYNC_TIME_SOURCE_H_ 6 #define CC_VSYNC_TIME_SOURCE_H_
7 7
8 #include "cc/cc_export.h" 8 #include "cc/cc_export.h"
9 #include "cc/time_source.h" 9 #include "cc/time_source.h"
10 10
11 namespace cc { 11 namespace cc {
12 12
13 class CC_EXPORT VSyncClient { 13 class CC_EXPORT VSyncClient {
14 public: 14 public:
15 virtual void DidVSync(base::TimeTicks frame_time) = 0; 15 virtual void DidVSync(base::TimeTicks frame_time) = 0;
16 virtual void DidReceiveLastInputEventForVSync() = 0;
16 17
17 protected: 18 protected:
18 virtual ~VSyncClient() {} 19 virtual ~VSyncClient() {}
19 }; 20 };
20 21
21 class VSyncProvider { 22 class VSyncProvider {
22 public: 23 public:
23 // Request to be notified of future vsync events. The notifications will be 24 // Request to be notified of future vsync events. The notifications will be
24 // delivered until they are disabled by calling this function with a null 25 // delivered until they are disabled by calling this function with a null
25 // client. 26 // client.
(...skipping 13 matching lines...) Expand all
39 virtual void setClient(TimeSourceClient* client) OVERRIDE; 40 virtual void setClient(TimeSourceClient* client) OVERRIDE;
40 virtual void setTimebaseAndInterval(base::TimeTicks timebase, 41 virtual void setTimebaseAndInterval(base::TimeTicks timebase,
41 base::TimeDelta interval) OVERRIDE; 42 base::TimeDelta interval) OVERRIDE;
42 virtual void setActive(bool active) OVERRIDE; 43 virtual void setActive(bool active) OVERRIDE;
43 virtual bool active() const OVERRIDE; 44 virtual bool active() const OVERRIDE;
44 virtual base::TimeTicks lastTickTime() OVERRIDE; 45 virtual base::TimeTicks lastTickTime() OVERRIDE;
45 virtual base::TimeTicks nextTickTime() OVERRIDE; 46 virtual base::TimeTicks nextTickTime() OVERRIDE;
46 47
47 // VSyncClient implementation 48 // VSyncClient implementation
48 virtual void DidVSync(base::TimeTicks frame_time) OVERRIDE; 49 virtual void DidVSync(base::TimeTicks frame_time) OVERRIDE;
50 virtual void DidReceiveLastInputEventForVSync() OVERRIDE;
51
52 // Virtual for testing.
53 virtual base::TimeTicks Now() const;
49 54
50 protected: 55 protected:
51 explicit VSyncTimeSource(VSyncProvider* vsync_provider); 56 explicit VSyncTimeSource(VSyncProvider* vsync_provider);
52 virtual ~VSyncTimeSource(); 57 virtual ~VSyncTimeSource();
53 58
54 base::TimeTicks last_tick_time_; 59 base::TimeTicks last_tick_time_;
55 base::TimeDelta interval_; 60 base::TimeDelta interval_;
56 bool active_; 61 bool active_;
57 bool notification_requested_; 62 bool notification_requested_;
63 bool did_synthesize_last_vsync_;
58 64
59 VSyncProvider* vsync_provider_; 65 VSyncProvider* vsync_provider_;
60 TimeSourceClient* client_; 66 TimeSourceClient* client_;
61 67
62 DISALLOW_COPY_AND_ASSIGN(VSyncTimeSource); 68 DISALLOW_COPY_AND_ASSIGN(VSyncTimeSource);
63 }; 69 };
64 70
65 } // namespace cc 71 } // namespace cc
66 72
67 #endif // CC_VSYNC_TIME_SOURCE_H_ 73 #endif // CC_VSYNC_TIME_SOURCE_H_
OLDNEW
« no previous file with comments | « cc/thread_proxy.cc ('k') | cc/vsync_time_source.cc » ('j') | cc/vsync_time_source.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698