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

Side by Side Diff: mojo/ui/choreographer.h

Issue 1997513002: Mozart: Generalize frame scheduling. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-jank2
Patch Set: add comments Created 4 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
« no previous file with comments | « mojo/tools/data/apptests ('k') | mojo/ui/choreographer.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 MOJO_UI_CHOREOGRAPHER_H_ 5 #ifndef MOJO_UI_CHOREOGRAPHER_H_
6 #define MOJO_UI_CHOREOGRAPHER_H_ 6 #define MOJO_UI_CHOREOGRAPHER_H_
7 7
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "mojo/public/cpp/system/macros.h" 9 #include "mojo/public/cpp/system/macros.h"
10 #include "mojo/services/gfx/composition/cpp/frame_tracker.h" 10 #include "mojo/services/gfx/composition/cpp/frame_tracker.h"
(...skipping 25 matching lines...) Expand all
36 // void OnDraw(const mojo::gfx::composition::FrameInfo& frame_info) override; 36 // void OnDraw(const mojo::gfx::composition::FrameInfo& frame_info) override;
37 // 37 //
38 // mojo::ui::Choreographer choreographer_; 38 // mojo::ui::Choreographer choreographer_;
39 // 39 //
40 // MOJO_DISALLOW_COPY_AND_ASSIGN(MyView); 40 // MOJO_DISALLOW_COPY_AND_ASSIGN(MyView);
41 // }; 41 // };
42 class Choreographer { 42 class Choreographer {
43 public: 43 public:
44 Choreographer(mojo::gfx::composition::Scene* scene, 44 Choreographer(mojo::gfx::composition::Scene* scene,
45 ChoreographerDelegate* delegate); 45 ChoreographerDelegate* delegate);
46 Choreographer(mojo::gfx::composition::SceneSchedulerPtr scene_scheduler, 46 Choreographer(mojo::gfx::composition::FrameSchedulerPtr frame_scheduler,
47 ChoreographerDelegate* delegate); 47 ChoreographerDelegate* delegate);
48 ~Choreographer(); 48 ~Choreographer();
49 49
50 // Gets the scene scheduler. 50 // Gets the scene scheduler.
51 mojo::gfx::composition::SceneScheduler* scene_scheduler() { 51 mojo::gfx::composition::FrameScheduler* frame_scheduler() {
52 return scene_scheduler_.get(); 52 return frame_scheduler_.get();
53 } 53 }
54 54
55 // Gets the frame tracker. 55 // Gets the frame tracker.
56 mojo::gfx::composition::FrameTracker& frame_tracker() { 56 mojo::gfx::composition::FrameTracker& frame_tracker() {
57 return frame_tracker_; 57 return frame_tracker_;
58 } 58 }
59 59
60 // Schedules a call to the delegate's |OnDraw| using the scene scheduler. 60 // Schedules a call to the delegate's |OnDraw| using the frame scheduler.
61 void ScheduleDraw(); 61 void ScheduleDraw();
62 62
63 private: 63 private:
64 mojo::gfx::composition::SceneSchedulerPtr scene_scheduler_; 64 mojo::gfx::composition::FrameSchedulerPtr frame_scheduler_;
65 ChoreographerDelegate* delegate_; 65 ChoreographerDelegate* delegate_;
66 mojo::gfx::composition::FrameTracker frame_tracker_; 66 mojo::gfx::composition::FrameTracker frame_tracker_;
67 67
68 void ScheduleFrame(); 68 void ScheduleFrame();
69 void DoFrame(mojo::gfx::composition::FrameInfoPtr frame_info); 69 void DoFrame(mojo::gfx::composition::FrameInfoPtr frame_info);
70 70
71 bool draw_scheduled_ = false; 71 bool draw_scheduled_ = false;
72 bool frame_scheduled_ = false; 72 bool frame_scheduled_ = false;
73 73
74 MOJO_DISALLOW_COPY_AND_ASSIGN(Choreographer); 74 MOJO_DISALLOW_COPY_AND_ASSIGN(Choreographer);
(...skipping 15 matching lines...) Expand all
90 const base::TimeDelta& time_delta) = 0; 90 const base::TimeDelta& time_delta) = 0;
91 91
92 private: 92 private:
93 MOJO_DISALLOW_COPY_AND_ASSIGN(ChoreographerDelegate); 93 MOJO_DISALLOW_COPY_AND_ASSIGN(ChoreographerDelegate);
94 }; 94 };
95 95
96 } // namespace ui 96 } // namespace ui
97 } // namespace mojo 97 } // namespace mojo
98 98
99 #endif // MOJO_UI_CHOREOGRAPHER_H_ 99 #endif // MOJO_UI_CHOREOGRAPHER_H_
OLDNEW
« no previous file with comments | « mojo/tools/data/apptests ('k') | mojo/ui/choreographer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698