diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2011-09-27 15:44:29 -0700 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2011-09-27 16:03:49 -0700 |
commit | a91df49eb460aec8bcae4169e7d29ddc7f9ac3ec (patch) | |
tree | bb8c0ebac20c41fbb193e75e6dd510471290da72 /src/com | |
parent | f1244801b6b24053b8a81f353229d63d6d801763 (diff) | |
download | LegacyCamera-a91df49eb460aec8bcae4169e7d29ddc7f9ac3ec.zip LegacyCamera-a91df49eb460aec8bcae4169e7d29ddc7f9ac3ec.tar.gz LegacyCamera-a91df49eb460aec8bcae4169e7d29ddc7f9ac3ec.tar.bz2 |
Make sure correct GL context is active when tearing down effects.
Previously, filter graph teardown occured in the wrong GL context,
resulting in UI corruption and likely the failure to properly release
filter resources.
Bug: 5353684
Change-Id: I023c23ce7cb590bc8af5cd9b039d901a290eebc5
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/camera/EffectsRecorder.java | 8 |
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) { |