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..8c61710f1c26e116c730ce6826c80aef68aabab2 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,20 @@ bool GLImageOzoneNativePixmap::ScheduleOverlayPlane( |
crop_rect); |
} |
+void GLImageOzoneNativePixmap::Flush() { |
+ if (!has_image_flush_external_) |
+ return; |
+ |
+ 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, |