summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorMichael Lentine <mlentine@google.com>2014-10-21 18:35:24 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-10-21 18:35:24 +0000
commit15b2ecf599414c86cb198f3ffc126b50f88b5aa0 (patch)
tree8efed65460b5531802cfd7330f285b57948a7b22 /libs
parent8b81ce563f03500064e0f4c87288b8eeb3bed496 (diff)
parentdcc959beb77099d319a94e3985da2f4ea4064e7b (diff)
downloadframeworks_native-15b2ecf599414c86cb198f3ffc126b50f88b5aa0.zip
frameworks_native-15b2ecf599414c86cb198f3ffc126b50f88b5aa0.tar.gz
frameworks_native-15b2ecf599414c86cb198f3ffc126b50f88b5aa0.tar.bz2
am dcc959be: Merge "Adding eglInitialize and eglTerminate image creation and deletion." into lmp-mr1-dev
* commit 'dcc959beb77099d319a94e3985da2f4ea4064e7b': Adding eglInitialize and eglTerminate image creation and deletion.
Diffstat (limited to 'libs')
-rw-r--r--libs/gui/GLConsumer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/gui/GLConsumer.cpp b/libs/gui/GLConsumer.cpp
index 6ba2ef8..1046935 100644
--- a/libs/gui/GLConsumer.cpp
+++ b/libs/gui/GLConsumer.cpp
@@ -1065,6 +1065,7 @@ GLConsumer::EglImage::~EglImage() {
if (!eglDestroyImageKHR(mEglDisplay, mEglImage)) {
ALOGE("~EglImage: eglDestroyImageKHR failed");
}
+ eglTerminate(mEglDisplay);
}
}
@@ -1079,6 +1080,7 @@ status_t GLConsumer::EglImage::createIfNeeded(EGLDisplay eglDisplay,
if (!eglDestroyImageKHR(mEglDisplay, mEglImage)) {
ALOGE("createIfNeeded: eglDestroyImageKHR failed");
}
+ eglTerminate(mEglDisplay);
mEglImage = EGL_NO_IMAGE_KHR;
mEglDisplay = EGL_NO_DISPLAY;
}
@@ -1129,11 +1131,13 @@ EGLImageKHR GLConsumer::EglImage::createImage(EGLDisplay dpy,
// removes this restriction if there is hardware that can support it.
attrs[2] = EGL_NONE;
}
+ eglInitialize(dpy, 0, 0);
EGLImageKHR image = eglCreateImageKHR(dpy, EGL_NO_CONTEXT,
EGL_NATIVE_BUFFER_ANDROID, cbuf, attrs);
if (image == EGL_NO_IMAGE_KHR) {
EGLint error = eglGetError();
ALOGE("error creating EGLImage: %#x", error);
+ eglTerminate(dpy);
}
return image;
}