| 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_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 18 matching lines...) Expand all Loading... |
| 29 virtual ~Graphics3D(); | 29 virtual ~Graphics3D(); |
| 30 | 30 |
| 31 bool Init(); | 31 bool Init(); |
| 32 | 32 |
| 33 // Resource overrides. | 33 // Resource overrides. |
| 34 virtual thunk::PPB_Graphics3D_API* AsPPB_Graphics3D_API() OVERRIDE { | 34 virtual thunk::PPB_Graphics3D_API* AsPPB_Graphics3D_API() OVERRIDE { |
| 35 return this; | 35 return this; |
| 36 } | 36 } |
| 37 | 37 |
| 38 // Graphics3DTrusted API. These are not implemented in the proxy. | 38 // Graphics3DTrusted API. These are not implemented in the proxy. |
| 39 virtual PP_Bool InitCommandBuffer(int32_t size) OVERRIDE; | 39 virtual PP_Bool InitCommandBuffer() OVERRIDE; |
| 40 virtual PP_Bool GetRingBuffer(int* shm_handle, uint32_t* shm_size) OVERRIDE; | 40 virtual PP_Bool SetGetBuffer(int32_t shm_id) OVERRIDE; |
| 41 virtual PP_Graphics3DTrustedState GetState() OVERRIDE; | 41 virtual PP_Graphics3DTrustedState GetState() OVERRIDE; |
| 42 virtual PP_Bool Flush(int32_t put_offset) OVERRIDE; | 42 virtual PP_Bool Flush(int32_t put_offset) OVERRIDE; |
| 43 virtual PP_Graphics3DTrustedState FlushSync(int32_t put_offset) OVERRIDE; | 43 virtual PP_Graphics3DTrustedState FlushSync(int32_t put_offset) OVERRIDE; |
| 44 virtual int32_t CreateTransferBuffer(uint32_t size) OVERRIDE; | 44 virtual int32_t CreateTransferBuffer(uint32_t size) OVERRIDE; |
| 45 virtual PP_Bool DestroyTransferBuffer(int32_t id) OVERRIDE; | 45 virtual PP_Bool DestroyTransferBuffer(int32_t id) OVERRIDE; |
| 46 virtual PP_Bool GetTransferBuffer(int32_t id, | 46 virtual PP_Bool GetTransferBuffer(int32_t id, |
| 47 int* shm_handle, | 47 int* shm_handle, |
| 48 uint32_t* shm_size) OVERRIDE; | 48 uint32_t* shm_size) OVERRIDE; |
| 49 virtual PP_Graphics3DTrustedState FlushSyncFast( | 49 virtual PP_Graphics3DTrustedState FlushSyncFast( |
| 50 int32_t put_offset, | 50 int32_t put_offset, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 72 | 72 |
| 73 // InterfaceProxy implementation. | 73 // InterfaceProxy implementation. |
| 74 virtual bool OnMessageReceived(const IPC::Message& msg); | 74 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 75 | 75 |
| 76 static const ApiID kApiID = API_ID_PPB_GRAPHICS_3D; | 76 static const ApiID kApiID = API_ID_PPB_GRAPHICS_3D; |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 void OnMsgCreate(PP_Instance instance, | 79 void OnMsgCreate(PP_Instance instance, |
| 80 const std::vector<int32_t>& attribs, | 80 const std::vector<int32_t>& attribs, |
| 81 HostResource* result); | 81 HostResource* result); |
| 82 void OnMsgInitCommandBuffer(const HostResource& context, | 82 void OnMsgInitCommandBuffer(const HostResource& context); |
| 83 int32 size, | 83 void OnMsgSetGetBuffer(const HostResource& context, |
| 84 base::SharedMemoryHandle* ring_buffer); | 84 int32 id); |
| 85 void OnMsgGetState(const HostResource& context, | 85 void OnMsgGetState(const HostResource& context, |
| 86 gpu::CommandBuffer::State* state); | 86 gpu::CommandBuffer::State* state); |
| 87 void OnMsgFlush(const HostResource& context, | 87 void OnMsgFlush(const HostResource& context, |
| 88 int32 put_offset, | 88 int32 put_offset, |
| 89 int32 last_known_get, | 89 int32 last_known_get, |
| 90 gpu::CommandBuffer::State* state); | 90 gpu::CommandBuffer::State* state); |
| 91 void OnMsgAsyncFlush(const HostResource& context, | 91 void OnMsgAsyncFlush(const HostResource& context, |
| 92 int32 put_offset); | 92 int32 put_offset); |
| 93 void OnMsgCreateTransferBuffer(const HostResource& context, | 93 void OnMsgCreateTransferBuffer(const HostResource& context, |
| 94 int32 size, | 94 int32 size, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 111 ProxyNonThreadSafeRefCount> callback_factory_; | 111 ProxyNonThreadSafeRefCount> callback_factory_; |
| 112 | 112 |
| 113 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Proxy); | 113 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Proxy); |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 } // namespace proxy | 116 } // namespace proxy |
| 117 } // namespace ppapi | 117 } // namespace ppapi |
| 118 | 118 |
| 119 #endif // PPAPI_PROXY_PPB_GRAPHICS_3D_PROXY_H_ | 119 #endif // PPAPI_PROXY_PPB_GRAPHICS_3D_PROXY_H_ |
| 120 | 120 |
| OLD | NEW |