PassViewport class final
Where the rasteriser maps clip space: a rectangle of the target in pixels,
which may be fractional, and the window depth range clip depth maps onto —
PassEncoder.setViewport.
A rectangle in doubles and a depth range, the two things every native
viewport has that a ScreenRect cannot say. Clip depth from the device's
GraphicsDevice.depthRange maps linearly onto minDepth..maxDepth,
both in [0, 1]; the defaults are the whole range, which is what every
pass had before. A rectangle that is not whole pixels needs
DeviceFeature.fractionalViewport (checkFeatures); the depth range
needs nothing.
- Annotations
Constructors
- PassViewport({double x = 0, double y = 0, required double width, required double height, double minDepth = 0, double maxDepth = 1})
-
The viewport
widthbyheightpixels from (x,y), mapping depth ontominDepth..maxDepth.const - PassViewport.of(TextureHandle texture)
-
The viewport over the whole of
texture, with the whole depth range.factory - PassViewport.ofRect(ScreenRect rect)
-
The viewport over exactly the pixels of
rect, with the whole depth range — what a pass that sets its viewport and its scissor to the same rectangle says for the first.factory
Properties
- coversFullDepth → bool
-
Whether the depth range is the whole of
[0, 1].no setter - hashCode → int
-
The hash code for this object.
no setteroverride
- height → double
-
How high, in pixels.
final
- isWholePixels → bool
-
Whether the rectangle lies on whole pixels — what a backend whose API
takes integers can set exactly.
no setter
- maxDepth → double
-
The window depth the far end of clip depth maps to: a depth from 0 to
1, unitless.
final
- minDepth → double
-
The window depth the near end of clip depth maps to: a depth from 0 to
1, unitless.
final
- rect → ScreenRect
-
The rectangle rounded to whole pixels — for a backend whose API takes
integers, once checkFeatures has let it through.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- width → double
-
How wide, in pixels.
final
- x → double
-
The left edge, in pixels from the target's left.
final
- y → double
-
The top edge, in pixels from row zero (see
FramebufferOrigin).final
Methods
-
checkFeatures(
DeviceFeatures features, {required String backend}) → void -
Throws UnsupportedCapabilityException when this viewport needs a
feature
featureslacks: a rectangle that is not whole pixels (fractionalViewport). -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override