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 SERVICES_UI_PUBLIC_CPP_GLES2_CONTEXT_H_ | 5 #ifndef SERVICES_UI_PUBLIC_CPP_GLES2_CONTEXT_H_ |
6 #define SERVICES_UI_PUBLIC_CPP_GLES2_CONTEXT_H_ | 6 #define SERVICES_UI_PUBLIC_CPP_GLES2_CONTEXT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "gpu/command_buffer/client/gles2_implementation.h" | 14 #include "gpu/command_buffer/client/gles2_implementation.h" |
15 #include "services/ui/public/interfaces/command_buffer.mojom.h" | 15 #include "services/ui/public/interfaces/command_buffer.mojom.h" |
16 | 16 |
17 namespace gpu { | 17 namespace gpu { |
18 class CommandBufferProxyImpl; | 18 class CommandBufferProxyImpl; |
19 class TransferBuffer; | 19 class TransferBuffer; |
20 namespace gles2 { | 20 namespace gles2 { |
21 class GLES2CmdHelper; | 21 class GLES2CmdHelper; |
22 } | 22 } |
23 } | 23 } |
24 | 24 |
25 namespace shell { | |
26 class Connector; | |
27 } | |
28 | |
29 namespace ui { | 25 namespace ui { |
30 | 26 |
31 class CommandBufferClientImpl; | 27 class CommandBufferClientImpl; |
32 | 28 |
33 class GLES2Context { | 29 class GLES2Context { |
34 public: | 30 public: |
35 ~GLES2Context(); | 31 ~GLES2Context(); |
36 gpu::gles2::GLES2Interface* interface() const { | 32 gpu::gles2::GLES2Interface* interface() const { |
37 return implementation_.get(); | 33 return implementation_.get(); |
38 } | 34 } |
39 gpu::ContextSupport* context_support() const { return implementation_.get(); } | 35 gpu::ContextSupport* context_support() const { return implementation_.get(); } |
40 | 36 |
41 static std::unique_ptr<GLES2Context> CreateOffscreenContext( | 37 static std::unique_ptr<GLES2Context> CreateOffscreenContext( |
42 const std::vector<int32_t>& attribs, | 38 const std::vector<int32_t>& attribs); |
43 shell::Connector* connector); | |
44 | 39 |
45 private: | 40 private: |
46 GLES2Context(); | 41 GLES2Context(); |
47 bool Initialize(const std::vector<int32_t>& attribs, | 42 bool Initialize(const std::vector<int32_t>& attribs); |
48 shell::Connector* connector); | |
49 | 43 |
50 std::unique_ptr<CommandBufferClientImpl> command_buffer_client_impl_; | 44 std::unique_ptr<CommandBufferClientImpl> command_buffer_client_impl_; |
51 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_proxy_impl_; | 45 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_proxy_impl_; |
52 std::unique_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; | 46 std::unique_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; |
53 std::unique_ptr<gpu::TransferBuffer> transfer_buffer_; | 47 std::unique_ptr<gpu::TransferBuffer> transfer_buffer_; |
54 std::unique_ptr<gpu::gles2::GLES2Implementation> implementation_; | 48 std::unique_ptr<gpu::gles2::GLES2Implementation> implementation_; |
55 | 49 |
56 DISALLOW_COPY_AND_ASSIGN(GLES2Context); | 50 DISALLOW_COPY_AND_ASSIGN(GLES2Context); |
57 }; | 51 }; |
58 | 52 |
59 } // namespace ui | 53 } // namespace ui |
60 | 54 |
61 #endif // SERVICES_UI_PUBLIC_CPP_GLES2_CONTEXT_H_ | 55 #endif // SERVICES_UI_PUBLIC_CPP_GLES2_CONTEXT_H_ |
OLD | NEW |