Package limn.backend.spi
Record Class FrameInfo
java.lang.Object
java.lang.Record
limn.backend.spi.FrameInfo
- Record Components:
framebufferWidth- framebuffer width in physical pixelsframebufferHeight- framebuffer height in physical pixelscontentScale- monitor content scale (fractional values are normal)rePresent-truewhen the backend is re-drawing the same already-settled frame purely to converge the double buffers (see the loop's double-present); such frames repaint identically but must be excluded from metricsgpuFrameMs- GPU time of a recently completed frame in ms, measured by the backend's timer queries;Float.NaNwhen no new sample is available (results arrive a few frames late, and not every backend can measure)bufferAge- how many presents old the back buffer's contents are, counting re-presents: 1 when it holds the previous frame, 2 for double buffering, 3 for triple, 0 when the backend does not know (the first frames, a resize), which repaints the whole window. A backend reads it from the driver where the platform can say, because drivers change the number of buffers mid-run; partial rendering repaints what changed over that many presents, and the whole window for an age older than the eight it keeps.
public record FrameInfo(int framebufferWidth, int framebufferHeight, float contentScale, boolean rePresent, float gpuFrameMs, int bufferAge)
extends Record
Immutable per-frame metrics handed to a
FrameCallback.-
Constructor Summary
ConstructorsConstructorDescriptionFrameInfo(int framebufferWidth, int framebufferHeight, float contentScale) A normal (metric-recording) frame without a GPU-time sample.FrameInfo(int framebufferWidth, int framebufferHeight, float contentScale, boolean rePresent) Without a GPU-time sample.FrameInfo(int framebufferWidth, int framebufferHeight, float contentScale, boolean rePresent, float gpuFrameMs) Without the buffer's age: 0, the whole window, which is always safe.FrameInfo(int framebufferWidth, int framebufferHeight, float contentScale, boolean rePresent, float gpuFrameMs, int bufferAge) Creates an instance of aFrameInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thebufferAgerecord component.floatReturns the value of thecontentScalerecord component.final booleanIndicates whether some other object is "equal to" this one.intReturns the value of theframebufferHeightrecord component.intReturns the value of theframebufferWidthrecord component.floatReturns the value of thegpuFrameMsrecord component.final inthashCode()Returns a hash code value for this object.floatfloatbooleanReturns the value of therePresentrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
FrameInfo
public FrameInfo(int framebufferWidth, int framebufferHeight, float contentScale, boolean rePresent, float gpuFrameMs, int bufferAge) Creates an instance of aFrameInforecord class.- Parameters:
framebufferWidth- the value for theframebufferWidthrecord componentframebufferHeight- the value for theframebufferHeightrecord componentcontentScale- the value for thecontentScalerecord componentrePresent- the value for therePresentrecord componentgpuFrameMs- the value for thegpuFrameMsrecord componentbufferAge- the value for thebufferAgerecord component
-
FrameInfo
public FrameInfo(int framebufferWidth, int framebufferHeight, float contentScale, boolean rePresent, float gpuFrameMs) Without the buffer's age: 0, the whole window, which is always safe. -
FrameInfo
public FrameInfo(int framebufferWidth, int framebufferHeight, float contentScale, boolean rePresent) Without a GPU-time sample. -
FrameInfo
public FrameInfo(int framebufferWidth, int framebufferHeight, float contentScale) A normal (metric-recording) frame without a GPU-time sample.
-
-
Method Details
-
logicalWidth
public float logicalWidth()- Returns:
- width in logical points
-
logicalHeight
public float logicalHeight()- Returns:
- height in logical points
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
framebufferWidth
public int framebufferWidth()Returns the value of theframebufferWidthrecord component.- Returns:
- the value of the
framebufferWidthrecord component
-
framebufferHeight
public int framebufferHeight()Returns the value of theframebufferHeightrecord component.- Returns:
- the value of the
framebufferHeightrecord component
-
contentScale
public float contentScale()Returns the value of thecontentScalerecord component.- Returns:
- the value of the
contentScalerecord component
-
rePresent
public boolean rePresent()Returns the value of therePresentrecord component.- Returns:
- the value of the
rePresentrecord component
-
gpuFrameMs
public float gpuFrameMs()Returns the value of thegpuFrameMsrecord component.- Returns:
- the value of the
gpuFrameMsrecord component
-
bufferAge
public int bufferAge()Returns the value of thebufferAgerecord component.- Returns:
- the value of the
bufferAgerecord component
-