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

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

Issue 8678028: Ensure swap is performed before informing compositor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698