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

Unified Diff: ui/gl/gl_image_egl.cc

Issue 66033009: [Android] Add workaround to unbind gpu memory buffer only on NVIDIA (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comma Created 7 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
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..6232e2c822c214498b4ec7944220e0fd89ae47ed 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),
+ need_unbind_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 (!need_unbind_after_use_)
+ return;
+
char zero[4] = { 0, };
glTexImage2D(GL_TEXTURE_2D,
0,
@@ -102,4 +108,8 @@ void GLImageEGL::DidUseTexImage() {
&zero);
}
+void GLImageEGL::SetReleaseAfterUse() {
+ need_unbind_after_use_ = true;
+}
+
} // namespace gfx
« ui/gl/gl_image_egl.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