Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Unified Diff: ui/gl/gl_image_ozone_native_pixmap.cc

Issue 2109803003: Add support for EXT_image_flush_external extension (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add support for EXT_image_flush_external extension Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698