OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 PPAPI_PROXY_PPB_CONTEXT_3D_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_CONTEXT_3D_PROXY_H_ |
6 #define PPAPI_PROXY_PPB_CONTEXT_3D_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_CONTEXT_3D_PROXY_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" |
10 #include "base/shared_memory.h" | 11 #include "base/shared_memory.h" |
11 #include "gpu/command_buffer/common/command_buffer.h" | 12 #include "gpu/command_buffer/common/command_buffer.h" |
12 #include "ppapi/c/dev/pp_graphics_3d_dev.h" | 13 #include "ppapi/c/dev/pp_graphics_3d_dev.h" |
13 #include "ppapi/c/pp_instance.h" | 14 #include "ppapi/c/pp_instance.h" |
14 #include "ppapi/proxy/interface_proxy.h" | 15 #include "ppapi/proxy/interface_proxy.h" |
15 #include "ppapi/proxy/plugin_resource.h" | |
16 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h" | 16 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h" |
| 17 #include "ppapi/shared_impl/resource.h" |
17 #include "ppapi/thunk/ppb_context_3d_api.h" | 18 #include "ppapi/thunk/ppb_context_3d_api.h" |
18 | 19 |
19 struct PPB_Context3D_Dev; | 20 struct PPB_Context3D_Dev; |
20 struct PPB_Context3DTrusted_Dev; | 21 struct PPB_Context3DTrusted_Dev; |
21 | 22 |
22 namespace gpu { | 23 namespace gpu { |
23 class CommandBuffer; | 24 class CommandBuffer; |
24 | 25 |
25 namespace gles2 { | 26 namespace gles2 { |
26 class GLES2CmdHelper; | 27 class GLES2CmdHelper; |
27 class GLES2Implementation; | 28 class GLES2Implementation; |
28 } // namespace gles2 | 29 } // namespace gles2 |
29 | 30 |
30 } // namespace gpu | 31 } // namespace gpu |
31 | 32 |
32 namespace pp { | 33 namespace pp { |
33 namespace proxy { | 34 namespace proxy { |
34 | 35 |
35 class Surface3D; | 36 class Surface3D; |
36 | 37 |
37 class Context3D : public PluginResource, | 38 class Context3D : public ppapi::Resource, |
38 public ppapi::thunk::PPB_Context3D_API { | 39 public ppapi::thunk::PPB_Context3D_API { |
39 public: | 40 public: |
40 explicit Context3D(const ppapi::HostResource& resource); | 41 explicit Context3D(const ppapi::HostResource& resource); |
41 virtual ~Context3D(); | 42 virtual ~Context3D(); |
42 | 43 |
43 // ResourceObjectBase overrides. | 44 // Resource overrides. |
44 virtual ::ppapi::thunk::PPB_Context3D_API* AsPPB_Context3D_API() OVERRIDE; | 45 virtual ::ppapi::thunk::PPB_Context3D_API* AsPPB_Context3D_API() OVERRIDE; |
45 | 46 |
46 gpu::gles2::GLES2Implementation* gles2_impl() const { | 47 gpu::gles2::GLES2Implementation* gles2_impl() const { |
47 return gles2_impl_.get(); | 48 return gles2_impl_.get(); |
48 } | 49 } |
49 | 50 |
50 // PPB_Context3D_API implementation. | 51 // PPB_Context3D_API implementation. |
51 virtual int32_t GetAttrib(int32_t attribute, int32_t* value) OVERRIDE; | 52 virtual int32_t GetAttrib(int32_t attribute, int32_t* value) OVERRIDE; |
52 virtual int32_t BindSurfaces(PP_Resource draw, PP_Resource read) OVERRIDE; | 53 virtual int32_t BindSurfaces(PP_Resource draw, PP_Resource read) OVERRIDE; |
53 virtual int32_t GetBoundSurfaces(PP_Resource* draw, | 54 virtual int32_t GetBoundSurfaces(PP_Resource* draw, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 void OnMsgGetTransferBuffer(const ppapi::HostResource& context, | 137 void OnMsgGetTransferBuffer(const ppapi::HostResource& context, |
137 int32 id, | 138 int32 id, |
138 base::SharedMemoryHandle* transfer_buffer, | 139 base::SharedMemoryHandle* transfer_buffer, |
139 uint32* size); | 140 uint32* size); |
140 }; | 141 }; |
141 | 142 |
142 } // namespace proxy | 143 } // namespace proxy |
143 } // namespace pp | 144 } // namespace pp |
144 | 145 |
145 #endif // PPAPI_PROXY_PPB_CONTEXT_3D_PROXY_H_ | 146 #endif // PPAPI_PROXY_PPB_CONTEXT_3D_PROXY_H_ |
OLD | NEW |