diff options
author | ihf@chromium.org <ihf@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-10 05:59:42 +0000 |
---|---|---|
committer | ihf@chromium.org <ihf@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-10 05:59:42 +0000 |
commit | c902ec2881db8f25be8ad211581a0b5e17100c04 (patch) | |
tree | c9e3193bdc0a115b0ab8ebe9c3c105ffffa12939 /ppapi | |
parent | c0d1270ae8afe57e33931ba49ca25ac0a58995e5 (diff) | |
download | chromium_src-c902ec2881db8f25be8ad211581a0b5e17100c04.zip chromium_src-c902ec2881db8f25be8ad211581a0b5e17100c04.tar.gz chromium_src-c902ec2881db8f25be8ad211581a0b5e17100c04.tar.bz2 |
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
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/shared_impl/ppb_graphics_3d_shared.h | 4 | ||||
-rw-r--r-- | ppapi/shared_impl/ppb_video_decoder_shared.cc | 11 |
2 files changed, 14 insertions, 1 deletions
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<gpu::gles2::GLES2CmdHelper> gles2_helper_; scoped_ptr<gpu::TransferBuffer> transfer_buffer_; scoped_ptr<gpu::gles2::GLES2Implementation> 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<thunk::PPB_Graphics3D_API, false> enter_g3d( + graphics_context_, false); + DCHECK(enter_g3d.succeeded()); + PPB_Graphics3D_Shared* graphics3d = + static_cast<PPB_Graphics3D_Shared*>(enter_g3d.object()); + PPB_Graphics3D_Shared::ScopedNoLocking dont_lock(graphics3d); gles2_impl_->Flush(); + } } } // namespace ppapi |