public class

Shader

extends Object
java.lang.Object
   ↳ android.graphics.Shader
Known Direct Subclasses

Class Overview

Shader is the based class for objects that return horizontal spans of colors during drawing. A subclass of Shader is installed in a Paint calling paint.setShader(shader). After that any object (other than a bitmap) that is drawn with that paint will get its color(s) from the shader.

Summary

Nested Classes
enum Shader.TileMode  
Public Constructors
Shader()
Public Methods
boolean getLocalMatrix(Matrix localM)
Return true if the shader has a non-identity local matrix.
void setLocalMatrix(Matrix localM)
Set the shader's local matrix.
Protected Methods
void finalize()
Called before the object's memory is reclaimed by the VM.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Shader ()

Since: API Level 1

Public Methods

public boolean getLocalMatrix (Matrix localM)

Since: API Level 1

Return true if the shader has a non-identity local matrix.

Parameters
localM If not null, it is set to the shader's local matrix.
Returns
  • true if the shader has a non-identity local matrix

public void setLocalMatrix (Matrix localM)

Since: API Level 1

Set the shader's local matrix. Passing null will reset the shader's matrix to identity

Parameters
localM The shader's new local matrix, or null to specify identity

Protected Methods

protected void finalize ()

Since: API Level 1

Called before the object's memory is reclaimed by the VM. This can only happen once the garbage collector has detected that the object is no longer reachable by any thread of the running application.

The method can be used to free system resources or perform other cleanup before the object is garbage collected. The default implementation of the method is empty, which is also expected by the VM, but subclasses can override finalize() as required. Uncaught exceptions which are thrown during the execution of this method cause it to terminate immediately but are otherwise ignored.

Note that the VM does guarantee that finalize() is called at most once for any object, but it doesn't guarantee when (if at all) finalize() will be called. For example, object B's finalize() can delay the execution of object A's finalize() method and therefore it can delay the reclamation of A's memory. To be safe, use a ReferenceQueue, because it provides more control over the way the VM deals with references during garbage collection.

Throws
Throwable