Chromium Code Reviews| Index: media/gpu/avda_codec_image.cc | 
| diff --git a/media/gpu/avda_codec_image.cc b/media/gpu/avda_codec_image.cc | 
| index 3a28736e2423d09d703c77ddad3cf08d22ef9fa5..fb19d6190db8b330fc13e374b397181cee1c2be1 100644 | 
| --- a/media/gpu/avda_codec_image.cc | 
| +++ b/media/gpu/avda_codec_image.cc | 
| @@ -19,7 +19,6 @@ | 
| namespace media { | 
| AVDACodecImage::AVDACodecImage( | 
| - int picture_buffer_id, | 
| const scoped_refptr<AVDASharedState>& shared_state, | 
| VideoCodecBridge* codec, | 
| const base::WeakPtr<gpu::gles2::GLES2Decoder>& decoder) | 
| @@ -27,15 +26,10 @@ AVDACodecImage::AVDACodecImage( | 
| codec_buffer_index_(kInvalidCodecBufferIndex), | 
| media_codec_(codec), | 
| decoder_(decoder), | 
| - has_surface_texture_(!!shared_state_->surface_texture_service_id()), | 
| - texture_(0), | 
| - picture_buffer_id_(picture_buffer_id) { | 
| - shared_state_->SetImageForPicture(picture_buffer_id_, this); | 
| -} | 
| + has_surface_texture_(false), | 
| + texture_(0) {} | 
| -AVDACodecImage::~AVDACodecImage() { | 
| - shared_state_->SetImageForPicture(picture_buffer_id_, nullptr); | 
| -} | 
| +AVDACodecImage::~AVDACodecImage() {} | 
| gfx::Size AVDACodecImage::GetSize() { | 
| return size_; | 
| @@ -58,13 +52,13 @@ bool AVDACodecImage::CopyTexImage(unsigned target) { | 
| if (target != GL_TEXTURE_EXTERNAL_OES) | 
| return false; | 
| - GLint bound_service_id = 0; | 
| - glGetIntegerv(GL_TEXTURE_BINDING_EXTERNAL_OES, &bound_service_id); | 
| - // We insist that the currently bound texture is the right one. | 
| - if (bound_service_id != | 
| - static_cast<GLint>(shared_state_->surface_texture_service_id())) { | 
| - return false; | 
| - } | 
| + // GLint bound_service_id = 0; | 
| 
 
liberato (no reviews please)
2016/11/03 20:51:04
now that we're swapping out |shared_state_| when s
 
DaleCurtis
2016/11/04 01:07:22
Just left over testing. Removed.
 
 | 
| + // glGetIntegerv(GL_TEXTURE_BINDING_EXTERNAL_OES, &bound_service_id); | 
| + // // We insist that the currently bound texture is the right one. | 
| + // if (bound_service_id != | 
| + // static_cast<GLint>(shared_state_->surface_texture_service_id())) { | 
| + // return false; | 
| + // } | 
| // Make sure that we have the right image in the front buffer. Note that the | 
| // bound_service_id is guaranteed to be equal to the surface texture's client | 
| @@ -141,6 +135,22 @@ void AVDACodecImage::CodecChanged(MediaCodecBridge* codec) { | 
| codec_buffer_index_ = kInvalidCodecBufferIndex; | 
| } | 
| +void AVDACodecImage::SetBufferMetadata(int buffer_index, | 
| + bool has_surface_texture, | 
| + const gfx::Size size) { | 
| + has_surface_texture_ = has_surface_texture; | 
| + codec_buffer_index_ = buffer_index; | 
| + size_ = size; | 
| +} | 
| + | 
| +bool AVDACodecImage::SetSharedState( | 
| + const scoped_refptr<AVDASharedState>& shared_state) { | 
| + if (shared_state == shared_state_) | 
| + return false; | 
| + shared_state_ = shared_state; | 
| + return true; | 
| +} | 
| + | 
| void AVDACodecImage::UpdateSurfaceInternal( | 
| UpdateMode update_mode, | 
| RestoreBindingsMode attached_bindings_mode) { |