OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_GRAPHICS_3D_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_GRAPHICS_3D_PROXY_H_ |
6 #define PPAPI_PROXY_PPB_GRAPHICS_3D_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_GRAPHICS_3D_PROXY_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/shared_memory.h" | 10 #include "base/shared_memory.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 class HostResource; | 22 class HostResource; |
23 | 23 |
24 namespace proxy { | 24 namespace proxy { |
25 | 25 |
26 class Graphics3D : public PPB_Graphics3D_Shared { | 26 class Graphics3D : public PPB_Graphics3D_Shared { |
27 public: | 27 public: |
28 explicit Graphics3D(const HostResource& resource); | 28 explicit Graphics3D(const HostResource& resource); |
29 virtual ~Graphics3D(); | 29 virtual ~Graphics3D(); |
30 | 30 |
31 bool Init(); | 31 bool Init(gpu::gles2::GLES2Implementation* share_gles2); |
32 | 32 |
33 // Graphics3DTrusted API. These are not implemented in the proxy. | 33 // Graphics3DTrusted API. These are not implemented in the proxy. |
34 virtual PP_Bool InitCommandBuffer() OVERRIDE; | 34 virtual PP_Bool InitCommandBuffer() OVERRIDE; |
35 virtual PP_Bool SetGetBuffer(int32_t shm_id) OVERRIDE; | 35 virtual PP_Bool SetGetBuffer(int32_t shm_id) OVERRIDE; |
36 virtual PP_Graphics3DTrustedState GetState() OVERRIDE; | 36 virtual PP_Graphics3DTrustedState GetState() OVERRIDE; |
37 virtual PP_Bool Flush(int32_t put_offset) OVERRIDE; | 37 virtual PP_Bool Flush(int32_t put_offset) OVERRIDE; |
38 virtual PP_Graphics3DTrustedState FlushSync(int32_t put_offset) OVERRIDE; | 38 virtual PP_Graphics3DTrustedState FlushSync(int32_t put_offset) OVERRIDE; |
39 virtual int32_t CreateTransferBuffer(uint32_t size) OVERRIDE; | 39 virtual int32_t CreateTransferBuffer(uint32_t size) OVERRIDE; |
40 virtual PP_Bool DestroyTransferBuffer(int32_t id) OVERRIDE; | 40 virtual PP_Bool DestroyTransferBuffer(int32_t id) OVERRIDE; |
41 virtual PP_Bool GetTransferBuffer(int32_t id, | 41 virtual PP_Bool GetTransferBuffer(int32_t id, |
(...skipping 12 matching lines...) Expand all Loading... |
54 scoped_ptr<gpu::CommandBuffer> command_buffer_; | 54 scoped_ptr<gpu::CommandBuffer> command_buffer_; |
55 | 55 |
56 DISALLOW_COPY_AND_ASSIGN(Graphics3D); | 56 DISALLOW_COPY_AND_ASSIGN(Graphics3D); |
57 }; | 57 }; |
58 | 58 |
59 class PPB_Graphics3D_Proxy : public InterfaceProxy { | 59 class PPB_Graphics3D_Proxy : public InterfaceProxy { |
60 public: | 60 public: |
61 PPB_Graphics3D_Proxy(Dispatcher* dispatcher); | 61 PPB_Graphics3D_Proxy(Dispatcher* dispatcher); |
62 virtual ~PPB_Graphics3D_Proxy(); | 62 virtual ~PPB_Graphics3D_Proxy(); |
63 | 63 |
64 static PP_Resource CreateProxyResource(PP_Instance instance, | 64 static PP_Resource CreateProxyResource( |
65 PP_Resource share_context, | 65 PP_Instance instance, |
66 const int32_t* attrib_list); | 66 PP_Resource share_context, |
| 67 const int32_t* attrib_list); |
67 | 68 |
68 // InterfaceProxy implementation. | 69 // InterfaceProxy implementation. |
69 virtual bool OnMessageReceived(const IPC::Message& msg); | 70 virtual bool OnMessageReceived(const IPC::Message& msg); |
70 | 71 |
71 static const ApiID kApiID = API_ID_PPB_GRAPHICS_3D; | 72 static const ApiID kApiID = API_ID_PPB_GRAPHICS_3D; |
72 | 73 |
73 private: | 74 private: |
74 void OnMsgCreate(PP_Instance instance, | 75 void OnMsgCreate(PP_Instance instance, |
| 76 HostResource share_context, |
75 const std::vector<int32_t>& attribs, | 77 const std::vector<int32_t>& attribs, |
76 HostResource* result); | 78 HostResource* result); |
77 void OnMsgInitCommandBuffer(const HostResource& context); | 79 void OnMsgInitCommandBuffer(const HostResource& context); |
78 void OnMsgSetGetBuffer(const HostResource& context, | 80 void OnMsgSetGetBuffer(const HostResource& context, |
79 int32 id); | 81 int32 id); |
80 void OnMsgGetState(const HostResource& context, | 82 void OnMsgGetState(const HostResource& context, |
81 gpu::CommandBuffer::State* state, | 83 gpu::CommandBuffer::State* state, |
82 bool* success); | 84 bool* success); |
83 void OnMsgFlush(const HostResource& context, | 85 void OnMsgFlush(const HostResource& context, |
84 int32 put_offset, | 86 int32 put_offset, |
(...skipping 23 matching lines...) Expand all Loading... |
108 ProxyNonThreadSafeRefCount> callback_factory_; | 110 ProxyNonThreadSafeRefCount> callback_factory_; |
109 | 111 |
110 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Proxy); | 112 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Proxy); |
111 }; | 113 }; |
112 | 114 |
113 } // namespace proxy | 115 } // namespace proxy |
114 } // namespace ppapi | 116 } // namespace ppapi |
115 | 117 |
116 #endif // PPAPI_PROXY_PPB_GRAPHICS_3D_PROXY_H_ | 118 #endif // PPAPI_PROXY_PPB_GRAPHICS_3D_PROXY_H_ |
117 | 119 |
OLD | NEW |