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> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "gpu/command_buffer/common/command_buffer.h" | 13 #include "gpu/command_buffer/common/command_buffer.h" |
| 14 #include "gpu/command_buffer/common/command_buffer_id.h" |
14 #include "ppapi/c/pp_graphics_3d.h" | 15 #include "ppapi/c/pp_graphics_3d.h" |
15 #include "ppapi/c/pp_instance.h" | 16 #include "ppapi/c/pp_instance.h" |
16 #include "ppapi/proxy/interface_proxy.h" | 17 #include "ppapi/proxy/interface_proxy.h" |
17 #include "ppapi/proxy/ppapi_proxy_export.h" | 18 #include "ppapi/proxy/ppapi_proxy_export.h" |
18 #include "ppapi/proxy/proxy_completion_callback_factory.h" | 19 #include "ppapi/proxy/proxy_completion_callback_factory.h" |
19 #include "ppapi/shared_impl/ppb_graphics_3d_shared.h" | 20 #include "ppapi/shared_impl/ppb_graphics_3d_shared.h" |
20 #include "ppapi/shared_impl/resource.h" | 21 #include "ppapi/shared_impl/resource.h" |
21 #include "ppapi/utility/completion_callback_factory.h" | 22 #include "ppapi/utility/completion_callback_factory.h" |
22 | 23 |
23 namespace gpu { | 24 namespace gpu { |
(...skipping 10 matching lines...) Expand all Loading... |
34 class PpapiCommandBufferProxy; | 35 class PpapiCommandBufferProxy; |
35 | 36 |
36 class PPAPI_PROXY_EXPORT Graphics3D : public PPB_Graphics3D_Shared { | 37 class PPAPI_PROXY_EXPORT Graphics3D : public PPB_Graphics3D_Shared { |
37 public: | 38 public: |
38 explicit Graphics3D(const HostResource& resource); | 39 explicit Graphics3D(const HostResource& resource); |
39 ~Graphics3D() override; | 40 ~Graphics3D() override; |
40 | 41 |
41 bool Init(gpu::gles2::GLES2Implementation* share_gles2, | 42 bool Init(gpu::gles2::GLES2Implementation* share_gles2, |
42 const gpu::Capabilities& capabilities, | 43 const gpu::Capabilities& capabilities, |
43 const SerializedHandle& shared_state, | 44 const SerializedHandle& shared_state, |
44 uint64_t command_buffer_id); | 45 gpu::CommandBufferId command_buffer_id); |
45 | 46 |
46 // Graphics3DTrusted API. These are not implemented in the proxy. | 47 // Graphics3DTrusted API. These are not implemented in the proxy. |
47 PP_Bool SetGetBuffer(int32_t shm_id) override; | 48 PP_Bool SetGetBuffer(int32_t shm_id) override; |
48 PP_Bool Flush(int32_t put_offset) override; | 49 PP_Bool Flush(int32_t put_offset) override; |
49 scoped_refptr<gpu::Buffer> CreateTransferBuffer(uint32_t size, | 50 scoped_refptr<gpu::Buffer> CreateTransferBuffer(uint32_t size, |
50 int32_t* id) override; | 51 int32_t* id) override; |
51 PP_Bool DestroyTransferBuffer(int32_t id) override; | 52 PP_Bool DestroyTransferBuffer(int32_t id) override; |
52 gpu::CommandBuffer::State WaitForTokenInRange(int32_t start, | 53 gpu::CommandBuffer::State WaitForTokenInRange(int32_t start, |
53 int32_t end) override; | 54 int32_t end) override; |
54 gpu::CommandBuffer::State WaitForGetOffsetInRange(int32_t start, | 55 gpu::CommandBuffer::State WaitForGetOffsetInRange(int32_t start, |
(...skipping 26 matching lines...) Expand all Loading... |
81 | 82 |
82 static const ApiID kApiID = API_ID_PPB_GRAPHICS_3D; | 83 static const ApiID kApiID = API_ID_PPB_GRAPHICS_3D; |
83 | 84 |
84 private: | 85 private: |
85 void OnMsgCreate(PP_Instance instance, | 86 void OnMsgCreate(PP_Instance instance, |
86 HostResource share_context, | 87 HostResource share_context, |
87 const std::vector<int32_t>& attribs, | 88 const std::vector<int32_t>& attribs, |
88 HostResource* result, | 89 HostResource* result, |
89 gpu::Capabilities* capabilities, | 90 gpu::Capabilities* capabilities, |
90 SerializedHandle* handle, | 91 SerializedHandle* handle, |
91 uint64_t* command_buffer_id); | 92 gpu::CommandBufferId* command_buffer_id); |
92 void OnMsgSetGetBuffer(const HostResource& context, int32_t id); | 93 void OnMsgSetGetBuffer(const HostResource& context, int32_t id); |
93 void OnMsgWaitForTokenInRange(const HostResource& context, | 94 void OnMsgWaitForTokenInRange(const HostResource& context, |
94 int32_t start, | 95 int32_t start, |
95 int32_t end, | 96 int32_t end, |
96 gpu::CommandBuffer::State* state, | 97 gpu::CommandBuffer::State* state, |
97 bool* success); | 98 bool* success); |
98 void OnMsgWaitForGetOffsetInRange(const HostResource& context, | 99 void OnMsgWaitForGetOffsetInRange(const HostResource& context, |
99 int32_t start, | 100 int32_t start, |
100 int32_t end, | 101 int32_t end, |
101 gpu::CommandBuffer::State* state, | 102 gpu::CommandBuffer::State* state, |
(...skipping 18 matching lines...) Expand all Loading... |
120 ProxyCompletionCallbackFactory<PPB_Graphics3D_Proxy> callback_factory_; | 121 ProxyCompletionCallbackFactory<PPB_Graphics3D_Proxy> callback_factory_; |
121 | 122 |
122 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Proxy); | 123 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Proxy); |
123 }; | 124 }; |
124 | 125 |
125 } // namespace proxy | 126 } // namespace proxy |
126 } // namespace ppapi | 127 } // namespace ppapi |
127 | 128 |
128 #endif // PPAPI_PROXY_PPB_GRAPHICS_3D_PROXY_H_ | 129 #endif // PPAPI_PROXY_PPB_GRAPHICS_3D_PROXY_H_ |
129 | 130 |
OLD | NEW |