| 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_COMPOSITOR_APP_GLES2_CLIENT_IMPL_H_ | 5 #ifndef MOJO_EXAMPLES_COMPOSITOR_APP_GLES2_CLIENT_IMPL_H_ |
| 6 #define MOJO_EXAMPLES_COMPOSITOR_APP_GLES2_CLIENT_IMPL_H_ | 6 #define MOJO_EXAMPLES_COMPOSITOR_APP_GLES2_CLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
| 10 #include "mojo/public/bindings/lib/remote_ptr.h" | 10 #include "mojo/public/bindings/lib/remote_ptr.h" |
| 11 #include "mojo/public/gles2/gles2.h" | 11 #include "mojo/public/gles2/gles2.h" |
| 12 #include "mojom/native_viewport.h" | 12 #include "mojom/native_viewport.h" |
| 13 #include "ui/gfx/size.h" | |
| 14 | 13 |
| 15 namespace gpu { | 14 namespace gpu { |
| 16 class ContextSupport; | 15 class ContextSupport; |
| 17 namespace gles2 { | 16 namespace gles2 { |
| 18 class GLES2Interface; | 17 class GLES2Interface; |
| 19 } | 18 } |
| 20 } | 19 } |
| 21 | 20 |
| 22 namespace mojo { | 21 namespace mojo { |
| 23 namespace examples { | 22 namespace examples { |
| 24 | 23 |
| 25 class GLES2ClientImpl { | 24 class GLES2ClientImpl { |
| 26 public: | 25 public: |
| 27 GLES2ClientImpl( | 26 GLES2ClientImpl( |
| 28 ScopedMessagePipeHandle pipe, | 27 ScopedMessagePipeHandle pipe, |
| 29 const base::Callback<void(gfx::Size)>& context_created_callback); | 28 const base::Callback<void()>& context_created_callback); |
| 30 virtual ~GLES2ClientImpl(); | 29 virtual ~GLES2ClientImpl(); |
| 31 | 30 |
| 32 gpu::gles2::GLES2Interface* Interface() const; | 31 gpu::gles2::GLES2Interface* Interface() const; |
| 33 gpu::ContextSupport* Support() const; | 32 gpu::ContextSupport* Support() const; |
| 34 | 33 |
| 35 private: | 34 private: |
| 36 void DidCreateContext(uint32_t width, uint32_t height); | 35 void DidCreateContext(); |
| 37 static void DidCreateContextThunk( | 36 static void DidCreateContextThunk(void* closure); |
| 38 void* closure, | |
| 39 uint32_t width, | |
| 40 uint32_t height); | |
| 41 void ContextLost(); | 37 void ContextLost(); |
| 42 static void ContextLostThunk(void* closure); | 38 static void ContextLostThunk(void* closure); |
| 43 | 39 |
| 44 base::Callback<void(gfx::Size viewport_size)> context_created_callback_; | 40 base::Callback<void()> context_created_callback_; |
| 45 | 41 |
| 46 MojoGLES2Context context_; | 42 MojoGLES2Context context_; |
| 47 | 43 |
| 48 MOJO_DISALLOW_COPY_AND_ASSIGN(GLES2ClientImpl); | 44 MOJO_DISALLOW_COPY_AND_ASSIGN(GLES2ClientImpl); |
| 49 }; | 45 }; |
| 50 | 46 |
| 51 } // namespace examples | 47 } // namespace examples |
| 52 } // namespace mojo | 48 } // namespace mojo |
| 53 | 49 |
| 54 #endif // MOJO_EXAMPLES_COMPOSITOR_APP_GLES2_CLIENT_IMPL_H_ | 50 #endif // MOJO_EXAMPLES_COMPOSITOR_APP_GLES2_CLIENT_IMPL_H_ |
| OLD | NEW |