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