BlendFactor enum

One term of a blend equation.

The last four read a blend constant, and PassEncoder.setBlendColor is how it is set. blendColor, oneMinusBlendColor, blendAlpha and oneMinusBlendAlpha all multiply by that colour, which is transparent black until a pass says otherwise.

They used to be the one dead corner of these enums — no setter anywhere, and three backends disagreeing about what that meant: the software rasteriser threw, WebGL2 mapped them to CONSTANT_COLOR against a constant nobody had set, and Impeller handed them to flutter_gpu whose default is the same transparent black. Two of the three drew a plausible picture with a term missing from it, which is the failure this enum's own doc comment was written to warn about and could not prevent.

A backend may still not have the constant, and one here does not. Ask GraphicsDevice.supportsBlendColor before naming any of these four: flutter_gpu exposes no blend-constant setter at all, so the Impeller backend answers false and refuses a BlendState naming one rather than drawing the term as zero. That refusal is the promise the false answer carries, and the conformance check a blend constant reaches the blend, or is refused holds both halves of it.

Inheritance
Available extensions

Values

zero → const BlendFactor
one → const BlendFactor
sourceColor → const BlendFactor
oneMinusSourceColor → const BlendFactor
sourceAlpha → const BlendFactor
oneMinusSourceAlpha → const BlendFactor
destinationColor → const BlendFactor
oneMinusDestinationColor → const BlendFactor
destinationAlpha → const BlendFactor
oneMinusDestinationAlpha → const BlendFactor
sourceAlphaSaturated → const BlendFactor
blendColor → const BlendFactor
oneMinusBlendColor → const BlendFactor
blendAlpha → const BlendFactor
oneMinusBlendAlpha → const BlendFactor

Properties

hashCode → int
The hash code for this object.
no setterinherited
index → int
A numeric identifier for the enumerated value.
no setterinherited
name → String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

values → const List<BlendFactor>
A constant List of the values in this enum, in order of their declaration.