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

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

Issue 213353005: Refactor gpu::Buffer to allow different types of backing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix pointer alignment in tests Created 6 years, 8 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/ppapi_command_buffer_proxy.cc ('k') | no next file » | 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) 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 #include "ppapi/proxy/ppb_graphics_3d_proxy.h" 5 #include "ppapi/proxy/ppb_graphics_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 "gpu/command_buffer/common/command_buffer.h" 8 #include "gpu/command_buffer/common/command_buffer.h"
9 #include "ppapi/c/pp_errors.h" 9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/proxy/enter_proxy.h" 10 #include "ppapi/proxy/enter_proxy.h"
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 uint32 size, 290 uint32 size,
291 int32* id, 291 int32* id,
292 ppapi::proxy::SerializedHandle* transfer_buffer) { 292 ppapi::proxy::SerializedHandle* transfer_buffer) {
293 transfer_buffer->set_null_shmem(); 293 transfer_buffer->set_null_shmem();
294 EnterHostFromHostResource<PPB_Graphics3D_API> enter(context); 294 EnterHostFromHostResource<PPB_Graphics3D_API> enter(context);
295 if (enter.succeeded()) { 295 if (enter.succeeded()) {
296 scoped_refptr<gpu::Buffer> buffer = 296 scoped_refptr<gpu::Buffer> buffer =
297 enter.object()->CreateTransferBuffer(size, id); 297 enter.object()->CreateTransferBuffer(size, id);
298 if (!buffer) 298 if (!buffer)
299 return; 299 return;
300 DCHECK(buffer->shared_memory()); 300 gpu::SharedMemoryBufferBacking* backing =
301 static_cast<gpu::SharedMemoryBufferBacking*>(buffer->backing());
302 DCHECK(backing && backing->shared_memory());
301 transfer_buffer->set_shmem( 303 transfer_buffer->set_shmem(
302 TransportSHMHandle(dispatcher(), buffer->shared_memory()), 304 TransportSHMHandle(dispatcher(), backing->shared_memory()),
303 buffer->size()); 305 buffer->size());
304 } else { 306 } else {
305 *id = -1; 307 *id = -1;
306 } 308 }
307 } 309 }
308 310
309 void PPB_Graphics3D_Proxy::OnMsgDestroyTransferBuffer( 311 void PPB_Graphics3D_Proxy::OnMsgDestroyTransferBuffer(
310 const HostResource& context, 312 const HostResource& context,
311 int32 id) { 313 int32 id) {
312 EnterHostFromHostResource<PPB_Graphics3D_API> enter(context); 314 EnterHostFromHostResource<PPB_Graphics3D_API> enter(context);
(...skipping 30 matching lines...) Expand all
343 int32_t result, 345 int32_t result,
344 const HostResource& context) { 346 const HostResource& context) {
345 dispatcher()->Send(new PpapiMsg_PPBGraphics3D_SwapBuffersACK( 347 dispatcher()->Send(new PpapiMsg_PPBGraphics3D_SwapBuffersACK(
346 API_ID_PPB_GRAPHICS_3D, context, result)); 348 API_ID_PPB_GRAPHICS_3D, context, result));
347 } 349 }
348 #endif // !defined(OS_NACL) 350 #endif // !defined(OS_NACL)
349 351
350 } // namespace proxy 352 } // namespace proxy
351 } // namespace ppapi 353 } // namespace ppapi
352 354
OLDNEW
« no previous file with comments | « ppapi/proxy/ppapi_command_buffer_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698