Freigeben über


HardwareRenderer Class

Definition

Creates an instance of a hardware-accelerated renderer.

[Android.Runtime.Register("android/graphics/HardwareRenderer", ApiSince=29, DoNotGenerateAcw=true)]
public class HardwareRenderer : Java.Lang.Object
[<Android.Runtime.Register("android/graphics/HardwareRenderer", ApiSince=29, DoNotGenerateAcw=true)>]
type HardwareRenderer = class
    inherit Object
Inheritance
HardwareRenderer
Attributes

Remarks

Creates an instance of a hardware-accelerated renderer. This is used to render a scene built from RenderNode's to an output android.view.Surface. There can be as many HardwareRenderer instances as desired.

<h3>Resources & lifecycle</h3>

All HardwareRenderer instances share a common render thread. The render thread contains the GPU context & resources necessary to do GPU-accelerated rendering. As such, the first HardwareRenderer created comes with the cost of also creating the associated GPU contexts, however each incremental HardwareRenderer thereafter is fairly cheap. The expected usage is to have a HardwareRenderer instance for every active Surface. For example when an Activity shows a Dialog the system internally will use 2 hardware renderers, both of which may be drawing at the same time.

NOTE: Due to the shared, cooperative nature of the render thread it is critical that any Surface used must have a prompt, reliable consuming side. System-provided consumers such as android.view.SurfaceView, android.view.Window#takeSurface(SurfaceHolder.Callback2), or android.view.TextureView all fit this requirement. However if custom consumers are used such as when using SurfaceTexture or android.media.ImageReader it is the app's responsibility to ensure that they consume updates promptly and rapidly. Failure to do so will cause the render thread to stall on that surface, blocking all HardwareRenderer instances.

Java documentation for android.graphics.HardwareRenderer.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

HardwareRenderer()

Creates a new instance of a HardwareRenderer.

HardwareRenderer(IntPtr, JniHandleOwnership)

Fields

SyncContextIsStopped
Obsolete.

The hardware renderer has been set to a "stopped" state.

SyncFrameDropped
Obsolete.

The content was synced but the renderer has declined to produce a frame in this vsync interval.

SyncLostSurfaceRewardIfFound
Obsolete.

The hardware renderer no longer has a valid android.view.Surface to render to.

SyncOk
Obsolete.

Nothing interesting to report.

SyncRedrawRequested
Obsolete.

The renderer is requesting a redraw.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
DrawingEnabled

Returns true if HardwareRender will produce output. -or- Toggles whether or not HardwareRenderer will produce drawing output globally in the current process.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
Opaque

Whether or not the renderer is set to be opaque. -or- Change the HardwareRenderer's opacity.

PeerReference (Inherited from Object)
ThresholdClass
ThresholdType

Methods

ClearContent()

Destroys all the display lists associated with the current rendering content.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
CreateRenderRequest()

Returns a FrameRenderRequest that can be used to render a new frame.

Destroy()

Destroys the rendering context of this HardwareRenderer.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
NotifyFramePending()

Notifies the hardware renderer that a call to FrameRenderRequest#syncAndDraw() will be coming soon.

SetContentRoot(RenderNode)

Sets the content root to render.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetLightSourceAlpha(Single, Single)

Configures the ambient & spot shadow alphas.

SetLightSourceGeometry(Single, Single, Single, Single)

Sets the center of the light source.

SetName(String)

Sets a name for this renderer.

SetSurface(Surface)

The surface to render into.

Start()

Resumes rendering into the surface.

Stop()

Hard stops rendering into the surface.

ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to