| 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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 PP_Graphics3DTrustedState Graphics3D::FlushSyncFast(int32_t put_offset, | 375 PP_Graphics3DTrustedState Graphics3D::FlushSyncFast(int32_t put_offset, |
| 376 int32_t last_known_get) { | 376 int32_t last_known_get) { |
| 377 return GetErrorState(); | 377 return GetErrorState(); |
| 378 } | 378 } |
| 379 | 379 |
| 380 gpu::CommandBuffer* Graphics3D::GetCommandBuffer() { | 380 gpu::CommandBuffer* Graphics3D::GetCommandBuffer() { |
| 381 return command_buffer_.get(); | 381 return command_buffer_.get(); |
| 382 } | 382 } |
| 383 | 383 |
| 384 int32 Graphics3D::DoSwapBuffers() { | 384 int32 Graphics3D::DoSwapBuffers() { |
| 385 gles2_impl()->SwapBuffers(); |
| 385 IPC::Message* msg = new PpapiHostMsg_PPBGraphics3D_SwapBuffers( | 386 IPC::Message* msg = new PpapiHostMsg_PPBGraphics3D_SwapBuffers( |
| 386 API_ID_PPB_GRAPHICS_3D, host_resource()); | 387 API_ID_PPB_GRAPHICS_3D, host_resource()); |
| 387 msg->set_unblock(true); | 388 msg->set_unblock(true); |
| 388 PluginDispatcher::GetForResource(this)->Send(msg); | 389 PluginDispatcher::GetForResource(this)->Send(msg); |
| 389 | 390 |
| 390 gles2_impl()->SwapBuffers(); | |
| 391 return PP_OK_COMPLETIONPENDING; | 391 return PP_OK_COMPLETIONPENDING; |
| 392 } | 392 } |
| 393 | 393 |
| 394 PPB_Graphics3D_Proxy::PPB_Graphics3D_Proxy(Dispatcher* dispatcher) | 394 PPB_Graphics3D_Proxy::PPB_Graphics3D_Proxy(Dispatcher* dispatcher) |
| 395 : InterfaceProxy(dispatcher), | 395 : InterfaceProxy(dispatcher), |
| 396 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 396 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
| 397 } | 397 } |
| 398 | 398 |
| 399 PPB_Graphics3D_Proxy::~PPB_Graphics3D_Proxy() { | 399 PPB_Graphics3D_Proxy::~PPB_Graphics3D_Proxy() { |
| 400 } | 400 } |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 void PPB_Graphics3D_Proxy::SendSwapBuffersACKToPlugin( | 583 void PPB_Graphics3D_Proxy::SendSwapBuffersACKToPlugin( |
| 584 int32_t result, | 584 int32_t result, |
| 585 const HostResource& context) { | 585 const HostResource& context) { |
| 586 dispatcher()->Send(new PpapiMsg_PPBGraphics3D_SwapBuffersACK( | 586 dispatcher()->Send(new PpapiMsg_PPBGraphics3D_SwapBuffersACK( |
| 587 API_ID_PPB_GRAPHICS_3D, context, result)); | 587 API_ID_PPB_GRAPHICS_3D, context, result)); |
| 588 } | 588 } |
| 589 | 589 |
| 590 } // namespace proxy | 590 } // namespace proxy |
| 591 } // namespace ppapi | 591 } // namespace ppapi |
| 592 | 592 |
| OLD | NEW |