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 #include "ppapi/proxy/ppb_surface_3d_proxy.h" | 5 #include "ppapi/proxy/ppb_surface_3d_proxy.h" |
6 | 6 |
7 #include "gpu/command_buffer/client/gles2_implementation.h" | 7 #include "gpu/command_buffer/client/gles2_implementation.h" |
8 #include "ppapi/c/pp_errors.h" | 8 #include "ppapi/c/pp_errors.h" |
9 #include "ppapi/c/pp_resource.h" | 9 #include "ppapi/c/pp_resource.h" |
10 #include "ppapi/c/dev/ppb_surface_3d_dev.h" | 10 #include "ppapi/c/dev/ppb_surface_3d_dev.h" |
11 #include "ppapi/proxy/enter_proxy.h" | 11 #include "ppapi/proxy/enter_proxy.h" |
12 #include "ppapi/proxy/plugin_dispatcher.h" | 12 #include "ppapi/proxy/plugin_dispatcher.h" |
13 #include "ppapi/proxy/ppapi_messages.h" | 13 #include "ppapi/proxy/ppapi_messages.h" |
14 #include "ppapi/proxy/ppb_context_3d_proxy.h" | 14 #include "ppapi/proxy/ppb_context_3d_proxy.h" |
15 #include "ppapi/thunk/enter.h" | 15 #include "ppapi/thunk/enter.h" |
16 #include "ppapi/thunk/resource_creation_api.h" | 16 #include "ppapi/thunk/resource_creation_api.h" |
17 #include "ppapi/thunk/thunk.h" | 17 #include "ppapi/thunk/thunk.h" |
18 | 18 |
19 using ppapi::HostResource; | |
20 using ppapi::Resource; | |
21 using ppapi::thunk::EnterFunctionNoLock; | 19 using ppapi::thunk::EnterFunctionNoLock; |
22 using ppapi::thunk::PPB_Surface3D_API; | 20 using ppapi::thunk::PPB_Surface3D_API; |
23 using ppapi::thunk::ResourceCreationAPI; | 21 using ppapi::thunk::ResourceCreationAPI; |
24 | 22 |
25 namespace pp { | 23 namespace ppapi { |
26 namespace proxy { | 24 namespace proxy { |
27 | 25 |
28 namespace { | 26 namespace { |
29 | 27 |
30 InterfaceProxy* CreateSurface3DProxy(Dispatcher* dispatcher, | 28 InterfaceProxy* CreateSurface3DProxy(Dispatcher* dispatcher, |
31 const void* target_interface) { | 29 const void* target_interface) { |
32 return new PPB_Surface3D_Proxy(dispatcher, target_interface); | 30 return new PPB_Surface3D_Proxy(dispatcher, target_interface); |
33 } | 31 } |
34 | 32 |
35 } // namespace | 33 } // namespace |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 : InterfaceProxy(dispatcher, target_interface), | 93 : InterfaceProxy(dispatcher, target_interface), |
96 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 94 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
97 } | 95 } |
98 | 96 |
99 PPB_Surface3D_Proxy::~PPB_Surface3D_Proxy() { | 97 PPB_Surface3D_Proxy::~PPB_Surface3D_Proxy() { |
100 } | 98 } |
101 | 99 |
102 // static | 100 // static |
103 const InterfaceProxy::Info* PPB_Surface3D_Proxy::GetInfo() { | 101 const InterfaceProxy::Info* PPB_Surface3D_Proxy::GetInfo() { |
104 static const Info info = { | 102 static const Info info = { |
105 ::ppapi::thunk::GetPPB_Surface3D_Thunk(), | 103 thunk::GetPPB_Surface3D_Thunk(), |
106 PPB_SURFACE_3D_DEV_INTERFACE, | 104 PPB_SURFACE_3D_DEV_INTERFACE, |
107 INTERFACE_ID_PPB_SURFACE_3D, | 105 INTERFACE_ID_PPB_SURFACE_3D, |
108 false, | 106 false, |
109 &CreateSurface3DProxy, | 107 &CreateSurface3DProxy, |
110 }; | 108 }; |
111 return &info; | 109 return &info; |
112 } | 110 } |
113 | 111 |
114 // static | 112 // static |
115 PP_Resource PPB_Surface3D_Proxy::CreateProxyResource( | 113 PP_Resource PPB_Surface3D_Proxy::CreateProxyResource( |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 } | 186 } |
189 | 187 |
190 void PPB_Surface3D_Proxy::SendSwapBuffersACKToPlugin( | 188 void PPB_Surface3D_Proxy::SendSwapBuffersACKToPlugin( |
191 int32_t result, | 189 int32_t result, |
192 const HostResource& surface_3d) { | 190 const HostResource& surface_3d) { |
193 dispatcher()->Send(new PpapiMsg_PPBSurface3D_SwapBuffersACK( | 191 dispatcher()->Send(new PpapiMsg_PPBSurface3D_SwapBuffersACK( |
194 INTERFACE_ID_PPB_SURFACE_3D, surface_3d, result)); | 192 INTERFACE_ID_PPB_SURFACE_3D, surface_3d, result)); |
195 } | 193 } |
196 | 194 |
197 } // namespace proxy | 195 } // namespace proxy |
198 } // namespace pp | 196 } // namespace ppapi |
OLD | NEW |