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

Side by Side Diff: sky/shell/ui/animator.h

Issue 1230073002: Teach SkyShell.apk to stop posting frames when not visible (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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
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 SKY_SHELL_UI_ANIMATOR_H_ 5 #ifndef SKY_SHELL_UI_ANIMATOR_H_
6 #define SKY_SHELL_UI_ANIMATOR_H_ 6 #define SKY_SHELL_UI_ANIMATOR_H_
7 7
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "sky/shell/ui/engine.h" 9 #include "sky/shell/ui/engine.h"
10 10
11 namespace sky { 11 namespace sky {
12 namespace shell { 12 namespace shell {
13 13
14 class Animator { 14 class Animator {
15 public: 15 public:
16 explicit Animator(const Engine::Config& config, Engine* engine); 16 explicit Animator(const Engine::Config& config, Engine* engine);
17 ~Animator(); 17 ~Animator();
18 18
19 void RequestFrame(); 19 void RequestFrame();
20 void CancelFrameRequest(); 20
21 void Start();
22 void Stop();
21 23
22 private: 24 private:
23 void BeginFrame(); 25 void BeginFrame();
24 void OnFrameComplete(); 26 void OnFrameComplete();
25 27
26 Engine::Config config_; 28 Engine::Config config_;
27 Engine* engine_; 29 Engine* engine_;
28 bool engine_requested_frame_; 30 bool engine_requested_frame_;
29 bool frame_in_progress_; 31 bool frame_in_progress_;
32 bool paused_;
30 33
31 base::WeakPtrFactory<Animator> weak_factory_; 34 base::WeakPtrFactory<Animator> weak_factory_;
32 35
33 DISALLOW_COPY_AND_ASSIGN(Animator); 36 DISALLOW_COPY_AND_ASSIGN(Animator);
34 }; 37 };
35 38
36 } // namespace shell 39 } // namespace shell
37 } // namespace sky 40 } // namespace sky
38 41
39 #endif // SKY_SHELL_UI_ANIMATOR_H_ 42 #endif // SKY_SHELL_UI_ANIMATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698