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

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..91d27ec587ab03d4cb1d8cc6eacdfa8bf4459cb5 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 EGLAttrib attribs[] = {EGL_IMAGE_EXTERNAL_TARGET_NVX,
+ EGL_DECOMPRESSED_NVX, EGL_NONE};
+
+ EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
dnicoara 2016/06/29 14:21:56 I believe you should be using "GLSurfaceEGL::GetHa
vinceh 2016/06/30 09:22:48 OK, will fix.
+ if (!eglImageFlushExternalEXT(display, egl_image_, attribs)) {
piman 2016/06/29 17:34:50 What if the extension is not supported?
vinceh 2016/06/30 09:22:48 I should add check for the extension. Thanks.
+ LOG(ERROR) << "Failed to flush rendering";
+ return;
+ }
+
+ GLFence* fence = GLFence::Create();
piman 2016/06/29 17:34:50 nit: use std::unique_ptr<GLFence>
+ fence->ClientWait();
piman 2016/06/29 17:34:50 So, you're doing this on all drivers, even though
vinceh 2016/06/30 09:22:48 I should do this only when the extension is suppor
piman 2016/06/30 18:18:58 Commented there. I think this should integrate wit
+ delete fence;
+}
+
} // namespace gl

Powered by Google App Engine
This is Rietveld 408576698