Stay organized with collections
Save and categorize content based on your preferences.
EffectContext
public
class
EffectContext
extends Object
An EffectContext keeps all necessary state information to run Effects within a Open GL ES 2.0
context.
Every EffectContext is bound to one GL context. The application is responsible for creating
this EGL context, and making it current before applying any effect. If your EGL context is
destroyed, the EffectContext becomes invalid and any effects bound to this context can no longer
be used. If you switch to another EGL context, you must create a new EffectContext. Each Effect
is bound to a single EffectContext, and can only be executed in that context.
Summary
Inherited methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long timeoutMillis, int nanos)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait(long timeoutMillis)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted.
|
|
Public methods
createWithCurrentGlContext
public static EffectContext createWithCurrentGlContext ()
Creates a context within the current GL context.
Binds the EffectContext to the current OpenGL context. All subsequent calls to the
EffectContext must be made in the GL context that was active during creation.
When you have finished using a context, you must call release()
. to dispose of all
resources associated with this context.
getFactory
public EffectFactory getFactory ()
Returns the EffectFactory for this context.
The EffectFactory returned from this method allows instantiating new effects within this
context.
Returns |
EffectFactory |
The EffectFactory instance for this context. |
release
public void release ()
Releases the context.
Releases all the resources and effects associated with the EffectContext. This renders the
context and all the effects bound to this context invalid. You must no longer use the context
or any of its bound effects after calling release().
Note that this method must be called with the proper EGL context made current, as the
EffectContext and its effects may release internal GL resources.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# EffectContext\n\nAdded in [API level 14](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nEffectContext\n=============\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/media/effect/EffectContext \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\n\n\nclass\nEffectContext\n`\n\n\n`\n\nextends `[Object](/reference/java/lang/Object)`\n\n\n`\n\n`\n\n\n`\n\n|---|------------------------------------|\n| [java.lang.Object](/reference/java/lang/Object) ||\n| ↳ | android.media.effect.EffectContext |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n\u003cbr /\u003e\n\nAn EffectContext keeps all necessary state information to run Effects within a Open GL ES 2.0\ncontext.\n\nEvery EffectContext is bound to one GL context. The application is responsible for creating\nthis EGL context, and making it current before applying any effect. If your EGL context is\ndestroyed, the EffectContext becomes invalid and any effects bound to this context can no longer\nbe used. If you switch to another EGL context, you must create a new EffectContext. Each Effect\nis bound to a single EffectContext, and can only be executed in that context.\n\n\u003cbr /\u003e\n\nSummary\n-------\n\n| ### Public methods ||\n|--------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` static `[EffectContext](/reference/android/media/effect/EffectContext) | ` `[createWithCurrentGlContext](/reference/android/media/effect/EffectContext#createWithCurrentGlContext())`() ` Creates a context within the current GL context. |\n| ` `[EffectFactory](/reference/android/media/effect/EffectFactory) | ` `[getFactory](/reference/android/media/effect/EffectContext#getFactory())`() ` Returns the EffectFactory for this context. |\n| ` void` | ` `[release](/reference/android/media/effect/EffectContext#release())`() ` Releases the context. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` `[java.lang.Object](/reference/java/lang/Object)` ` |---------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](/reference/java/lang/Object) | ` `[clone](/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object. | | ` boolean` | ` `[equals](/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](/reference/java/lang/Object)` obj) ` Indicates whether some other object is \"equal to\" this one. | | ` void` | ` `[finalize](/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final `[Class](/reference/java/lang/Class)`\u003c?\u003e` | ` `[getClass](/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this `Object`. | | ` int` | ` `[hashCode](/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object. | | ` final void` | ` `[notify](/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` `[notifyAll](/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor. | | ` `[String](/reference/java/lang/String) | ` `[toString](/reference/java/lang/Object#toString())`() ` Returns a string representation of the object. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||\n\nPublic methods\n--------------\n\n### createWithCurrentGlContext\n\nAdded in [API level 14](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static EffectContext createWithCurrentGlContext ()\n```\n\nCreates a context within the current GL context.\n\nBinds the EffectContext to the current OpenGL context. All subsequent calls to the\nEffectContext must be made in the GL context that was active during creation.\nWhen you have finished using a context, you must call [release()](/reference/android/media/effect/EffectContext#release()). to dispose of all\nresources associated with this context.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|----------------------------------------------------------------|--------|\n| [EffectContext](/reference/android/media/effect/EffectContext) | \u003cbr /\u003e |\n\n### getFactory\n\nAdded in [API level 14](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic EffectFactory getFactory ()\n```\n\nReturns the EffectFactory for this context.\n\nThe EffectFactory returned from this method allows instantiating new effects within this\ncontext.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|----------------------------------------------------------------|-----------------------------------------------------|\n| [EffectFactory](/reference/android/media/effect/EffectFactory) | The EffectFactory instance for this context. \u003cbr /\u003e |\n\n### release\n\nAdded in [API level 14](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic void release ()\n```\n\nReleases the context.\n\nReleases all the resources and effects associated with the EffectContext. This renders the\ncontext and all the effects bound to this context invalid. You must no longer use the context\nor any of its bound effects after calling release().\n\nNote that this method must be called with the proper EGL context made current, as the\nEffectContext and its effects may release internal GL resources.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e"]]