summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2011-09-27 16:35:57 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-09-27 16:35:57 -0700
commit92c400d6f2d86d487d5fcb038178d11e8473205f (patch)
tree0c45427a3cad09e3d6d923e747b957209c11ebb4 /src
parent412921983967b5019834c3b4f340d03b91f6dfa0 (diff)
parentd8e940a7722cb786af0f095f34618ed3b0ada281 (diff)
downloadLegacyCamera-92c400d6f2d86d487d5fcb038178d11e8473205f.zip
LegacyCamera-92c400d6f2d86d487d5fcb038178d11e8473205f.tar.gz
LegacyCamera-92c400d6f2d86d487d5fcb038178d11e8473205f.tar.bz2
am d8e940a7: Merge "Make sure correct GL context is active when tearing down effects." into ics-factoryrom
* commit 'd8e940a7722cb786af0f095f34618ed3b0ada281': Make sure correct GL context is active when tearing down effects.
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/EffectsRecorder.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/android/camera/EffectsRecorder.java b/src/com/android/camera/EffectsRecorder.java
index e5488d1..bde5bd1 100644
--- a/src/com/android/camera/EffectsRecorder.java
+++ b/src/com/android/camera/EffectsRecorder.java
@@ -19,6 +19,7 @@ package com.android.camera;
import android.content.Context;
import android.filterfw.GraphEnvironment;
import android.filterfw.core.Filter;
+import android.filterfw.core.GLEnvironment;
import android.filterfw.core.GraphRunner;
import android.filterfw.core.GraphRunner.OnRunnerDoneListener;
import android.filterpacks.videosrc.SurfaceTextureSource.SurfaceTextureSourceListener;
@@ -555,7 +556,14 @@ public class EffectsRecorder {
synchronized(EffectsRecorder.this) {
if (mOldRunner != null) {
if (mLogVerbose) Log.v(TAG, "Tearing down old graph.");
+ GLEnvironment glEnv = mGraphEnv.getContext().getGLEnvironment();
+ if (glEnv != null && !glEnv.isActive()) {
+ glEnv.activate();
+ }
mOldRunner.getGraph().tearDown(mGraphEnv.getContext());
+ if (glEnv != null && glEnv.isActive()) {
+ glEnv.deactivate();
+ }
mOldRunner = null;
}
if (mState == STATE_PREVIEW) {