Package limn.backend
Record Class FrameInfo
java.lang.Object
java.lang.Record
limn.backend.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)
public record FrameInfo(int framebufferWidth, int framebufferHeight, float contentScale, boolean rePresent, float gpuFrameMs)
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) Creates an instance of aFrameInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatReturns 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) 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 component
-
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
-