Index: content/common/gpu/media/android_deferred_rendering_backing_strategy.h |
diff --git a/content/common/gpu/media/android_deferred_rendering_backing_strategy.h b/content/common/gpu/media/android_deferred_rendering_backing_strategy.h |
index 830eca307dbc8c2011e4fb88d4c5d721a337a3d0..1b40e985f9e287ed63adff91555c239160da9016 100644 |
--- a/content/common/gpu/media/android_deferred_rendering_backing_strategy.h |
+++ b/content/common/gpu/media/android_deferred_rendering_backing_strategy.h |
@@ -10,6 +10,7 @@ |
#include "base/macros.h" |
#include "content/common/content_export.h" |
#include "content/common/gpu/media/android_video_decode_accelerator.h" |
+#include "ui/gl/gl_bindings.h" |
namespace gl { |
class GLImage; |
@@ -46,7 +47,7 @@ class CONTENT_EXPORT AndroidDeferredRenderingBackingStrategy |
uint32_t GetTextureTarget() const override; |
void UseCodecBufferForPictureBuffer(int32_t codec_buffer_index, |
const media::PictureBuffer&) override; |
- void AssignOnePictureBuffer(const media::PictureBuffer&) override; |
+ void AssignOnePictureBuffer(const media::PictureBuffer&, bool) override; |
void ReuseOnePictureBuffer(const media::PictureBuffer&) override; |
void DismissOnePictureBuffer(const media::PictureBuffer&) override; |
void CodecChanged( |
@@ -79,10 +80,26 @@ class CONTENT_EXPORT AndroidDeferredRenderingBackingStrategy |
// not set. |
bool DoesSurfaceTextureDetachWork() const; |
+ // Create an EGLImage by creating a 2D texture, calling |init_texture| while |
+ // it's bound, and then creating the EGLImage from that. The caller takes |
+ // ownership of the resulting EGLImage. |
+ EGLImageKHR CreateImageFromTexture(bool ( |
DaleCurtis
2016/03/11 19:23:36
Use callback instead?
liberato (no reviews please)
2016/03/11 19:53:57
since the strategy isn't refcounted, didn't seem t
|
+ AndroidDeferredRenderingBackingStrategy::*init_texture)(GLint source_id)); |
+ |
+ // Init |source_id| to be a copy of the current |surface_texture_| buffer. |
+ // |source_id| is the service id of the 2D texture. |
+ bool InitTextureWithCopy(GLint source_id); |
+ |
+ // Init |source_id| to be a 1x1 transparent texture. |
+ bool InitTransparentTexture(GLint source_id); |
+ |
scoped_refptr<AVDASharedState> shared_state_; |
AVDAStateProvider* state_provider_; |
+ // EGLImage for a 1x1 transparent texture, or EGL_NO_IMAGE_KHR. |
+ EGLImageKHR transparent_image_; |
+ |
// The SurfaceTexture to render to. Non-null after Initialize() if |
// we're not rendering to a SurfaceView. |
scoped_refptr<gfx::SurfaceTexture> surface_texture_; |