LineRenderBatch class
Optimized line batch drawing by opacity for reduced GPU state changes
Instead of changing paint color for every line, this class groups lines by opacity and draws all lines with the same color together. This significantly reduces GPU state changes.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- lineCount → int
-
Get total number of lines
no setter
-
linesByOpacity
→ Map<
int, List< (Offset, Offset)> > -
Map of opacity level to list of line pairs
final
- opacityLevelCount → int
-
Get number of unique opacity levels
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addLine(
Offset p1, Offset p2, int opacity) → void - Add a line to the batch
-
clear(
) → void - Clear all batched lines
-
drawBatch(
Canvas canvas, Paint paint, Color baseColor) → void - Draw all batched lines using a single paint object
-
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