Chromium Code Reviews| Index: content/common/gpu/media/android_deferred_rendering_backing_strategy.cc |
| diff --git a/content/common/gpu/media/android_deferred_rendering_backing_strategy.cc b/content/common/gpu/media/android_deferred_rendering_backing_strategy.cc |
| index c1e0d2e437f818fd0838d054bdac50a7ee183ff9..2b619cec5ebfa49db802691d44dabcb888b587a9 100644 |
| --- a/content/common/gpu/media/android_deferred_rendering_backing_strategy.cc |
| +++ b/content/common/gpu/media/android_deferred_rendering_backing_strategy.cc |
| @@ -103,23 +103,10 @@ uint32_t AndroidDeferredRenderingBackingStrategy::GetTextureTarget() const { |
| return GL_TEXTURE_EXTERNAL_OES; |
| } |
| -gpu::gles2::TextureRef* |
| -AndroidDeferredRenderingBackingStrategy::GetTextureForPicture( |
| - const media::PictureBuffer& picture_buffer) { |
| - RETURN_NULL_IF_NULL(state_provider_->GetGlDecoder()); |
| - gpu::gles2::TextureManager* texture_manager = |
| - state_provider_->GetGlDecoder()->GetContextGroup()->texture_manager(); |
| - RETURN_NULL_IF_NULL(texture_manager); |
| - gpu::gles2::TextureRef* texture_ref = |
| - texture_manager->GetTexture(picture_buffer.internal_texture_id()); |
| - RETURN_NULL_IF_NULL(texture_ref); |
| - |
| - return texture_ref; |
| -} |
| - |
| AVDACodecImage* AndroidDeferredRenderingBackingStrategy::GetImageForPicture( |
| const media::PictureBuffer& picture_buffer) { |
| - gpu::gles2::TextureRef* texture_ref = GetTextureForPicture(picture_buffer); |
| + gpu::gles2::TextureRef* texture_ref = |
| + state_provider_->GetTextureForPicture(picture_buffer); |
| RETURN_NULL_IF_NULL(texture_ref); |
| gl::GLImage* image = |
| texture_ref->texture()->GetLevelImage(GetTextureTarget(), 0); |
| @@ -129,7 +116,8 @@ AVDACodecImage* AndroidDeferredRenderingBackingStrategy::GetImageForPicture( |
| void AndroidDeferredRenderingBackingStrategy::SetImageForPicture( |
| const media::PictureBuffer& picture_buffer, |
| const scoped_refptr<gpu::gles2::GLStreamTextureImage>& image) { |
| - gpu::gles2::TextureRef* texture_ref = GetTextureForPicture(picture_buffer); |
| + gpu::gles2::TextureRef* texture_ref = |
| + state_provider_->GetTextureForPicture(picture_buffer); |
| RETURN_IF_NULL(texture_ref); |
| gpu::gles2::TextureManager* texture_manager = |
| @@ -257,6 +245,14 @@ bool AndroidDeferredRenderingBackingStrategy::ArePicturesOverlayable() { |
| return !surface_texture_; |
| } |
| +void AndroidDeferredRenderingBackingStrategy::UpdatePictureBufferSize( |
| + media::PictureBuffer* picture_buffer, |
| + const gfx::Size& new_size) { |
| + // This strategy uses OES textures which do not have a notion of size. We |
|
liberato (no reviews please)
2016/03/07 16:39:17
s/OES/external . OES is just a prefix that descri
chcunningham
2016/03/08 03:19:36
Done.
|
| + // simply update the PictureBuffer meta-data and leave the texture as-is. |
| + picture_buffer->set_size(new_size); |
| +} |
| + |
| void AndroidDeferredRenderingBackingStrategy::CopySurfaceTextureToPictures( |
| const AndroidVideoDecodeAccelerator::OutputBufferMap& buffers) { |
| DVLOG(3) << __FUNCTION__; |
| @@ -314,7 +310,8 @@ void AndroidDeferredRenderingBackingStrategy::CopySurfaceTextureToPictures( |
| } |
| for (const std::pair<int, media::PictureBuffer>& entry : buffers) { |
| - gpu::gles2::TextureRef* texture_ref = GetTextureForPicture(entry.second); |
| + gpu::gles2::TextureRef* texture_ref = |
| + state_provider_->GetTextureForPicture(entry.second); |
| gfx::ScopedTextureBinder texture_binder( |
| GL_TEXTURE_EXTERNAL_OES, texture_ref->texture()->service_id()); |
| glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, egl_image); |