From c902ec2881db8f25be8ad211581a0b5e17100c04 Mon Sep 17 00:00:00 2001 From: "ihf@chromium.org" Date: Thu, 10 Jan 2013 05:59:42 +0000 Subject: Tell Graphics3D not to lock on Flush(). The VideoDecoder already takes the proxy lock on entry. Make sure it is not taken again when flushing Graphics3D. BUG=166951 TEST=Several Youtube videos on Lumpy. Review URL: https://codereview.chromium.org/11781004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176035 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/shared_impl/ppb_graphics_3d_shared.h | 4 ++++ ppapi/shared_impl/ppb_video_decoder_shared.cc | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'ppapi') diff --git a/ppapi/shared_impl/ppb_graphics_3d_shared.h b/ppapi/shared_impl/ppb_graphics_3d_shared.h index b6185f8..96bc6bb 100644 --- a/ppapi/shared_impl/ppb_graphics_3d_shared.h +++ b/ppapi/shared_impl/ppb_graphics_3d_shared.h @@ -99,6 +99,10 @@ class PPAPI_SHARED_EXPORT PPB_Graphics3D_Shared virtual void PushAlreadyLocked(); virtual void PopAlreadyLocked(); + // The VideoDecoder needs to be able to call Graphics3D Flush() after taking + // the proxy lock. Hence it needs access to ScopedNoLocking. + friend class PPB_VideoDecoder_Shared; + scoped_ptr gles2_helper_; scoped_ptr transfer_buffer_; scoped_ptr gles2_impl_; diff --git a/ppapi/shared_impl/ppb_video_decoder_shared.cc b/ppapi/shared_impl/ppb_video_decoder_shared.cc index e2547aa..ffd422d 100644 --- a/ppapi/shared_impl/ppb_video_decoder_shared.cc +++ b/ppapi/shared_impl/ppb_video_decoder_shared.cc @@ -7,6 +7,7 @@ #include "base/logging.h" #include "gpu/command_buffer/client/gles2_implementation.h" #include "ppapi/c/pp_errors.h" +#include "ppapi/shared_impl/ppb_graphics_3d_shared.h" #include "ppapi/shared_impl/resource_tracker.h" #include "ppapi/thunk/enter.h" @@ -90,8 +91,16 @@ void PPB_VideoDecoder_Shared::RunBitstreamBufferCallback( } void PPB_VideoDecoder_Shared::FlushCommandBuffer() { - if (gles2_impl_) + if (gles2_impl_) { + // To call Flush() we have to tell Graphics3D that we hold the proxy lock. + thunk::EnterResource enter_g3d( + graphics_context_, false); + DCHECK(enter_g3d.succeeded()); + PPB_Graphics3D_Shared* graphics3d = + static_cast(enter_g3d.object()); + PPB_Graphics3D_Shared::ScopedNoLocking dont_lock(graphics3d); gles2_impl_->Flush(); + } } } // namespace ppapi -- cgit v1.1