diff options
author | Ruei-sung Lin <rslin@google.com> | 2012-04-30 17:16:44 -0700 |
---|---|---|
committer | Ruei-sung Lin <rslin@google.com> | 2012-04-30 17:16:44 -0700 |
commit | 22edf6b2e4e75195b83ae1c4da61e3bf623802b0 (patch) | |
tree | 9cc3f039bd16a76b5f3c9cf0bdcc5d44ef5f4408 /media/mca | |
parent | bfb27bbefb013220af699881d486cc04be5ec1f5 (diff) | |
download | frameworks_base-22edf6b2e4e75195b83ae1c4da61e3bf623802b0.zip frameworks_base-22edf6b2e4e75195b83ae1c4da61e3bf623802b0.tar.gz frameworks_base-22edf6b2e4e75195b83ae1c4da61e3bf623802b0.tar.bz2 |
Fix b/5821633: Could not activate GLEnvironment
Change-Id: I35a05eb24299b85a869b973599a091381369aac2
Diffstat (limited to 'media/mca')
-rw-r--r-- | media/mca/filterfw/java/android/filterfw/core/GLEnvironment.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/media/mca/filterfw/java/android/filterfw/core/GLEnvironment.java b/media/mca/filterfw/java/android/filterfw/core/GLEnvironment.java index fcf5f5d..19d564c 100644 --- a/media/mca/filterfw/java/android/filterfw/core/GLEnvironment.java +++ b/media/mca/filterfw/java/android/filterfw/core/GLEnvironment.java @@ -31,6 +31,8 @@ public class GLEnvironment { private int glEnvId; + private boolean mManageContext = true; + public GLEnvironment() { nativeAllocate(); } @@ -51,12 +53,14 @@ public class GLEnvironment { } public void initWithNewContext() { + mManageContext = true; if (!nativeInitWithNewContext()) { throw new RuntimeException("Could not initialize GLEnvironment with new context!"); } } public void initWithCurrentContext() { + mManageContext = false; if (!nativeInitWithCurrentContext()) { throw new RuntimeException("Could not initialize GLEnvironment with current context!"); } @@ -78,13 +82,13 @@ public class GLEnvironment { if (Looper.myLooper() != null && Looper.myLooper().equals(Looper.getMainLooper())) { Log.e("FilterFramework", "Activating GL context in UI thread!"); } - if (!nativeActivate()) { + if (mManageContext && !nativeActivate()) { throw new RuntimeException("Could not activate GLEnvironment!"); } } public void deactivate() { - if (!nativeDeactivate()) { + if (mManageContext && !nativeDeactivate()) { throw new RuntimeException("Could not deactivate GLEnvironment!"); } } |