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

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

Issue 7530010: Added PPB_Graphics3D_Dev::Resize to let plugins resize the backing surface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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
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_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 "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/proxy/enter_proxy.h" 9 #include "ppapi/proxy/enter_proxy.h"
10 #include "ppapi/proxy/plugin_dispatcher.h" 10 #include "ppapi/proxy/plugin_dispatcher.h"
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 return PP_ERROR_BADARGUMENT; 424 return PP_ERROR_BADARGUMENT;
425 425
426 // TODO(alokp): Support shared context. 426 // TODO(alokp): Support shared context.
427 DCHECK_EQ(0, share_context); 427 DCHECK_EQ(0, share_context);
428 if (share_context != 0) 428 if (share_context != 0)
429 return 0; 429 return 0;
430 430
431 std::vector<int32_t> attribs; 431 std::vector<int32_t> attribs;
432 if (attrib_list) { 432 if (attrib_list) {
433 for (const int32_t* attr = attrib_list; 433 for (const int32_t* attr = attrib_list;
434 *attr != PP_GRAPHICS3DATTRIB_NONE; 434 attr[0] != PP_GRAPHICS3DATTRIB_NONE;
435 ++attr) { 435 attr += 2) {
436 attribs.push_back(*attr); 436 attribs.push_back(attr[0]);
437 attribs.push_back(attr[1]);
437 } 438 }
438 attribs.push_back(PP_GRAPHICS3DATTRIB_NONE);
439 } 439 }
440 attribs.push_back(PP_GRAPHICS3DATTRIB_NONE);
440 441
441 HostResource result; 442 HostResource result;
442 dispatcher->Send(new PpapiHostMsg_PPBGraphics3D_Create( 443 dispatcher->Send(new PpapiHostMsg_PPBGraphics3D_Create(
443 INTERFACE_ID_PPB_GRAPHICS_3D, instance, config, attribs, &result)); 444 INTERFACE_ID_PPB_GRAPHICS_3D, instance, config, attribs, &result));
444 if (result.is_null()) 445 if (result.is_null())
445 return 0; 446 return 0;
446 447
447 linked_ptr<Graphics3D> graphics_3d(new Graphics3D(result)); 448 linked_ptr<Graphics3D> graphics_3d(new Graphics3D(result));
448 if (!graphics_3d->Init()) 449 if (!graphics_3d->Init())
449 return 0; 450 return 0;
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 void PPB_Graphics3D_Proxy::SendSwapBuffersACKToPlugin( 609 void PPB_Graphics3D_Proxy::SendSwapBuffersACKToPlugin(
609 int32_t result, 610 int32_t result,
610 const HostResource& context) { 611 const HostResource& context) {
611 dispatcher()->Send(new PpapiMsg_PPBGraphics3D_SwapBuffersACK( 612 dispatcher()->Send(new PpapiMsg_PPBGraphics3D_SwapBuffersACK(
612 INTERFACE_ID_PPB_GRAPHICS_3D, context, result)); 613 INTERFACE_ID_PPB_GRAPHICS_3D, context, result));
613 } 614 }
614 615
615 } // namespace proxy 616 } // namespace proxy
616 } // namespace pp 617 } // namespace pp
617 618
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698