| 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 "mojo/examples/sample_app/spinning_cube.h" | 8 #include "mojo/examples/sample_app/spinning_cube.h" |
| 9 #include "mojo/public/c/gles2/gles2.h" | 9 #include "mojo/public/c/gles2/gles2.h" |
| 10 #include "mojo/services/public/interfaces/native_viewport/native_viewport.mojom.
h" | 10 #include "mojo/services/public/interfaces/native_viewport/native_viewport.mojom.
h" |
| 11 #include "ui/gfx/point_f.h" | 11 #include "ui/gfx/point_f.h" |
| 12 #include "ui/gfx/size.h" | 12 #include "ui/gfx/size.h" |
| 13 | 13 |
| 14 namespace mojo { | |
| 15 namespace examples { | 14 namespace examples { |
| 16 | 15 |
| 17 class GLES2ClientImpl { | 16 class GLES2ClientImpl { |
| 18 public: | 17 public: |
| 19 explicit GLES2ClientImpl(CommandBufferPtr command_buffer); | 18 explicit GLES2ClientImpl(mojo::CommandBufferPtr command_buffer); |
| 20 virtual ~GLES2ClientImpl(); | 19 virtual ~GLES2ClientImpl(); |
| 21 | 20 |
| 22 void SetSize(const Size& size); | 21 void SetSize(const mojo::Size& size); |
| 23 void HandleInputEvent(const Event& event); | 22 void HandleInputEvent(const mojo::Event& event); |
| 24 | 23 |
| 25 private: | 24 private: |
| 26 void ContextLost(); | 25 void ContextLost(); |
| 27 static void ContextLostThunk(void* closure); | 26 static void ContextLostThunk(void* closure); |
| 28 void DrawAnimationFrame(); | 27 void DrawAnimationFrame(); |
| 29 static void DrawAnimationFrameThunk(void* closure); | 28 static void DrawAnimationFrameThunk(void* closure); |
| 30 | 29 |
| 31 void RequestAnimationFrames(); | 30 void RequestAnimationFrames(); |
| 32 void CancelAnimationFrames(); | 31 void CancelAnimationFrames(); |
| 33 | 32 |
| 34 MojoTimeTicks last_time_; | 33 MojoTimeTicks last_time_; |
| 35 gfx::Size size_; | 34 gfx::Size size_; |
| 36 SpinningCube cube_; | 35 SpinningCube cube_; |
| 37 gfx::PointF capture_point_; | 36 gfx::PointF capture_point_; |
| 38 gfx::PointF last_drag_point_; | 37 gfx::PointF last_drag_point_; |
| 39 MojoTimeTicks drag_start_time_; | 38 MojoTimeTicks drag_start_time_; |
| 40 bool getting_animation_frames_; | 39 bool getting_animation_frames_; |
| 41 | 40 |
| 42 MojoGLES2Context context_; | 41 MojoGLES2Context context_; |
| 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 | |
| 49 | 47 |
| 50 #endif // MOJO_EXAMPLES_SAMPLE_APP_GLES2_CLIENT_IMPL_H_ | 48 #endif // MOJO_EXAMPLES_SAMPLE_APP_GLES2_CLIENT_IMPL_H_ |
| OLD | NEW |