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

Side by Side Diff: mojo/examples/pepper_container_app/pepper_spinning_cube_demo/spinning_cube.h

Issue 178953003: Mojo container example for hosting Pepper plugins (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 6 years, 9 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 2014 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_EXAMPLES_SAMPLE_APP_SPINNING_CUBE_H_ 5 #ifndef MOJO_EXAMPLES_PEPPER_CONTAINER_APP_PEPPER_SPINNING_CUBE_DEMO_SPINNING_CU BE_H_
6 #define MOJO_EXAMPLES_SAMPLE_APP_SPINNING_CUBE_H_ 6 #define MOJO_EXAMPLES_PEPPER_CONTAINER_APP_PEPPER_SPINNING_CUBE_DEMO_SPINNING_CU BE_H_
7 7
8 #include <stdint.h> 8 #include "ppapi/c/pp_stdint.h"
9
10 #include "base/memory/scoped_ptr.h"
11 9
12 namespace mojo { 10 namespace mojo {
13 namespace examples { 11 namespace examples {
14 12
15 class SpinningCube { 13 class SpinningCube {
yzshen1 2014/03/20 22:28:57 I am not quite sure whether I should duplicate thi
16 public: 14 public:
17 SpinningCube(); 15 SpinningCube();
18 ~SpinningCube(); 16 ~SpinningCube();
19 17
20 void Init(uint32_t width, uint32_t height); 18 void Init(uint32_t width, uint32_t height);
21 void set_direction(int direction) { direction_ = direction; } 19 void set_direction(int direction) { direction_ = direction; }
22 void SetFlingMultiplier(float drag_distance, float drag_time); 20 void SetFlingMultiplier(float drag_distance, float drag_time);
23 void UpdateForTimeDelta(float delta_time); 21 void UpdateForTimeDelta(float delta_time);
24 void UpdateForDragDistance(float distance); 22 void UpdateForDragDistance(float distance);
25 void Draw(); 23 void Draw();
26 24
27 void OnGLContextLost(); 25 void OnGLContextLost();
28 26
29 private: 27 private:
30 class GLState; 28 class GLState;
31 29
30 // Disallow copy and assign.
31 SpinningCube(const SpinningCube& other);
32 SpinningCube& operator=(const SpinningCube& other);
33
32 void Update(); 34 void Update();
33 35
34 bool initialized_; 36 bool initialized_;
35 uint32_t width_; 37 uint32_t width_;
36 uint32_t height_; 38 uint32_t height_;
37 scoped_ptr<GLState> state_; 39 // Owned ptr.
40 GLState* state_;
38 float fling_multiplier_; 41 float fling_multiplier_;
39 int direction_; 42 int direction_;
40 }; 43 };
41 44
42 } // namespace examples 45 } // namespace examples
43 } // namespace mojo 46 } // namespace mojo
44 47
45 #endif // MOJO_EXAMPLES_SAMPLE_APP_SPINNING_CUBE_H_ 48 #endif // MOJO_EXAMPLES_PEPPER_CONTAINER_APP_PEPPER_SPINNING_CUBE_DEMO_SPINNING _CUBE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698