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 dd2fb3e1a4bbd9dc6f8f7fdf9d0b78af3e6bd1cb..b610dbeb1b3b7a826d5eb599b30f20fb5ce1239c 100644 |
--- a/ui/gl/gl_image_ozone_native_pixmap.cc |
+++ b/ui/gl/gl_image_ozone_native_pixmap.cc |
@@ -3,6 +3,7 @@ |
// found in the LICENSE file. |
#include "ui/gfx/buffer_format_util.h" |
+#include "ui/gl/gl_fence.h" |
#include "ui/gl/gl_image_ozone_native_pixmap.h" |
#define FOURCC(a, b, c, d) \ |
@@ -242,4 +243,19 @@ unsigned GLImageOzoneNativePixmap::GetInternalFormatForTesting( |
return GL_NONE; |
} |
+void GLImageOzoneNativePixmap::Flush() { |
+ const EGLint attribs[] = {EGL_IMAGE_EXTERNAL_TARGET_NVX, EGL_DECOMPRESSED_NVX, |
+ EGL_NONE}; |
+ |
+ EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); |
+ if (!eglImageFlushExternalEXT(display, egl_image_, attribs)) { |
+ LOG(ERROR) << "Failed to flush rendering"; |
+ return; |
+ } |
+ |
+ GLFence* fence = GLFence::Create(); |
+ fence->ClientWait(); |
+ delete fence; |
+} |
+ |
} // namespace gl |