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

Side by Side Diff: ppapi/proxy/ppb_surface_3d_proxy.cc

Issue 6899055: PPAPI: Force async callback invocation option. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/proxy/ppb_graphics_2d_proxy.cc ('k') | ppapi/proxy/ppb_url_loader_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 170
171 EnterFunctionNoLock<ResourceCreationAPI> enter(instance, true); 171 EnterFunctionNoLock<ResourceCreationAPI> enter(instance, true);
172 if (enter.succeeded()) { 172 if (enter.succeeded()) {
173 result->SetHostResource( 173 result->SetHostResource(
174 instance, 174 instance,
175 enter.functions()->CreateSurface3D(instance, config, &attribs.front())); 175 enter.functions()->CreateSurface3D(instance, config, &attribs.front()));
176 } 176 }
177 } 177 }
178 178
179 void PPB_Surface3D_Proxy::OnMsgSwapBuffers(const HostResource& surface_3d) { 179 void PPB_Surface3D_Proxy::OnMsgSwapBuffers(const HostResource& surface_3d) {
180 CompletionCallback callback = callback_factory_.NewCallback( 180 CompletionCallback callback = callback_factory_.NewOptionalCallback(
181 &PPB_Surface3D_Proxy::SendSwapBuffersACKToPlugin, surface_3d); 181 &PPB_Surface3D_Proxy::SendSwapBuffersACKToPlugin, surface_3d);
182 182
183 EnterHostFromHostResource<PPB_Surface3D_API> enter(surface_3d); 183 EnterHostFromHostResource<PPB_Surface3D_API> enter(surface_3d);
184 int32_t result = PP_ERROR_BADRESOURCE; 184 int32_t result = PP_ERROR_BADRESOURCE;
185 if (enter.succeeded()) 185 if (enter.succeeded())
186 result = enter.object()->SwapBuffers(callback.pp_completion_callback()); 186 result = enter.object()->SwapBuffers(callback.pp_completion_callback());
187 if (result != PP_OK_COMPLETIONPENDING) { 187 if (result != PP_OK_COMPLETIONPENDING) {
188 // There was some error, so we won't get a flush callback. We need to now 188 // There was some error, so we won't get a flush callback. We need to now
189 // issue the ACK to the plugin hears about the error. This will also clean 189 // issue the ACK to the plugin hears about the error. This will also clean
190 // up the data associated with the callback. 190 // up the data associated with the callback.
(...skipping 10 matching lines...) Expand all
201 201
202 void PPB_Surface3D_Proxy::SendSwapBuffersACKToPlugin( 202 void PPB_Surface3D_Proxy::SendSwapBuffersACKToPlugin(
203 int32_t result, 203 int32_t result,
204 const HostResource& surface_3d) { 204 const HostResource& surface_3d) {
205 dispatcher()->Send(new PpapiMsg_PPBSurface3D_SwapBuffersACK( 205 dispatcher()->Send(new PpapiMsg_PPBSurface3D_SwapBuffersACK(
206 INTERFACE_ID_PPB_SURFACE_3D, surface_3d, result)); 206 INTERFACE_ID_PPB_SURFACE_3D, surface_3d, result));
207 } 207 }
208 208
209 } // namespace proxy 209 } // namespace proxy
210 } // namespace pp 210 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_graphics_2d_proxy.cc ('k') | ppapi/proxy/ppb_url_loader_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698