setViewport method

  1. @override
void setViewport(
  1. ScreenRect rect
)

Straight through: WebGPU states a viewport from the top left in pixels, which is where this contract states every rectangle. It is the place the WebGL2 backend has to turn a rectangle over, and there is nothing to do here at all.

Implementation

@override
void setViewport(ScreenRect rect) => _pass.setViewport(
  rect.x.toDouble(),
  rect.y.toDouble(),
  rect.width.toDouble(),
  rect.height.toDouble(),
  0.0,
  1.0,
);