OpBuilder

class OpBuilder

Perform a series of path operations, optimized for unioning many paths together.

Methods

__init__

__init__(self: skia.OpBuilder) -> None

add

Add one or more paths and their operand.

resolve

Computes the sum of all paths and operands, and resets the builder to its initial state.

Methods

OpBuilder.__init__(self: skia.OpBuilder) None

__init__(self: skia.OpBuilder) -> None

OpBuilder.add(self: skia.OpBuilder, path: skia.Path, op: skia.PathOp) None

Add one or more paths and their operand.

The builder is empty before the first path is added, so the result of a single add is (emptyPath OP path).

Parameters
  • path – The second operand.

  • op – The operator to apply to the existing and supplied paths.

OpBuilder.resolve(self: skia.OpBuilder) skia.Path

Computes the sum of all paths and operands, and resets the builder to its initial state.

Parameters

result – The product of the operands.

Returns

True if the operation succeeded.