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

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

Issue 14898002: Add LayerTreeHostSettings for synchronous compositor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years, 7 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/scheduler/vsync_time_source.cc » ('j') | cc/scheduler/vsync_time_source.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_SCHEDULER_VSYNC_TIME_SOURCE_H_ 5 #ifndef CC_SCHEDULER_VSYNC_TIME_SOURCE_H_
6 #define CC_SCHEDULER_VSYNC_TIME_SOURCE_H_ 6 #define CC_SCHEDULER_VSYNC_TIME_SOURCE_H_
7 7
8 #include "cc/base/cc_export.h" 8 #include "cc/base/cc_export.h"
9 #include "cc/scheduler/time_source.h" 9 #include "cc/scheduler/time_source.h"
10 10
(...skipping 15 matching lines...) Expand all
26 virtual void RequestVSyncNotification(VSyncClient* client) = 0; 26 virtual void RequestVSyncNotification(VSyncClient* client) = 0;
27 27
28 protected: 28 protected:
29 virtual ~VSyncProvider() {} 29 virtual ~VSyncProvider() {}
30 }; 30 };
31 31
32 // This timer implements a time source that is explicitly triggered by an 32 // This timer implements a time source that is explicitly triggered by an
33 // external vsync signal. 33 // external vsync signal.
34 class CC_EXPORT VSyncTimeSource : public TimeSource, public VSyncClient { 34 class CC_EXPORT VSyncTimeSource : public TimeSource, public VSyncClient {
35 public: 35 public:
36 static scoped_refptr<VSyncTimeSource> Create(VSyncProvider* vsync_provider); 36 enum NotificationDisableOption {
37 // The notification will be lazily disabled in the callback to ensure
38 // we get notified of the frame immediately following a quick on-off-on
39 // transition.
40 DISABLE_ON_NEXT_TICK,
41 DISABLE_SYNCHRONOUSLY
42 };
43
44 static scoped_refptr<VSyncTimeSource> Create(
45 VSyncProvider* vsync_provider, NotificationDisableOption option);
37 46
38 // TimeSource implementation 47 // TimeSource implementation
39 virtual void SetClient(TimeSourceClient* client) OVERRIDE; 48 virtual void SetClient(TimeSourceClient* client) OVERRIDE;
40 virtual void SetTimebaseAndInterval(base::TimeTicks timebase, 49 virtual void SetTimebaseAndInterval(base::TimeTicks timebase,
41 base::TimeDelta interval) OVERRIDE; 50 base::TimeDelta interval) OVERRIDE;
42 virtual void SetActive(bool active) OVERRIDE; 51 virtual void SetActive(bool active) OVERRIDE;
43 virtual bool Active() const OVERRIDE; 52 virtual bool Active() const OVERRIDE;
44 virtual base::TimeTicks LastTickTime() OVERRIDE; 53 virtual base::TimeTicks LastTickTime() OVERRIDE;
45 virtual base::TimeTicks NextTickTime() OVERRIDE; 54 virtual base::TimeTicks NextTickTime() OVERRIDE;
46 55
47 // VSyncClient implementation 56 // VSyncClient implementation
48 virtual void DidVSync(base::TimeTicks frame_time) OVERRIDE; 57 virtual void DidVSync(base::TimeTicks frame_time) OVERRIDE;
49 58
50 protected: 59 protected:
51 explicit VSyncTimeSource(VSyncProvider* vsync_provider); 60 explicit VSyncTimeSource(VSyncProvider* vsync_provider,
61 NotificationDisableOption option);
52 virtual ~VSyncTimeSource(); 62 virtual ~VSyncTimeSource();
53 63
54 base::TimeTicks last_tick_time_; 64 base::TimeTicks last_tick_time_;
55 base::TimeDelta interval_; 65 base::TimeDelta interval_;
56 bool active_; 66 bool active_;
57 bool notification_requested_; 67 bool notification_requested_;
58 68
59 VSyncProvider* vsync_provider_; 69 VSyncProvider* vsync_provider_;
60 TimeSourceClient* client_; 70 TimeSourceClient* client_;
71 NotificationDisableOption disable_option_;
61 72
62 DISALLOW_COPY_AND_ASSIGN(VSyncTimeSource); 73 DISALLOW_COPY_AND_ASSIGN(VSyncTimeSource);
63 }; 74 };
64 75
65 } // namespace cc 76 } // namespace cc
66 77
67 #endif // CC_SCHEDULER_VSYNC_TIME_SOURCE_H_ 78 #endif // CC_SCHEDULER_VSYNC_TIME_SOURCE_H_
OLDNEW
« no previous file with comments | « no previous file | cc/scheduler/vsync_time_source.cc » ('j') | cc/scheduler/vsync_time_source.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698