Package icyllis.modernui.graphics
Class Shader
java.lang.Object
icyllis.modernui.graphics.Shader
- Direct Known Subclasses:
ComposeShader
,GradientShader
,ImageShader
Shaders specify the source color(s) for what is being drawn. If a paint
has no shader, then the paint's color is used. If the paint has a
shader, then the shader's color(s) are use instead, but they are
modulated by the paint's alpha. This makes it easy to create a shader
once (e.g. image tiling or gradient) and then change its transparency
w/o having to modify the original shader... only the paint's alpha needs
to be modified.
All subclasses are required to be reentrant-safe : it must be legal to share the same instance between several threads.
- Since:
- 3.11
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Tile modes, also known as address modes and wrap modes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
release()
Perform a deferred cleanup if the underlying resource is not released.
-
Constructor Details
-
Shader
public Shader()
-
-
Method Details
-
release
public void release()Perform a deferred cleanup if the underlying resource is not released. Manually mark the underlying resources closed, if needed. After this operation, this shader represents a no-op, and its GPU resource will be reclaimed as soon as possible after use.This will not affect shaders already installed on the Paint, until the Paint is reset or closed.
When this object becomes phantom-reachable, the system will automatically do this cleanup operation.
-