Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: ppapi/proxy/ppb_graphics_3d_proxy.h

Issue 1345813002: Added a unique command buffer ID for command buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed tests Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "gpu/command_buffer/common/command_buffer.h" 10 #include "gpu/command_buffer/common/command_buffer.h"
11 #include "ppapi/c/pp_graphics_3d.h" 11 #include "ppapi/c/pp_graphics_3d.h"
12 #include "ppapi/c/pp_instance.h" 12 #include "ppapi/c/pp_instance.h"
13 #include "ppapi/proxy/interface_proxy.h" 13 #include "ppapi/proxy/interface_proxy.h"
14 #include "ppapi/proxy/ppapi_proxy_export.h" 14 #include "ppapi/proxy/ppapi_proxy_export.h"
15 #include "ppapi/proxy/proxy_completion_callback_factory.h" 15 #include "ppapi/proxy/proxy_completion_callback_factory.h"
16 #include "ppapi/shared_impl/ppb_graphics_3d_shared.h" 16 #include "ppapi/shared_impl/ppb_graphics_3d_shared.h"
17 #include "ppapi/shared_impl/resource.h" 17 #include "ppapi/shared_impl/resource.h"
18 #include "ppapi/utility/completion_callback_factory.h" 18 #include "ppapi/utility/completion_callback_factory.h"
19 19
20 namespace gpu { 20 namespace gpu {
21 struct Capabilities; 21 struct Capabilities;
22 } 22 }
23 23
24 namespace ppapi { 24 namespace ppapi {
25 25
26 class HostResource; 26 class HostResource;
27 struct CommandBufferIDPair;
27 28
28 namespace proxy { 29 namespace proxy {
29 30
30 class SerializedHandle; 31 class SerializedHandle;
31 class PpapiCommandBufferProxy; 32 class PpapiCommandBufferProxy;
32 33
33 class PPAPI_PROXY_EXPORT Graphics3D : public PPB_Graphics3D_Shared { 34 class PPAPI_PROXY_EXPORT Graphics3D : public PPB_Graphics3D_Shared {
34 public: 35 public:
35 explicit Graphics3D(const HostResource& resource); 36 explicit Graphics3D(const HostResource& resource);
36 ~Graphics3D() override; 37 ~Graphics3D() override;
37 38
38 bool Init(gpu::gles2::GLES2Implementation* share_gles2, 39 bool Init(gpu::gles2::GLES2Implementation* share_gles2,
39 const gpu::Capabilities& capabilities, 40 const gpu::Capabilities& capabilities,
40 const SerializedHandle& shared_state); 41 const SerializedHandle& shared_state,
42 gpu::CommandBufferNamespace namespace_id,
43 uint64_t command_buffer_id);
41 44
42 // Graphics3DTrusted API. These are not implemented in the proxy. 45 // Graphics3DTrusted API. These are not implemented in the proxy.
43 PP_Bool SetGetBuffer(int32_t shm_id) override; 46 PP_Bool SetGetBuffer(int32_t shm_id) override;
44 PP_Bool Flush(int32_t put_offset) override; 47 PP_Bool Flush(int32_t put_offset) override;
45 scoped_refptr<gpu::Buffer> CreateTransferBuffer(uint32_t size, 48 scoped_refptr<gpu::Buffer> CreateTransferBuffer(uint32_t size,
46 int32* id) override; 49 int32* id) override;
47 PP_Bool DestroyTransferBuffer(int32_t id) override; 50 PP_Bool DestroyTransferBuffer(int32_t id) override;
48 gpu::CommandBuffer::State WaitForTokenInRange(int32_t start, 51 gpu::CommandBuffer::State WaitForTokenInRange(int32_t start,
49 int32_t end) override; 52 int32_t end) override;
50 gpu::CommandBuffer::State WaitForGetOffsetInRange(int32_t start, 53 gpu::CommandBuffer::State WaitForGetOffsetInRange(int32_t start,
(...skipping 27 matching lines...) Expand all
78 bool OnMessageReceived(const IPC::Message& msg) override; 81 bool OnMessageReceived(const IPC::Message& msg) override;
79 82
80 static const ApiID kApiID = API_ID_PPB_GRAPHICS_3D; 83 static const ApiID kApiID = API_ID_PPB_GRAPHICS_3D;
81 84
82 private: 85 private:
83 void OnMsgCreate(PP_Instance instance, 86 void OnMsgCreate(PP_Instance instance,
84 HostResource share_context, 87 HostResource share_context,
85 const std::vector<int32_t>& attribs, 88 const std::vector<int32_t>& attribs,
86 HostResource* result, 89 HostResource* result,
87 gpu::Capabilities* capabilities, 90 gpu::Capabilities* capabilities,
88 SerializedHandle* handle); 91 SerializedHandle* handle,
92 CommandBufferIDPair* id_pair);
89 void OnMsgSetGetBuffer(const HostResource& context, 93 void OnMsgSetGetBuffer(const HostResource& context,
90 int32 id); 94 int32 id);
91 void OnMsgWaitForTokenInRange(const HostResource& context, 95 void OnMsgWaitForTokenInRange(const HostResource& context,
92 int32 start, 96 int32 start,
93 int32 end, 97 int32 end,
94 gpu::CommandBuffer::State* state, 98 gpu::CommandBuffer::State* state,
95 bool* success); 99 bool* success);
96 void OnMsgWaitForGetOffsetInRange(const HostResource& context, 100 void OnMsgWaitForGetOffsetInRange(const HostResource& context,
97 int32 start, 101 int32 start,
98 int32 end, 102 int32 end,
(...skipping 22 matching lines...) Expand all
121 ProxyCompletionCallbackFactory<PPB_Graphics3D_Proxy> callback_factory_; 125 ProxyCompletionCallbackFactory<PPB_Graphics3D_Proxy> callback_factory_;
122 126
123 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Proxy); 127 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Proxy);
124 }; 128 };
125 129
126 } // namespace proxy 130 } // namespace proxy
127 } // namespace ppapi 131 } // namespace ppapi
128 132
129 #endif // PPAPI_PROXY_PPB_GRAPHICS_3D_PROXY_H_ 133 #endif // PPAPI_PROXY_PPB_GRAPHICS_3D_PROXY_H_
130 134
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698