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_context_3d_proxy.h" | 5 #include "ppapi/proxy/ppb_context_3d_proxy.h" |
6 | 6 |
7 #include "base/hash_tables.h" | 7 #include "base/hash_tables.h" |
8 #include "gpu/command_buffer/client/gles2_cmd_helper.h" | 8 #include "gpu/command_buffer/client/gles2_cmd_helper.h" |
9 #include "gpu/command_buffer/client/gles2_implementation.h" | 9 #include "gpu/command_buffer/client/gles2_implementation.h" |
10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 } else { | 571 } else { |
572 attribs.push_back(0); | 572 attribs.push_back(0); |
573 } | 573 } |
574 | 574 |
575 HostResource result; | 575 HostResource result; |
576 dispatcher->Send(new PpapiHostMsg_PPBContext3D_Create( | 576 dispatcher->Send(new PpapiHostMsg_PPBContext3D_Create( |
577 INTERFACE_ID_PPB_CONTEXT_3D, instance, config, attribs, &result)); | 577 INTERFACE_ID_PPB_CONTEXT_3D, instance, config, attribs, &result)); |
578 | 578 |
579 if (result.is_null()) | 579 if (result.is_null()) |
580 return 0; | 580 return 0; |
581 linked_ptr<Context3D> context_3d(new Context3D(result)); | 581 scoped_refptr<Context3D> context_3d(new Context3D(result)); |
582 if (!context_3d->CreateImplementation()) | 582 if (!context_3d->CreateImplementation()) |
583 return 0; | 583 return 0; |
584 return PluginResourceTracker::GetInstance()->AddResource(context_3d); | 584 return PluginResourceTracker::GetInstance()->AddResource(context_3d); |
585 } | 585 } |
586 | 586 |
587 bool PPB_Context3D_Proxy::OnMessageReceived(const IPC::Message& msg) { | 587 bool PPB_Context3D_Proxy::OnMessageReceived(const IPC::Message& msg) { |
588 bool handled = true; | 588 bool handled = true; |
589 IPC_BEGIN_MESSAGE_MAP(PPB_Context3D_Proxy, msg) | 589 IPC_BEGIN_MESSAGE_MAP(PPB_Context3D_Proxy, msg) |
590 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBContext3D_Create, | 590 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBContext3D_Create, |
591 OnMsgCreate) | 591 OnMsgCreate) |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 uint32_t shm_size = 0; | 719 uint32_t shm_size = 0; |
720 if (enter.succeeded() && | 720 if (enter.succeeded() && |
721 enter.object()->GetTransferBuffer(id, &shm_handle, &shm_size)) { | 721 enter.object()->GetTransferBuffer(id, &shm_handle, &shm_size)) { |
722 *transfer_buffer = TransportSHMHandleFromInt(dispatcher(), shm_handle); | 722 *transfer_buffer = TransportSHMHandleFromInt(dispatcher(), shm_handle); |
723 *size = shm_size; | 723 *size = shm_size; |
724 } | 724 } |
725 } | 725 } |
726 | 726 |
727 } // namespace proxy | 727 } // namespace proxy |
728 } // namespace pp | 728 } // namespace pp |
OLD | NEW |