| Index: ui/gl/gl_image_egl.cc
|
| diff --git a/ui/gl/gl_image_egl.cc b/ui/gl/gl_image_egl.cc
|
| index aeafc9a8b17f0983eb76f632edba6c7d34a18c2d..283b4c76da581d9b8cbf4066307131ff0293d540 100644
|
| --- a/ui/gl/gl_image_egl.cc
|
| +++ b/ui/gl/gl_image_egl.cc
|
| @@ -12,6 +12,7 @@ namespace gfx {
|
| GLImageEGL::GLImageEGL(gfx::Size size)
|
| : egl_image_(EGL_NO_IMAGE_KHR),
|
| size_(size),
|
| + release_after_use_(false),
|
| in_use_(false) {
|
| }
|
|
|
| @@ -76,7 +77,8 @@ bool GLImageEGL::BindTexImage() {
|
| }
|
|
|
| void GLImageEGL::ReleaseTexImage() {
|
| - // Nothing to do here as image is released after each use.
|
| + // Nothing to do here as image is released after each use or there is no need
|
| + // to release image.
|
| }
|
|
|
| void GLImageEGL::WillUseTexImage() {
|
| @@ -90,6 +92,10 @@ void GLImageEGL::WillUseTexImage() {
|
| void GLImageEGL::DidUseTexImage() {
|
| DCHECK(in_use_);
|
| in_use_ = false;
|
| +
|
| + if (!release_after_use_)
|
| + return;
|
| +
|
| char zero[4] = { 0, };
|
| glTexImage2D(GL_TEXTURE_2D,
|
| 0,
|
| @@ -102,4 +108,8 @@ void GLImageEGL::DidUseTexImage() {
|
| &zero);
|
| }
|
|
|
| +void GLImageEGL::SetReleaseAfterUse() {
|
| + release_after_use_ = true;
|
| +}
|
| +
|
| } // namespace gfx
|
|
|