Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/graphics/ComposeShader#pubctors) \| [Inherited Methods](https://developer.android.com/reference/android/graphics/ComposeShader#inhmethods)

# ComposeShader

*** ** * ** ***

` public class ComposeShader `   
` ` ` extends https://developer.android.com/reference/android/graphics/Shader ` ` `

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [android.graphics.Shader](https://developer.android.com/reference/android/graphics/Shader) ||
|   | ↳ | android.graphics.ComposeShader |

<br />

*** ** * ** ***

A subclass of shader that returns the composition of two other shaders, combined by an `https://developer.android.com/reference/android/graphics/Xfermode` subclass.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/graphics/ComposeShader#ComposeShader(android.graphics.Shader,%20android.graphics.Shader,%20android.graphics.BlendMode)(https://developer.android.com/reference/android/graphics/Shader shaderA, https://developer.android.com/reference/android/graphics/Shader shaderB, https://developer.android.com/reference/android/graphics/BlendMode blendMode) ` Create a new compose shader, given shaders A, B, and a combining PorterDuff mode. |
| ` https://developer.android.com/reference/android/graphics/ComposeShader#ComposeShader(android.graphics.Shader,%20android.graphics.Shader,%20android.graphics.PorterDuff.Mode)(https://developer.android.com/reference/android/graphics/Shader shaderA, https://developer.android.com/reference/android/graphics/Shader shaderB, https://developer.android.com/reference/android/graphics/PorterDuff.Mode mode) ` Create a new compose shader, given shaders A, B, and a combining PorterDuff mode. |
| ` https://developer.android.com/reference/android/graphics/ComposeShader#ComposeShader(android.graphics.Shader,%20android.graphics.Shader,%20android.graphics.Xfermode)(https://developer.android.com/reference/android/graphics/Shader shaderA, https://developer.android.com/reference/android/graphics/Shader shaderB, https://developer.android.com/reference/android/graphics/Xfermode mode) ` Create a new compose shader, given shaders A, B, and a combining mode. |

### Inherited methods

From class ` https://developer.android.com/reference/android/graphics/Shader ` ` boolean` ` https://developer.android.com/reference/android/graphics/Shader#getLocalMatrix(android.graphics.Matrix)(https://developer.android.com/reference/android/graphics/Matrix localM) `

Return true if the shader has a non-identity local matrix.
` void` ` https://developer.android.com/reference/android/graphics/Shader#setLocalMatrix(android.graphics.Matrix)(https://developer.android.com/reference/android/graphics/Matrix localM) `

Set the shader's local matrix.
From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/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 https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/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` ` https://developer.android.com/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` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public constructors

### ComposeShader

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ComposeShader (Shader shaderA, 
                Shader shaderB, 
                BlendMode blendMode)
```

Create a new compose shader, given shaders A, B, and a combining PorterDuff mode. When the mode is applied, it will be given the result from shader A as its "dst", and the result from shader B as its "src".

<br />

| Parameters ||
|---|---|
| `shaderA` | `Shader`: The colors from this shader are seen as the "dst" by the mode. This value cannot be `null`. <br /> |
| `shaderB` | `Shader`: The colors from this shader are seen as the "src" by the mode. This value cannot be `null`. <br /> |
| `blendMode` | `BlendMode`: The blend mode that combines the colors from the two shaders. This value cannot be `null`. <br /> |

### ComposeShader

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ComposeShader (Shader shaderA, 
                Shader shaderB, 
                PorterDuff.Mode mode)
```

Create a new compose shader, given shaders A, B, and a combining PorterDuff mode. When the mode is applied, it will be given the result from shader A as its "dst", and the result from shader B as its "src".

<br />

| Parameters ||
|---|---|
| `shaderA` | `Shader`: The colors from this shader are seen as the "dst" by the mode. This value cannot be `null`. <br /> |
| `shaderB` | `Shader`: The colors from this shader are seen as the "src" by the mode. This value cannot be `null`. <br /> |
| `mode` | `PorterDuff.Mode`: The PorterDuff mode that combines the colors from the two shaders. This value cannot be `null`. <br /> |

### ComposeShader

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ComposeShader (Shader shaderA, 
                Shader shaderB, 
                Xfermode mode)
```

Create a new compose shader, given shaders A, B, and a combining mode. When the mode is applied, it will be given the result from shader A as its "dst", and the result from shader B as its "src".

<br />

| Parameters ||
|---|---|
| `shaderA` | `Shader`: The colors from this shader are seen as the "dst" by the mode. This value cannot be `null`. <br /> |
| `shaderB` | `Shader`: The colors from this shader are seen as the "src" by the mode. This value cannot be `null`. <br /> |
| `mode` | `Xfermode`: The mode that combines the colors from the two shaders. If mode is null, then SRC_OVER is assumed. <br /> |