File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
media/mca/filterfw/java/android/filterfw/core Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ public class GLEnvironment {
3131
3232 private int glEnvId ;
3333
34+ private boolean mManageContext = true ;
35+
3436 public GLEnvironment () {
3537 nativeAllocate ();
3638 }
@@ -51,12 +53,14 @@ protected void finalize() throws Throwable {
5153 }
5254
5355 public void initWithNewContext () {
56+ mManageContext = true ;
5457 if (!nativeInitWithNewContext ()) {
5558 throw new RuntimeException ("Could not initialize GLEnvironment with new context!" );
5659 }
5760 }
5861
5962 public void initWithCurrentContext () {
63+ mManageContext = false ;
6064 if (!nativeInitWithCurrentContext ()) {
6165 throw new RuntimeException ("Could not initialize GLEnvironment with current context!" );
6266 }
@@ -78,13 +82,13 @@ public void activate() {
7882 if (Looper .myLooper () != null && Looper .myLooper ().equals (Looper .getMainLooper ())) {
7983 Log .e ("FilterFramework" , "Activating GL context in UI thread!" );
8084 }
81- if (!nativeActivate ()) {
85+ if (mManageContext && !nativeActivate ()) {
8286 throw new RuntimeException ("Could not activate GLEnvironment!" );
8387 }
8488 }
8589
8690 public void deactivate () {
87- if (!nativeDeactivate ()) {
91+ if (mManageContext && !nativeDeactivate ()) {
8892 throw new RuntimeException ("Could not deactivate GLEnvironment!" );
8993 }
9094 }
You can’t perform that action at this time.
0 commit comments