Chromium Code Reviews| Index: ui/gl/gl_image_ozone_native_pixmap.cc |
| diff --git a/ui/gl/gl_image_ozone_native_pixmap.cc b/ui/gl/gl_image_ozone_native_pixmap.cc |
| index 0475abf9c6af5bd6278824a1dc5cb18848b238f2..7403e92bb617f21c872b155564224920393f1f0a 100644 |
| --- a/ui/gl/gl_image_ozone_native_pixmap.cc |
| +++ b/ui/gl/gl_image_ozone_native_pixmap.cc |
| @@ -101,7 +101,10 @@ EGLint FourCC(gfx::BufferFormat format) { |
| GLImageOzoneNativePixmap::GLImageOzoneNativePixmap(const gfx::Size& size, |
| unsigned internalformat) |
| - : GLImageEGL(size), internalformat_(internalformat) {} |
| + : GLImageEGL(size), |
| + internalformat_(internalformat), |
| + has_image_flush_external_( |
| + GLSurfaceEGL::HasEGLExtension("EGL_EXT_image_flush_external")) {} |
| GLImageOzoneNativePixmap::~GLImageOzoneNativePixmap() { |
| } |
| @@ -208,6 +211,19 @@ bool GLImageOzoneNativePixmap::ScheduleOverlayPlane( |
| crop_rect); |
| } |
| +void GLImageOzoneNativePixmap::Flush() { |
| + if (has_image_flush_external_) { |
|
liberato (no reviews please)
2016/07/14 14:38:35
random nit: can early out and avoid the indent.
|
| + EGLDisplay display = GLSurfaceEGL::GetHardwareDisplay(); |
| + const EGLAttrib attribs[] = { |
| + EGL_NONE, |
| + }; |
| + if (!eglImageFlushExternalEXT(display, egl_image_, attribs)) { |
| + LOG(ERROR) << "Failed to flush rendering"; |
| + return; |
| + } |
| + } |
| +} |
| + |
| void GLImageOzoneNativePixmap::OnMemoryDump( |
| base::trace_event::ProcessMemoryDump* pmd, |
| uint64_t process_tracing_id, |