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" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 } | 129 } |
130 } | 130 } |
131 attribs.push_back(PP_GRAPHICS3DATTRIB_NONE); // Always terminate. | 131 attribs.push_back(PP_GRAPHICS3DATTRIB_NONE); // Always terminate. |
132 | 132 |
133 HostResource result; | 133 HostResource result; |
134 dispatcher->Send(new PpapiHostMsg_PPBSurface3D_Create( | 134 dispatcher->Send(new PpapiHostMsg_PPBSurface3D_Create( |
135 INTERFACE_ID_PPB_SURFACE_3D, instance, config, attribs, &result)); | 135 INTERFACE_ID_PPB_SURFACE_3D, instance, config, attribs, &result)); |
136 | 136 |
137 if (result.is_null()) | 137 if (result.is_null()) |
138 return 0; | 138 return 0; |
139 linked_ptr<Surface3D> surface_3d(new Surface3D(result)); | 139 scoped_refptr<Surface3D> surface_3d(new Surface3D(result)); |
140 PP_Resource resource = | 140 PP_Resource resource = |
141 PluginResourceTracker::GetInstance()->AddResource(surface_3d); | 141 PluginResourceTracker::GetInstance()->AddResource(surface_3d); |
142 surface_3d->set_resource(resource); | 142 surface_3d->set_resource(resource); |
143 return resource; | 143 return resource; |
144 } | 144 } |
145 | 145 |
146 bool PPB_Surface3D_Proxy::OnMessageReceived(const IPC::Message& msg) { | 146 bool PPB_Surface3D_Proxy::OnMessageReceived(const IPC::Message& msg) { |
147 bool handled = true; | 147 bool handled = true; |
148 IPC_BEGIN_MESSAGE_MAP(PPB_Surface3D_Proxy, msg) | 148 IPC_BEGIN_MESSAGE_MAP(PPB_Surface3D_Proxy, msg) |
149 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBSurface3D_Create, | 149 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBSurface3D_Create, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 193 |
194 void PPB_Surface3D_Proxy::SendSwapBuffersACKToPlugin( | 194 void PPB_Surface3D_Proxy::SendSwapBuffersACKToPlugin( |
195 int32_t result, | 195 int32_t result, |
196 const HostResource& surface_3d) { | 196 const HostResource& surface_3d) { |
197 dispatcher()->Send(new PpapiMsg_PPBSurface3D_SwapBuffersACK( | 197 dispatcher()->Send(new PpapiMsg_PPBSurface3D_SwapBuffersACK( |
198 INTERFACE_ID_PPB_SURFACE_3D, surface_3d, result)); | 198 INTERFACE_ID_PPB_SURFACE_3D, surface_3d, result)); |
199 } | 199 } |
200 | 200 |
201 } // namespace proxy | 201 } // namespace proxy |
202 } // namespace pp | 202 } // namespace pp |
OLD | NEW |