| 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;
|
|
|