| 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_PUBLIC_BINDINGS_GLES2_CLIENT_GLES2_CLIENT_IMPL_H_ | 5 #ifndef MOJO_PUBLIC_BINDINGS_GLES2_CLIENT_GLES2_CLIENT_IMPL_H_ |
| 6 #define MOJO_PUBLIC_BINDINGS_GLES2_CLIENT_GLES2_CLIENT_IMPL_H_ | 6 #define MOJO_PUBLIC_BINDINGS_GLES2_CLIENT_GLES2_CLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include "mojo/public/bindings/lib/remote_ptr.h" | 8 #include "mojo/public/bindings/lib/remote_ptr.h" |
| 9 #include "mojom/gles2.h" | 9 #include "mojom/gles2.h" |
| 10 | 10 |
| 11 namespace mojo { | 11 namespace mojo { |
| 12 class GLES2ClientImpl; |
| 12 | 13 |
| 13 class GLES2Delegate { | 14 class GLES2Delegate { |
| 14 public: | 15 public: |
| 15 virtual ~GLES2Delegate(); | 16 virtual ~GLES2Delegate(); |
| 16 virtual void DidCreateContext(GLES2* gl, uint32_t width, uint32_t height); | 17 virtual void DidCreateContext( |
| 17 virtual void ContextLost(GLES2* gl); | 18 GLES2ClientImpl* gl, uint32_t width, uint32_t height); |
| 19 virtual void ContextLost(GLES2ClientImpl* gl); |
| 18 }; | 20 }; |
| 19 | 21 |
| 20 class GLES2ClientImpl : public GLES2ClientStub { | 22 class GLES2ClientImpl : public GLES2ClientStub { |
| 21 public: | 23 public: |
| 22 explicit GLES2ClientImpl(GLES2Delegate* delegate, | 24 explicit GLES2ClientImpl(GLES2Delegate* delegate, |
| 23 ScopedMessagePipeHandle gl); | 25 ScopedMessagePipeHandle gl); |
| 24 virtual ~GLES2ClientImpl(); | 26 virtual ~GLES2ClientImpl(); |
| 25 | 27 |
| 26 static void Initialize(); | 28 static void Initialize(); |
| 27 static void Terminate(); | 29 static void Terminate(); |
| 28 | 30 |
| 29 GLES2* gl() { | 31 void SwapBuffers(); |
| 30 return gl_.get(); | |
| 31 } | |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 virtual void DidCreateContext( | 34 virtual void DidCreateContext( |
| 35 uint64_t encoded, uint32_t width, uint32_t height) MOJO_OVERRIDE; | 35 uint64_t encoded, uint32_t width, uint32_t height) MOJO_OVERRIDE; |
| 36 virtual void ContextLost() MOJO_OVERRIDE; | 36 virtual void ContextLost() MOJO_OVERRIDE; |
| 37 | 37 |
| 38 GLES2Delegate* delegate_; | 38 GLES2Delegate* delegate_; |
| 39 RemotePtr<GLES2> gl_; | 39 RemotePtr<GLES2> gl_; |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 } // mojo | 42 } // mojo |
| 43 | 43 |
| 44 #endif // MOJO_PUBLIC_BINDINGS_GLES2_CLIENT_GLES2_CLIENT_IMPL_H_ | 44 #endif // MOJO_PUBLIC_BINDINGS_GLES2_CLIENT_GLES2_CLIENT_IMPL_H_ |
| OLD | NEW |