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

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, 5 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
« no previous file with comments | « ui/gl/gl_image_ozone_native_pixmap.h ('k') | ui/gl/gl_image_stub.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « ui/gl/gl_image_ozone_native_pixmap.h ('k') | ui/gl/gl_image_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698