OLD | NEW |
---|---|
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/resource_tracker.h" | 11 #include "ppapi/shared_impl/resource_tracker.h" |
11 #include "ppapi/thunk/enter.h" | 12 #include "ppapi/thunk/enter.h" |
12 | 13 |
13 namespace ppapi { | 14 namespace ppapi { |
14 | 15 |
15 PPB_VideoDecoder_Shared::PPB_VideoDecoder_Shared(PP_Instance instance) | 16 PPB_VideoDecoder_Shared::PPB_VideoDecoder_Shared(PP_Instance instance) |
16 : Resource(OBJECT_IS_IMPL, instance), | 17 : Resource(OBJECT_IS_IMPL, instance), |
17 graphics_context_(0), | 18 graphics_context_(0), |
18 gles2_impl_(NULL) { | 19 gles2_impl_(NULL) { |
19 } | 20 } |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
83 int32 bitstream_buffer_id, int32 result) { | 84 int32 bitstream_buffer_id, int32 result) { |
84 CallbackById::iterator it = | 85 CallbackById::iterator it = |
85 bitstream_buffer_callbacks_.find(bitstream_buffer_id); | 86 bitstream_buffer_callbacks_.find(bitstream_buffer_id); |
86 DCHECK(it != bitstream_buffer_callbacks_.end()); | 87 DCHECK(it != bitstream_buffer_callbacks_.end()); |
87 scoped_refptr<TrackedCallback> cc = it->second; | 88 scoped_refptr<TrackedCallback> cc = it->second; |
88 bitstream_buffer_callbacks_.erase(it); | 89 bitstream_buffer_callbacks_.erase(it); |
89 cc->Run(PP_OK); | 90 cc->Run(PP_OK); |
90 } | 91 } |
91 | 92 |
92 void PPB_VideoDecoder_Shared::FlushCommandBuffer() { | 93 void PPB_VideoDecoder_Shared::FlushCommandBuffer() { |
93 if (gles2_impl_) | 94 if (gles2_impl_) { |
Scott Hess - ex-Googler
2013/01/07 22:41:02
This looks broadly like what I expected it to look
| |
95 // To call Flush() we have to tell Graphics3D that we hold the proxy lock. | |
96 thunk::EnterResource<thunk::PPB_Graphics3D_API, false> enter_g3d( | |
97 graphics_context_, false); | |
98 DCHECK(enter_g3d.succeeded()); | |
99 PPB_Graphics3D_Shared* graphics3d = | |
100 static_cast<PPB_Graphics3D_Shared*>(enter_g3d.object()); | |
101 PPB_Graphics3D_Shared::ScopedNoLocking dont_lock(graphics3d); | |
94 gles2_impl_->Flush(); | 102 gles2_impl_->Flush(); |
103 } | |
95 } | 104 } |
96 | 105 |
97 } // namespace ppapi | 106 } // namespace ppapi |
OLD | NEW |