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

Unified Diff: ui/gl/gl_image_egl.cc

Issue 2388653002: gpu: Add CHROMIUM_texture_from_image spec and fence support.
Patch Set: rebase Created 4 years, 2 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_egl.cc
diff --git a/ui/gl/gl_image_egl.cc b/ui/gl/gl_image_egl.cc
index a13214db06d597f7a9375c09d971c95d72ad734d..fe452c73eb3b9a4e86aec47f47171f5e54dda81c 100644
--- a/ui/gl/gl_image_egl.cc
+++ b/ui/gl/gl_image_egl.cc
@@ -5,6 +5,7 @@
#include "ui/gl/gl_image_egl.h"
#include "ui/gl/egl_util.h"
+#include "ui/gl/gl_fence.h"
#include "ui/gl/gl_surface_egl.h"
namespace gl {
@@ -51,11 +52,17 @@ gfx::Size GLImageEGL::GetSize() {
unsigned GLImageEGL::GetInternalFormat() { return GL_RGBA; }
-bool GLImageEGL::BindTexImage(unsigned target) {
+bool GLImageEGL::BindTexImage(unsigned target, GLFence* fence) {
DCHECK(thread_checker_.CalledOnValidThread());
if (egl_image_ == EGL_NO_IMAGE_KHR)
return false;
+ // Prevent image from being used before |fence| has signaled.
+ // Note: Fence implementations are allowed to use a client side wait
+ // when server side wait is not supported.
+ if (fence)
+ fence->ServerWait();
+
glEGLImageTargetTexture2DOES(target, egl_image_);
DCHECK_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError());
return true;
« ui/gl/gl_image.h ('K') | « ui/gl/gl_image_egl.h ('k') | ui/gl/gl_image_glx.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698