OLD | NEW |
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 MOJO_EXAMPLES_SAMPLE_APP_GLES2_CLIENT_IMPL_H_ | 5 #ifndef MOJO_EXAMPLES_SAMPLE_APP_GLES2_CLIENT_IMPL_H_ |
6 #define MOJO_EXAMPLES_SAMPLE_APP_GLES2_CLIENT_IMPL_H_ | 6 #define MOJO_EXAMPLES_SAMPLE_APP_GLES2_CLIENT_IMPL_H_ |
7 | 7 |
8 #include "base/time/time.h" | |
9 #include "base/timer/timer.h" | |
10 #include "mojo/examples/sample_app/spinning_cube.h" | 8 #include "mojo/examples/sample_app/spinning_cube.h" |
11 #include "mojo/public/bindings/lib/remote_ptr.h" | 9 #include "mojo/public/bindings/lib/remote_ptr.h" |
12 #include "mojom/gles2.h" | 10 #include "mojom/gles2.h" |
13 #include "mojom/native_viewport.h" | 11 #include "mojom/native_viewport.h" |
14 #include "ui/gfx/point_f.h" | 12 #include "ui/gfx/point_f.h" |
15 | 13 |
16 namespace mojo { | 14 namespace mojo { |
17 namespace examples { | 15 namespace examples { |
18 | 16 |
19 class GLES2ClientImpl : public GLES2Client { | 17 class GLES2ClientImpl : public GLES2Client { |
20 public: | 18 public: |
21 explicit GLES2ClientImpl(ScopedMessagePipeHandle pipe); | 19 explicit GLES2ClientImpl(ScopedMessagePipeHandle pipe); |
22 virtual ~GLES2ClientImpl(); | 20 virtual ~GLES2ClientImpl(); |
23 | 21 |
24 void HandleInputEvent(const Event& event); | 22 void HandleInputEvent(const Event& event); |
25 | 23 |
26 private: | 24 private: |
27 virtual void DidCreateContext(uint64_t encoded, | 25 virtual void DidCreateContext(uint64_t encoded, |
28 uint32_t width, | 26 uint32_t width, |
29 uint32_t height) MOJO_OVERRIDE; | 27 uint32_t height) MOJO_OVERRIDE; |
30 virtual void ContextLost() MOJO_OVERRIDE; | 28 virtual void ContextLost() MOJO_OVERRIDE; |
| 29 virtual void DrawAnimationFrame() MOJO_OVERRIDE; |
31 | 30 |
32 void Draw(); | 31 void RequestAnimationFrames(); |
33 void StartTimer(); | 32 void CancelAnimationFrames(); |
34 | 33 |
35 base::Time last_time_; | 34 MojoTimeTicks last_time_; |
36 base::RepeatingTimer<GLES2ClientImpl> timer_; | |
37 SpinningCube cube_; | 35 SpinningCube cube_; |
38 gfx::PointF capture_point_; | 36 gfx::PointF capture_point_; |
39 gfx::PointF last_drag_point_; | 37 gfx::PointF last_drag_point_; |
40 base::Time drag_start_time_; | 38 MojoTimeTicks drag_start_time_; |
| 39 bool getting_animation_frames_; |
41 | 40 |
42 RemotePtr<GLES2> service_; | 41 RemotePtr<GLES2> service_; |
43 | 42 |
44 MOJO_DISALLOW_COPY_AND_ASSIGN(GLES2ClientImpl); | 43 MOJO_DISALLOW_COPY_AND_ASSIGN(GLES2ClientImpl); |
45 }; | 44 }; |
46 | 45 |
47 } // namespace examples | 46 } // namespace examples |
48 } // namespace mojo | 47 } // namespace mojo |
49 | 48 |
50 #endif // MOJO_EXAMPLES_SAMPLE_APP_GLES2_CLIENT_IMPL_H_ | 49 #endif // MOJO_EXAMPLES_SAMPLE_APP_GLES2_CLIENT_IMPL_H_ |
OLD | NEW |