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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 virtual int32 DoSwapBuffers() OVERRIDE; | 56 virtual int32 DoSwapBuffers() OVERRIDE; |
57 | 57 |
58 private: | 58 private: |
59 scoped_ptr<gpu::CommandBuffer> command_buffer_; | 59 scoped_ptr<gpu::CommandBuffer> command_buffer_; |
60 | 60 |
61 DISALLOW_COPY_AND_ASSIGN(Graphics3D); | 61 DISALLOW_COPY_AND_ASSIGN(Graphics3D); |
62 }; | 62 }; |
63 | 63 |
64 class PPB_Graphics3D_Proxy : public InterfaceProxy { | 64 class PPB_Graphics3D_Proxy : public InterfaceProxy { |
65 public: | 65 public: |
66 PPB_Graphics3D_Proxy(Dispatcher* dispatcher); | 66 PPB_Graphics3D_Proxy(Dispatcher* dispatcher, const void* target_interface); |
67 virtual ~PPB_Graphics3D_Proxy(); | 67 virtual ~PPB_Graphics3D_Proxy(); |
68 | 68 |
| 69 static const Info* GetInfo(); |
| 70 |
69 static PP_Resource CreateProxyResource(PP_Instance instance, | 71 static PP_Resource CreateProxyResource(PP_Instance instance, |
70 PP_Resource share_context, | 72 PP_Resource share_context, |
71 const int32_t* attrib_list); | 73 const int32_t* attrib_list); |
72 | 74 |
| 75 const PPB_Graphics3D* ppb_graphics_3d_target() const { |
| 76 return static_cast<const PPB_Graphics3D*>(target_interface()); |
| 77 } |
| 78 |
73 // InterfaceProxy implementation. | 79 // InterfaceProxy implementation. |
74 virtual bool OnMessageReceived(const IPC::Message& msg); | 80 virtual bool OnMessageReceived(const IPC::Message& msg); |
75 | 81 |
76 static const InterfaceID kInterfaceID = INTERFACE_ID_PPB_GRAPHICS_3D; | |
77 | |
78 private: | 82 private: |
79 void OnMsgCreate(PP_Instance instance, | 83 void OnMsgCreate(PP_Instance instance, |
80 const std::vector<int32_t>& attribs, | 84 const std::vector<int32_t>& attribs, |
81 HostResource* result); | 85 HostResource* result); |
82 void OnMsgInitCommandBuffer(const HostResource& context, | 86 void OnMsgInitCommandBuffer(const HostResource& context, |
83 int32 size, | 87 int32 size, |
84 base::SharedMemoryHandle* ring_buffer); | 88 base::SharedMemoryHandle* ring_buffer); |
85 void OnMsgGetState(const HostResource& context, | 89 void OnMsgGetState(const HostResource& context, |
86 gpu::CommandBuffer::State* state); | 90 gpu::CommandBuffer::State* state); |
87 void OnMsgFlush(const HostResource& context, | 91 void OnMsgFlush(const HostResource& context, |
(...skipping 23 matching lines...) Expand all Loading... |
111 ProxyNonThreadSafeRefCount> callback_factory_; | 115 ProxyNonThreadSafeRefCount> callback_factory_; |
112 | 116 |
113 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Proxy); | 117 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Proxy); |
114 }; | 118 }; |
115 | 119 |
116 } // namespace proxy | 120 } // namespace proxy |
117 } // namespace ppapi | 121 } // namespace ppapi |
118 | 122 |
119 #endif // PPAPI_PROXY_PPB_GRAPHICS_3D_PROXY_H_ | 123 #endif // PPAPI_PROXY_PPB_GRAPHICS_3D_PROXY_H_ |
120 | 124 |
OLD | NEW |