docs/android/dokka/filament-android/com.google.android.filament/-renderer/index.md
//filament-android/com.google.android.filament/Renderer
open class Renderer
A Renderer instance represents an operating system's window.
Typically, applications create a Renderer per window. The Renderer generates drawing commands for the render thread and manages frame latency. A Renderer generates drawing commands from a View, itself containing a Scene description.
A Renderer is created using createRenderer and destroyed using destroyRenderer.
| Engine |
| View |
| Name | Summary |
|---|---|
| ClearOptions | [main] |
| open class ClearOptions | |
| ClearOptions are used at the beginning of a frame to clear or retain the SwapChain content. | |
| DisplayInfo | [main] |
| open class DisplayInfo | |
| Information about the display this renderer is associated to | |
| FrameInfo | [main] |
| open class FrameInfo | |
| Timing information about a frame. | |
| FrameRateOptions | [main] |
| open class FrameRateOptions | |
| Use FrameRateOptions to set the desired frame rate and control how quickly the system reacts to GPU load changes. |
| Name | Summary |
|---|---|
| MIRROR_FRAME_FLAG_CLEAR | [main] |
| val MIRROR_FRAME_FLAG_CLEAR: Int = 4 | |
Indicates that the dstSwapChain passed into copyFrame should be cleared to black before the frame is copied into the specified viewport. | |
| MIRROR_FRAME_FLAG_COMMIT | [main] |
| val MIRROR_FRAME_FLAG_COMMIT: Int = 1 | |
Indicates that the dstSwapChain passed into copyFrame should be committed after the frame has been copied. | |
| MIRROR_FRAME_FLAG_SET_PRESENTATION_TIME | [main] |
| val MIRROR_FRAME_FLAG_SET_PRESENTATION_TIME: Int = 2 | |
Indicates that the presentation time should be set on the dstSwapChain passed into copyFrame to the monotonic clock time when the frame is copied. |
| Name | Summary |
|---|---|
| beginFrame | [main] |
| open fun beginFrame(swapChain: SwapChain, frameTimeNanos: Long): Boolean | |
Sets up a frame for this Renderer. | |
| copyFrame | [main] |
| open fun copyFrame(dstSwapChain: SwapChain, dstViewport: Viewport, srcViewport: Viewport, flags: Int) | |
| Copies the currently rendered View to the indicated SwapChain, using the indicated source and destination rectangle. | |
| endFrame | [main] |
| open fun endFrame() | |
| Finishes the current frame and schedules it for display. | |
| getClearOptions | [main] |
| open fun getClearOptions(): Renderer.ClearOptions | |
| Returns the ClearOptions object set in setClearOptions or a new instance otherwise. | |
| getDisplayInfo | [main] |
| open fun getDisplayInfo(): Renderer.DisplayInfo | |
| Returns the DisplayInfo object set in setDisplayInfo or a new instance otherwise. | |
| getEngine | [main] |
| open fun getEngine(): Engine | |
Gets the Engine that created this Renderer. | |
| getFrameInfoHistory | [main] |
| open fun getFrameInfoHistory(outHistory: Array<Renderer.FrameInfo>): Int | |
| Retrieve a history of frame timing information. | |
| getFrameRateOptions | [main] |
| open fun getFrameRateOptions(): Renderer.FrameRateOptions | |
| Returns the FrameRateOptions object set in setFrameRateOptions or a new instance otherwise. | |
| getFrameToSkipCount | [main] |
| open fun getFrameToSkipCount(): Int | |
| Remainder count of frame to be skipped | |
| getMaterialTime | [main] |
| open fun getMaterialTime(): Double | |
| Returns a timestamp (in seconds) for the last call to beginFrame. | |
| getMaxFrameHistorySize | [main] |
| open fun getMaxFrameHistorySize(): Int | |
| getNativeObject | [main] |
| open fun getNativeObject(): Long | |
| getUserTime | [main] |
| open fun | |
| Backward compatibility helper for getUserTime(). | |
| hasGpuFallenBehind | [main] |
| open fun hasGpuFallenBehind(): Boolean | |
| Queries whether the GPU execution has fallen behind the CPU rendering execution. | |
| mirrorFrame | [main] |
| open fun | |
| pauseRenderThread | [main] |
| open fun pauseRenderThread(durationNanos: Long) | |
| Stalls the render thread (GPU submission pipeline) for the given duration in nanoseconds. | |
| readPixels | [main] |
| open fun readPixels(xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor) | |
Reads back the content of the SwapChain associated with this Renderer. | |
| [main] | |
| open fun readPixels(renderTarget: RenderTarget, xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor) | |
| Reads back the content of a specified RenderTarget. | |
| render | [main] |
| open fun render(view: View) | |
Renders a View into this Renderer's window. | |
| renderStandaloneView | [main] |
| open fun renderStandaloneView(view: View) | |
Renders a standalone View into its associated RenderTarget. | |
| resetUserTime | [main] |
| open fun | |
| Backward compatibility helper for resetUserTime(). | |
| setClearOptions | [main] |
| open fun setClearOptions(options: Renderer.ClearOptions) | |
| Set ClearOptions which are used at the beginning of a frame to clear or retain the SwapChain content. | |
| setDesiredPresentationTime | [main] |
| open fun setDesiredPresentationTime(monotonicClockNanos: Long) | |
| Set the real desired presentation time targeted for this frame. | |
| setDisplayInfo | [main] |
| open fun setDisplayInfo(info: Renderer.DisplayInfo) | |
| Information about the display this Renderer is associated to. | |
| setFrameRateOptions | [main] |
| open fun setFrameRateOptions(options: Renderer.FrameRateOptions) | |
| Set options controlling the desired frame-rate. | |
| setFrameScheduleTime | [main] |
| open fun setFrameScheduleTime(timeSteadyClockNano: Long) | |
| Sets the physical clock time when the frame scheduling callback was entered. | |
| setMaterialTimeEpoch | [main] |
| open fun setMaterialTimeEpoch(monotonicClockNanos: Long) | |
| Sets the material time epoch to the specified steady clock timestamp in nanoseconds, i.e. | |
| setPresentationTime | [main] |
| open fun setPresentationTime(monotonicClockNanos: Long) | |
| Set the time at which the frame must be presented to the display hardware. | |
| setRenderingDeadline | [main] |
| open fun setRenderingDeadline(monotonicClockNanos: Long) | |
| Set the deadline timestamp on the steady clock by which CPU and GPU rendering must complete for the buffer to meet its target display latching window. | |
| setVsyncTime | [main] |
| open fun setVsyncTime(steadyClockTimeNano: Long) | |
| The use of this method is optional. | |
| shouldRenderFrame | [main] |
| open fun shouldRenderFrame(): Boolean | |
| Returns true if the current frame should be rendered. | |
| skipFrame | [main] |
| open fun skipFrame(vsyncSteadyClockTimeNano: Long) | |
| Call skipFrame when momentarily skipping frames, for instance if the content of the scene doesn't change. | |
| skipNextFrames | [main] |
| open fun skipNextFrames(frameCount: Int) | |
| Requests the next frameCount frames to be skipped. |