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" |
11 #include "ppapi/proxy/ppapi_messages.h" | 11 #include "ppapi/proxy/ppapi_messages.h" |
12 #include "ppapi/thunk/enter.h" | 12 #include "ppapi/thunk/enter.h" |
13 #include "ppapi/thunk/resource_creation_api.h" | 13 #include "ppapi/thunk/resource_creation_api.h" |
14 #include "ppapi/thunk/thunk.h" | 14 #include "ppapi/thunk/thunk.h" |
15 | 15 |
16 using ppapi::HostResource; | |
17 using ppapi::Resource; | |
18 using ppapi::thunk::EnterFunctionNoLock; | 16 using ppapi::thunk::EnterFunctionNoLock; |
19 using ppapi::thunk::EnterResourceNoLock; | 17 using ppapi::thunk::EnterResourceNoLock; |
20 using ppapi::thunk::PPB_Graphics3D_API; | 18 using ppapi::thunk::PPB_Graphics3D_API; |
21 using ppapi::thunk::ResourceCreationAPI; | 19 using ppapi::thunk::ResourceCreationAPI; |
22 | 20 |
23 namespace pp { | 21 namespace ppapi { |
24 namespace proxy { | 22 namespace proxy { |
25 | 23 |
26 namespace { | 24 namespace { |
27 const int32 kCommandBufferSize = 1024 * 1024; | 25 const int32 kCommandBufferSize = 1024 * 1024; |
28 const int32 kTransferBufferSize = 1024 * 1024; | 26 const int32 kTransferBufferSize = 1024 * 1024; |
29 | 27 |
30 class CommandBuffer : public gpu::CommandBuffer { | 28 class CommandBuffer : public gpu::CommandBuffer { |
31 public: | 29 public: |
32 CommandBuffer(const HostResource& resource, PluginDispatcher* dispatcher); | 30 CommandBuffer(const HostResource& resource, PluginDispatcher* dispatcher); |
33 virtual ~CommandBuffer(); | 31 virtual ~CommandBuffer(); |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 : InterfaceProxy(dispatcher, target_interface), | 401 : InterfaceProxy(dispatcher, target_interface), |
404 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 402 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
405 } | 403 } |
406 | 404 |
407 PPB_Graphics3D_Proxy::~PPB_Graphics3D_Proxy() { | 405 PPB_Graphics3D_Proxy::~PPB_Graphics3D_Proxy() { |
408 } | 406 } |
409 | 407 |
410 // static | 408 // static |
411 const InterfaceProxy::Info* PPB_Graphics3D_Proxy::GetInfo() { | 409 const InterfaceProxy::Info* PPB_Graphics3D_Proxy::GetInfo() { |
412 static const Info info = { | 410 static const Info info = { |
413 ::ppapi::thunk::GetPPB_Graphics3D_Thunk(), | 411 thunk::GetPPB_Graphics3D_Thunk(), |
414 PPB_GRAPHICS_3D_DEV_INTERFACE, | 412 PPB_GRAPHICS_3D_DEV_INTERFACE, |
415 INTERFACE_ID_PPB_GRAPHICS_3D, | 413 INTERFACE_ID_PPB_GRAPHICS_3D, |
416 false, | 414 false, |
417 &CreateGraphics3DProxy, | 415 &CreateGraphics3DProxy, |
418 }; | 416 }; |
419 return &info; | 417 return &info; |
420 } | 418 } |
421 | 419 |
422 // static | 420 // static |
423 PP_Resource PPB_Graphics3D_Proxy::CreateProxyResource( | 421 PP_Resource PPB_Graphics3D_Proxy::CreateProxyResource( |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 } | 602 } |
605 | 603 |
606 void PPB_Graphics3D_Proxy::SendSwapBuffersACKToPlugin( | 604 void PPB_Graphics3D_Proxy::SendSwapBuffersACKToPlugin( |
607 int32_t result, | 605 int32_t result, |
608 const HostResource& context) { | 606 const HostResource& context) { |
609 dispatcher()->Send(new PpapiMsg_PPBGraphics3D_SwapBuffersACK( | 607 dispatcher()->Send(new PpapiMsg_PPBGraphics3D_SwapBuffersACK( |
610 INTERFACE_ID_PPB_GRAPHICS_3D, context, result)); | 608 INTERFACE_ID_PPB_GRAPHICS_3D, context, result)); |
611 } | 609 } |
612 | 610 |
613 } // namespace proxy | 611 } // namespace proxy |
614 } // namespace pp | 612 } // namespace ppapi |
615 | 613 |
OLD | NEW |