OLD | NEW |
1 // Copyright 2014 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_GLES2_GLES2_CONTEXT_H_ | 5 #ifndef MOJO_GLES2_GLES2_CONTEXT_H_ |
6 #define MOJO_GLES2_GLES2_CONTEXT_H_ | 6 #define MOJO_GLES2_GLES2_CONTEXT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 13 matching lines...) Expand all Loading... |
24 class GLES2Implementation; | 24 class GLES2Implementation; |
25 } | 25 } |
26 } | 26 } |
27 | 27 |
28 namespace gles2 { | 28 namespace gles2 { |
29 | 29 |
30 class GLES2Context : public CommandBufferDelegate, | 30 class GLES2Context : public CommandBufferDelegate, |
31 public MojoGLES2ContextPrivate { | 31 public MojoGLES2ContextPrivate { |
32 public: | 32 public: |
33 explicit GLES2Context(const std::vector<int32_t>& attribs, | 33 explicit GLES2Context(const std::vector<int32_t>& attribs, |
34 const MojoAsyncWaiter* async_waiter, | |
35 mojo::ScopedMessagePipeHandle command_buffer_handle, | 34 mojo::ScopedMessagePipeHandle command_buffer_handle, |
36 MojoGLES2ContextLost lost_callback, | 35 MojoGLES2ContextLost lost_callback, |
37 void* closure); | 36 void* closure); |
38 ~GLES2Context() override; | 37 ~GLES2Context() override; |
39 bool Initialize(); | 38 bool Initialize(); |
40 | 39 |
41 gpu::gles2::GLES2Interface* interface() const { | 40 gpu::gles2::GLES2Interface* interface() const { |
42 return implementation_.get(); | 41 return implementation_.get(); |
43 } | 42 } |
44 gpu::ContextSupport* context_support() const { return implementation_.get(); } | 43 gpu::ContextSupport* context_support() const { return implementation_.get(); } |
45 | 44 |
46 private: | 45 private: |
47 void ContextLost() override; | 46 void ContextLost() override; |
48 | 47 |
49 CommandBufferClientImpl command_buffer_; | 48 CommandBufferClientImpl command_buffer_; |
50 scoped_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; | 49 scoped_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; |
51 scoped_ptr<gpu::TransferBuffer> transfer_buffer_; | 50 scoped_ptr<gpu::TransferBuffer> transfer_buffer_; |
52 scoped_ptr<gpu::gles2::GLES2Implementation> implementation_; | 51 scoped_ptr<gpu::gles2::GLES2Implementation> implementation_; |
53 MojoGLES2ContextLost lost_callback_; | 52 MojoGLES2ContextLost lost_callback_; |
54 void* closure_; | 53 void* closure_; |
55 | 54 |
56 MOJO_DISALLOW_COPY_AND_ASSIGN(GLES2Context); | 55 MOJO_DISALLOW_COPY_AND_ASSIGN(GLES2Context); |
57 }; | 56 }; |
58 | 57 |
59 } // namespace gles2 | 58 } // namespace gles2 |
60 | 59 |
61 #endif // MOJO_GLES2_GLES2_CONTEXT_H_ | 60 #endif // MOJO_GLES2_GLES2_CONTEXT_H_ |
OLD | NEW |