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

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
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..2e9322704475d7f2cbcf1a05d38dc89a3118c100 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"
#include "ui/gl/gl_surface_egl.h"
@@ -204,6 +205,7 @@ bool GLImageOzoneNativePixmap::ScheduleOverlayPlane(
const gfx::Rect& bounds_rect,
const gfx::RectF& crop_rect) {
DCHECK(pixmap_);
+
reveman 2016/07/11 18:59:06 nit: no need to add this blank line
return pixmap_->ScheduleOverlayPlane(widget, z_order, transform, bounds_rect,
crop_rect);
}
@@ -247,4 +249,19 @@ unsigned GLImageOzoneNativePixmap::GetInternalFormatForTesting(
return GL_NONE;
}
+void GLImageOzoneNativePixmap::Flush() {
reveman 2016/07/11 18:59:06 nit: move below ScheduleOverlayPlane
+ if (GLSurfaceEGL::HasEGLExtension("EGL_EXT_image_flush_external")) {
piman 2016/07/11 16:06:26 nit: parsing strings on every frame seems a bit un
+ EGLDisplay display = GLSurfaceEGL::GetHardwareDisplay();
+ const EGLAttrib attribs[] = {
+ EGL_NONE,
+ };
+ if (!eglImageFlushExternalEXT(display, egl_image_, attribs)) {
+ LOG(ERROR) << "Failed to flush rendering";
+ return;
+ }
+ }
+
+ return;
reveman 2016/07/11 18:59:06 nit: remove unnecessary return statement
+}
+
} // namespace gl

Powered by Google App Engine
This is Rietveld 408576698