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

Side by Side Diff: ppapi/shared_impl/ppb_video_decoder_shared.cc

Issue 24466004: PPAPI: Make GLES2 calls resilient to bad/dead resources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add AssertAcquiredDebugOnly Created 7 years, 2 months 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/shared_impl/ppb_video_decoder_shared.h" 5 #include "ppapi/shared_impl/ppb_video_decoder_shared.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "gpu/command_buffer/client/gles2_implementation.h" 8 #include "gpu/command_buffer/client/gles2_implementation.h"
9 #include "ppapi/c/pp_errors.h" 9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/shared_impl/ppb_graphics_3d_shared.h" 10 #include "ppapi/shared_impl/ppb_graphics_3d_shared.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 int32 bitstream_buffer_id, int32 result) { 89 int32 bitstream_buffer_id, int32 result) {
90 CallbackById::iterator it = 90 CallbackById::iterator it =
91 bitstream_buffer_callbacks_.find(bitstream_buffer_id); 91 bitstream_buffer_callbacks_.find(bitstream_buffer_id);
92 DCHECK(it != bitstream_buffer_callbacks_.end()); 92 DCHECK(it != bitstream_buffer_callbacks_.end());
93 scoped_refptr<TrackedCallback> cc = it->second; 93 scoped_refptr<TrackedCallback> cc = it->second;
94 bitstream_buffer_callbacks_.erase(it); 94 bitstream_buffer_callbacks_.erase(it);
95 cc->Run(PP_OK); 95 cc->Run(PP_OK);
96 } 96 }
97 97
98 void PPB_VideoDecoder_Shared::FlushCommandBuffer() { 98 void PPB_VideoDecoder_Shared::FlushCommandBuffer() {
99 if (gles2_impl_) { 99 if (gles2_impl_)
100 // To call Flush() we have to tell Graphics3D that we hold the proxy lock.
101 thunk::EnterResource<thunk::PPB_Graphics3D_API, false> enter_g3d(
102 graphics_context_, false);
103 DCHECK(enter_g3d.succeeded());
104 PPB_Graphics3D_Shared* graphics3d =
105 static_cast<PPB_Graphics3D_Shared*>(enter_g3d.object());
106 PPB_Graphics3D_Shared::ScopedNoLocking dont_lock(graphics3d);
107 gles2_impl_->Flush(); 100 gles2_impl_->Flush();
108 }
109 } 101 }
110 102
111 } // namespace ppapi 103 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698