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

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, 1 month 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_egl.h ('k') | ui/gl/gl_image_glx.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_image_egl.cc
diff --git a/ui/gl/gl_image_egl.cc b/ui/gl/gl_image_egl.cc
index 181999997ea4cdfd484704ad7b6e0caf27ecd131..0d1d1e1ab67687640bfe7049b5ae873efce47770 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 {
@@ -45,11 +46,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;
« no previous file with comments | « 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