Chromium Code Reviews| Index: ui/gl/gl_image_io_surface.h |
| diff --git a/ui/gl/gl_image_io_surface.h b/ui/gl/gl_image_io_surface.h |
| index d8b731828f26d674176401f38b89489857fed367..84d23f28caeba1637b24fab3b57435b48edd33c3 100644 |
| --- a/ui/gl/gl_image_io_surface.h |
| +++ b/ui/gl/gl_image_io_surface.h |
| @@ -6,6 +6,7 @@ |
| #define UI_GL_GL_IMAGE_IO_SURFACE_H_ |
| #include <IOSurface/IOSurface.h> |
| +#include <CoreVideo/CVPixelBuffer.h> |
|
Avi (use Gerrit)
2016/04/06 16:49:52
Alphabetical?
ccameron
2016/04/06 17:49:00
Oops -- done.
|
| #include <stdint.h> |
| #include "base/mac/scoped_cftyperef.h" |
| @@ -31,6 +32,14 @@ class GL_EXPORT GLImageIOSurface : public GLImage { |
| gfx::GenericSharedMemoryId io_surface_id, |
| gfx::BufferFormat format); |
| + // IOSurfaces coming from video decode are wrapped in a CVPixelBuffer |
| + // and may be discarded if the owning CVPixelBuffer is destroyed. This |
| + // initialization will ensure that the CVPixelBuffer be retained for the |
| + // lifetime of the GLImage. |
| + bool InitializeWithCVPixelBuffer(CVPixelBufferRef cv_pixel_buffer, |
| + gfx::GenericSharedMemoryId io_surface_id, |
| + gfx::BufferFormat format); |
| + |
| // Overridden from GLImage: |
| void Destroy(bool have_context) override; |
| gfx::Size GetSize() override; |
| @@ -52,6 +61,7 @@ class GL_EXPORT GLImageIOSurface : public GLImage { |
| gfx::GenericSharedMemoryId io_surface_id() const { return io_surface_id_; } |
| base::ScopedCFTypeRef<IOSurfaceRef> io_surface(); |
| + base::ScopedCFTypeRef<CVPixelBufferRef> cv_pixel_buffer(); |
| static void SetLayerForWidget(gfx::AcceleratedWidget widget, CALayer* layer); |
| @@ -65,6 +75,7 @@ class GL_EXPORT GLImageIOSurface : public GLImage { |
| const unsigned internalformat_; |
| gfx::BufferFormat format_; |
| base::ScopedCFTypeRef<IOSurfaceRef> io_surface_; |
| + base::ScopedCFTypeRef<CVPixelBufferRef> cv_pixel_buffer_; |
| gfx::GenericSharedMemoryId io_surface_id_; |
| base::ThreadChecker thread_checker_; |