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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 class HostResource; | 33 class HostResource; |
34 | 34 |
35 namespace proxy { | 35 namespace proxy { |
36 | 36 |
37 class SerializedHandle; | 37 class SerializedHandle; |
38 class PpapiCommandBufferProxy; | 38 class PpapiCommandBufferProxy; |
39 | 39 |
40 class PPAPI_PROXY_EXPORT Graphics3D : public PPB_Graphics3D_Shared { | 40 class PPAPI_PROXY_EXPORT Graphics3D : public PPB_Graphics3D_Shared { |
41 public: | 41 public: |
42 Graphics3D(const HostResource& resource, const gfx::Size& size); | 42 explicit Graphics3D(const HostResource& resource); |
43 ~Graphics3D() override; | 43 ~Graphics3D() override; |
44 | 44 |
45 bool Init(gpu::gles2::GLES2Implementation* share_gles2, | 45 bool Init(gpu::gles2::GLES2Implementation* share_gles2, |
46 const gpu::Capabilities& capabilities, | 46 const gpu::Capabilities& capabilities, |
47 const SerializedHandle& shared_state, | 47 const SerializedHandle& shared_state, |
48 gpu::CommandBufferId command_buffer_id); | 48 gpu::CommandBufferId command_buffer_id); |
49 | 49 |
50 // Graphics3DTrusted API. These are not implemented in the proxy. | 50 // Graphics3DTrusted API. These are not implemented in the proxy. |
51 PP_Bool SetGetBuffer(int32_t shm_id) override; | 51 PP_Bool SetGetBuffer(int32_t shm_id) override; |
52 PP_Bool Flush(int32_t put_offset) override; | 52 PP_Bool Flush(int32_t put_offset) override; |
53 scoped_refptr<gpu::Buffer> CreateTransferBuffer(uint32_t size, | 53 scoped_refptr<gpu::Buffer> CreateTransferBuffer(uint32_t size, |
54 int32_t* id) override; | 54 int32_t* id) override; |
55 PP_Bool DestroyTransferBuffer(int32_t id) override; | 55 PP_Bool DestroyTransferBuffer(int32_t id) override; |
56 gpu::CommandBuffer::State WaitForTokenInRange(int32_t start, | 56 gpu::CommandBuffer::State WaitForTokenInRange(int32_t start, |
57 int32_t end) override; | 57 int32_t end) override; |
58 gpu::CommandBuffer::State WaitForGetOffsetInRange(int32_t start, | 58 gpu::CommandBuffer::State WaitForGetOffsetInRange(int32_t start, |
59 int32_t end) override; | 59 int32_t end) override; |
60 void EnsureWorkVisible() override; | 60 void EnsureWorkVisible() override; |
61 void TakeFrontBuffer() override; | 61 void TakeFrontBuffer() override; |
62 | 62 |
63 private: | 63 private: |
64 // PPB_Graphics3D_Shared overrides. | 64 // PPB_Graphics3D_Shared overrides. |
65 gpu::CommandBuffer* GetCommandBuffer() override; | 65 gpu::CommandBuffer* GetCommandBuffer() override; |
66 gpu::GpuControl* GetGpuControl() override; | 66 gpu::GpuControl* GetGpuControl() override; |
67 int32_t DoSwapBuffers(const gpu::SyncToken& sync_token, | 67 int32_t DoSwapBuffers(const gpu::SyncToken& sync_token, |
68 const gfx::Size& size) override; | 68 int32_t width, |
| 69 int32_t height) override; |
69 | 70 |
70 std::unique_ptr<PpapiCommandBufferProxy> command_buffer_; | 71 std::unique_ptr<PpapiCommandBufferProxy> command_buffer_; |
71 | 72 |
72 DISALLOW_COPY_AND_ASSIGN(Graphics3D); | 73 DISALLOW_COPY_AND_ASSIGN(Graphics3D); |
73 }; | 74 }; |
74 | 75 |
75 class PPB_Graphics3D_Proxy : public InterfaceProxy { | 76 class PPB_Graphics3D_Proxy : public InterfaceProxy { |
76 public: | 77 public: |
77 explicit PPB_Graphics3D_Proxy(Dispatcher* dispatcher); | 78 explicit PPB_Graphics3D_Proxy(Dispatcher* dispatcher); |
78 ~PPB_Graphics3D_Proxy(); | 79 ~PPB_Graphics3D_Proxy(); |
(...skipping 29 matching lines...) Expand all Loading... |
108 bool* success); | 109 bool* success); |
109 void OnMsgAsyncFlush(const HostResource& context, int32_t put_offset); | 110 void OnMsgAsyncFlush(const HostResource& context, int32_t put_offset); |
110 void OnMsgCreateTransferBuffer( | 111 void OnMsgCreateTransferBuffer( |
111 const HostResource& context, | 112 const HostResource& context, |
112 uint32_t size, | 113 uint32_t size, |
113 int32_t* id, | 114 int32_t* id, |
114 ppapi::proxy::SerializedHandle* transfer_buffer); | 115 ppapi::proxy::SerializedHandle* transfer_buffer); |
115 void OnMsgDestroyTransferBuffer(const HostResource& context, int32_t id); | 116 void OnMsgDestroyTransferBuffer(const HostResource& context, int32_t id); |
116 void OnMsgSwapBuffers(const HostResource& context, | 117 void OnMsgSwapBuffers(const HostResource& context, |
117 const gpu::SyncToken& sync_token, | 118 const gpu::SyncToken& sync_token, |
118 const gfx::Size& size); | 119 int32_t width, |
| 120 int32_t height); |
119 void OnMsgTakeFrontBuffer(const HostResource& context); | 121 void OnMsgTakeFrontBuffer(const HostResource& context); |
120 void OnMsgEnsureWorkVisible(const HostResource& context); | 122 void OnMsgEnsureWorkVisible(const HostResource& context); |
121 // Renderer->plugin message handlers. | 123 // Renderer->plugin message handlers. |
122 void OnMsgSwapBuffersACK(const HostResource& context, | 124 void OnMsgSwapBuffersACK(const HostResource& context, |
123 int32_t pp_error); | 125 int32_t pp_error); |
124 | 126 |
125 void SendSwapBuffersACKToPlugin(int32_t result, | 127 void SendSwapBuffersACKToPlugin(int32_t result, |
126 const HostResource& context); | 128 const HostResource& context); |
127 | 129 |
128 ProxyCompletionCallbackFactory<PPB_Graphics3D_Proxy> callback_factory_; | 130 ProxyCompletionCallbackFactory<PPB_Graphics3D_Proxy> callback_factory_; |
129 | 131 |
130 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Proxy); | 132 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Proxy); |
131 }; | 133 }; |
132 | 134 |
133 } // namespace proxy | 135 } // namespace proxy |
134 } // namespace ppapi | 136 } // namespace ppapi |
135 | 137 |
136 #endif // PPAPI_PROXY_PPB_GRAPHICS_3D_PROXY_H_ | 138 #endif // PPAPI_PROXY_PPB_GRAPHICS_3D_PROXY_H_ |
137 | 139 |
OLD | NEW |