beginGroup method

  1. @override
void beginGroup(
  1. double alpha, {
  2. bool knockout = false,
})
override

Brackets a transparency-group form (§11.6.6) whose composite result paints at alpha. Inside the group, alpha starts over at 1.0; the group then blends as one object. Non-compositing devices can treat the pair as a no-op - the group's content still arrives through the normal callbacks in between.

When knockout is true the group is a knockout group (/K true, §11.4.5): each top-level element composites with the group's initial (transparent) backdrop rather than with the elements painted before it, so a later element replaces an earlier one wherever they overlap instead of blending over it.

Implementation

@override
void beginGroup(double alpha, {bool knockout = false}) {
  flushPending(); // the group's layer must not capture earlier strips
  _groupKnockout.add(knockout);
  delegateBeginGroup(alpha, knockout: knockout);
}