summaryrefslogtreecommitdiff
path: root/chromium/media/gpu/android/codec_image.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-01-29 16:35:13 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-02-01 15:33:35 +0000
commitc8c2d1901aec01e934adf561a9fdf0cc776cdef8 (patch)
tree9157c3d9815e5870799e070b113813bec53e0535 /chromium/media/gpu/android/codec_image.h
parentabefd5095b41dac94ca451d784ab6e27372e981a (diff)
downloadqtwebengine-chromium-c8c2d1901aec01e934adf561a9fdf0cc776cdef8.tar.gz
BASELINE: Update Chromium to 64.0.3282.139
Change-Id: I1cae68fe9c94ff7608b26b8382fc19862cdb293a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/media/gpu/android/codec_image.h')
-rw-r--r--chromium/media/gpu/android/codec_image.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/chromium/media/gpu/android/codec_image.h b/chromium/media/gpu/android/codec_image.h
index 3b9b7afb01e..d2dfde625a7 100644
--- a/chromium/media/gpu/android/codec_image.h
+++ b/chromium/media/gpu/android/codec_image.h
@@ -23,13 +23,15 @@ namespace media {
// as needed in order to draw them.
class MEDIA_GPU_EXPORT CodecImage : public gpu::gles2::GLStreamTextureImage {
public:
- // A callback for observing CodecImage destruction.
- using DestructionCb = base::Callback<void(CodecImage*)>;
+ // A callback for observing CodecImage destruction. This is a repeating cb
+ // since CodecImageGroup calls the same cb for multiple images.
+ using DestructionCb = base::RepeatingCallback<void(CodecImage*)>;
CodecImage(std::unique_ptr<CodecOutputBuffer> output_buffer,
scoped_refptr<SurfaceTextureGLOwner> surface_texture,
- PromotionHintAggregator::NotifyPromotionHintCB promotion_hint_cb,
- DestructionCb destruction_cb);
+ PromotionHintAggregator::NotifyPromotionHintCB promotion_hint_cb);
+
+ void SetDestructionCb(DestructionCb destruction_cb);
// gl::GLImage implementation
gfx::Size GetSize() override;
@@ -45,12 +47,18 @@ class MEDIA_GPU_EXPORT CodecImage : public gpu::gles2::GLStreamTextureImage {
gfx::OverlayTransform transform,
const gfx::Rect& bounds_rect,
const gfx::RectF& crop_rect) override;
+ void SetColorSpace(const gfx::ColorSpace& color_space) override {}
void Flush() override {}
void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
uint64_t process_tracing_id,
const std::string& dump_name) override;
// gpu::gles2::GLStreamTextureMatrix implementation
void GetTextureMatrix(float xform[16]) override;
+ void NotifyPromotionHint(bool promotion_hint,
+ int display_x,
+ int display_y,
+ int display_width,
+ int display_height) override;
// Whether the codec buffer has been rendered to the front buffer.
bool was_rendered_to_front_buffer() const {
@@ -75,14 +83,19 @@ class MEDIA_GPU_EXPORT CodecImage : public gpu::gles2::GLStreamTextureImage {
// buffer. Returns false if the buffer was invalidated.
bool RenderToSurfaceTextureBackBuffer();
+ // Called when we're no longer renderable because our surface is gone. We'll
+ // discard any codec buffer, and generally do nothing.
+ virtual void SurfaceDestroyed();
+
+ protected:
+ ~CodecImage() override;
+
private:
// The lifecycle phases of an image.
// The only possible transitions are from left to right. Both
// kInFrontBuffer and kInvalidated are terminal.
enum class Phase { kInCodec, kInBackBuffer, kInFrontBuffer, kInvalidated };
- ~CodecImage() override;
-
// Renders this image to the surface texture front buffer by first rendering
// it to the back buffer if it's not already there, and then waiting for the
// frame available event before calling UpdateTexImage(). Passing