Package limn.backend

Record Class FrameInfo

java.lang.Object
java.lang.Record
limn.backend.FrameInfo
Record Components:
framebufferWidth - framebuffer width in physical pixels
framebufferHeight - framebuffer height in physical pixels
contentScale - monitor content scale (fractional values are normal)
rePresent - true when 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 metrics
gpuFrameMs - GPU time of a recently completed frame in ms, measured by the backend's timer queries; Float.NaN when 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

    Constructors
    Constructor
    Description
    FrameInfo(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 a FrameInfo record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    Returns the value of the contentScale record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns the value of the framebufferHeight record component.
    int
    Returns the value of the framebufferWidth record component.
    float
    Returns the value of the gpuFrameMs record component.
    final int
    Returns a hash code value for this object.
    float
     
    float
     
    boolean
    Returns the value of the rePresent record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • FrameInfo

      public FrameInfo(int framebufferWidth, int framebufferHeight, float contentScale, boolean rePresent, float gpuFrameMs)
      Creates an instance of a FrameInfo record class.
      Parameters:
      framebufferWidth - the value for the framebufferWidth record component
      framebufferHeight - the value for the framebufferHeight record component
      contentScale - the value for the contentScale record component
      rePresent - the value for the rePresent record component
      gpuFrameMs - the value for the gpuFrameMs record 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

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • framebufferWidth

      public int framebufferWidth()
      Returns the value of the framebufferWidth record component.
      Returns:
      the value of the framebufferWidth record component
    • framebufferHeight

      public int framebufferHeight()
      Returns the value of the framebufferHeight record component.
      Returns:
      the value of the framebufferHeight record component
    • contentScale

      public float contentScale()
      Returns the value of the contentScale record component.
      Returns:
      the value of the contentScale record component
    • rePresent

      public boolean rePresent()
      Returns the value of the rePresent record component.
      Returns:
      the value of the rePresent record component
    • gpuFrameMs

      public float gpuFrameMs()
      Returns the value of the gpuFrameMs record component.
      Returns:
      the value of the gpuFrameMs record component