-
public class DisplayHelperDisplayHelper is here to help managing a Display, for instance being notified when its resolution or refresh rate changes.
-
-
Constructor Summary
Constructors Constructor Description DisplayHelper(Context context)Creates a DisplayHelper which helps managing a Display. DisplayHelper(Context context, Handler handler)Creates a DisplayHelper which helps manage a Display and provides a Handlerwhere callbacks can execute filament code.
-
Method Summary
Modifier and Type Method Description voidattach(@NonNull() Renderer renderer, @NonNull() Display display)Sets the filament Renderer associated to the Display, from this pointon, Renderer.DisplayInfo will be automatically updated when the Display properties change. voiddetach()Disconnect the previously set Renderer from Display This is typically called from onDetachedFromSurface. DisplaygetDisplay()Returns the Display currently monitored static Renderer.DisplayInfogetDisplayInfo(@NonNull() Display display, @Nullable() Renderer.DisplayInfo info)Populate a Renderer.DisplayInfo with properties from the given Display static longgetAppVsyncOffsetNanos(@NonNull() Display display)static longgetPresentationDeadlineNanos(@NonNull() Display display)static floatgetRefreshRate(@NonNull() Display display)static longgetRefreshPeriodNanos(@NonNull() Display display)Returns a Display's refresh period in nanoseconds -
-
Constructor Detail
-
DisplayHelper
DisplayHelper(Context context)
Creates a DisplayHelper which helps managing a Display.- Parameters:
context- a Context to used to retrieve the DisplayManager
-
DisplayHelper
DisplayHelper(Context context, Handler handler)
Creates a DisplayHelper which helps manage a Display and provides a Handlerwhere callbacks can execute filament code.- Parameters:
context- a Context to used to retrieve teh DisplayManagerhandler- a Handler used to run callbacks accessing filament
-
-
Method Detail
-
attach
void attach(@NonNull() Renderer renderer, @NonNull() Display display)
Sets the filament Renderer associated to the Display, from this pointon, Renderer.DisplayInfo will be automatically updated when the Display properties change.This is typically called from onNativeWindowChanged.
-
detach
void detach()
Disconnect the previously set Renderer from Display This is typically called from onDetachedFromSurface.
-
getDisplay
Display getDisplay()
Returns the Display currently monitored
-
getDisplayInfo
@NonNull() static Renderer.DisplayInfo getDisplayInfo(@NonNull() Display display, @Nullable() Renderer.DisplayInfo info)
Populate a Renderer.DisplayInfo with properties from the given Display
- Parameters:
display- Display to get Renderer.DisplayInfo frominfo- an instance of Renderer.DisplayInfo or null
-
getAppVsyncOffsetNanos
static long getAppVsyncOffsetNanos(@NonNull() Display display)
-
getPresentationDeadlineNanos
static long getPresentationDeadlineNanos(@NonNull() Display display)
-
getRefreshRate
static float getRefreshRate(@NonNull() Display display)
-
getRefreshPeriodNanos
static long getRefreshPeriodNanos(@NonNull() Display display)
Returns a Display's refresh period in nanoseconds
- Parameters:
display- the Display to get the refresh period from
-
-
-
-