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_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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 } | 441 } |
442 } | 442 } |
443 attribs.push_back(PP_GRAPHICS3DATTRIB_NONE); | 443 attribs.push_back(PP_GRAPHICS3DATTRIB_NONE); |
444 | 444 |
445 HostResource result; | 445 HostResource result; |
446 dispatcher->Send(new PpapiHostMsg_PPBGraphics3D_Create( | 446 dispatcher->Send(new PpapiHostMsg_PPBGraphics3D_Create( |
447 INTERFACE_ID_PPB_GRAPHICS_3D, instance, config, attribs, &result)); | 447 INTERFACE_ID_PPB_GRAPHICS_3D, instance, config, attribs, &result)); |
448 if (result.is_null()) | 448 if (result.is_null()) |
449 return 0; | 449 return 0; |
450 | 450 |
451 linked_ptr<Graphics3D> graphics_3d(new Graphics3D(result)); | 451 scoped_refptr<Graphics3D> graphics_3d(new Graphics3D(result)); |
452 if (!graphics_3d->Init()) | 452 if (!graphics_3d->Init()) |
453 return 0; | 453 return 0; |
454 | 454 |
455 return PluginResourceTracker::GetInstance()->AddResource(graphics_3d); | 455 return PluginResourceTracker::GetInstance()->AddResource(graphics_3d); |
456 } | 456 } |
457 | 457 |
458 bool PPB_Graphics3D_Proxy::OnMessageReceived(const IPC::Message& msg) { | 458 bool PPB_Graphics3D_Proxy::OnMessageReceived(const IPC::Message& msg) { |
459 bool handled = true; | 459 bool handled = true; |
460 IPC_BEGIN_MESSAGE_MAP(PPB_Graphics3D_Proxy, msg) | 460 IPC_BEGIN_MESSAGE_MAP(PPB_Graphics3D_Proxy, msg) |
461 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBGraphics3D_Create, | 461 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBGraphics3D_Create, |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 void PPB_Graphics3D_Proxy::SendSwapBuffersACKToPlugin( | 604 void PPB_Graphics3D_Proxy::SendSwapBuffersACKToPlugin( |
605 int32_t result, | 605 int32_t result, |
606 const HostResource& context) { | 606 const HostResource& context) { |
607 dispatcher()->Send(new PpapiMsg_PPBGraphics3D_SwapBuffersACK( | 607 dispatcher()->Send(new PpapiMsg_PPBGraphics3D_SwapBuffersACK( |
608 INTERFACE_ID_PPB_GRAPHICS_3D, context, result)); | 608 INTERFACE_ID_PPB_GRAPHICS_3D, context, result)); |
609 } | 609 } |
610 | 610 |
611 } // namespace proxy | 611 } // namespace proxy |
612 } // namespace pp | 612 } // namespace pp |
613 | 613 |
OLD | NEW |