setBlendMode method

void setBlendMode(
  1. BlendMode mode
)

Sets the blend mode for subsequent drawing operations.

If the new mode is different from the current blend mode, this method will flush any pending draw calls before applying the new mode.

Implementation

void setBlendMode(BlendMode mode) {
  if (_renderState.blendMode != mode) {
    flush();
    _renderState
      ..blendMode = mode
      ..blendMode.apply(gl);
  }
}