HardwareRenderer.DrawingEnabled Property

Definition

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

public static bool DrawingEnabled { [Android.Runtime.Register("isDrawingEnabled", "()Z", "", ApiSince=33)] get; [Android.Runtime.Register("setDrawingEnabled", "(Z)V", "", ApiSince=33)] set; }
[<get: Android.Runtime.Register("isDrawingEnabled", "()Z", "", ApiSince=33)>]
[<set: Android.Runtime.Register("setDrawingEnabled", "(Z)V", "", ApiSince=33)>]
static member DrawingEnabled : bool with get, set

Property Value

Attributes

Remarks

Property getter documentation:

Returns true if HardwareRender will produce output.

This value is global to the process and affects all uses of HardwareRenderer, including those created by the system such as those used by the View tree when using hardware accelerated rendering.

Default is true in all production environments, but may be false in testing-focused emulators or if #setDrawingEnabled(boolean) is used.

Java documentation for android.graphics.HardwareRenderer.isDrawingEnabled().

Property setter documentation:

Toggles whether or not HardwareRenderer will produce drawing output globally in the current process.

This applies to all HardwareRenderer instances, including those created by the platform such as those used by the system for hardware accelerated View rendering.

The capability to disable drawing output is intended for test environments, primarily headless ones. By setting this to false, tests that launch activities or interact with Views can be quicker with less RAM usage by skipping the final step of View drawing. All View lifecycle events will occur as normal, only the final step of rendering on the GPU to the display will be skipped.

This can be toggled on and off at will, so screenshot tests can also run in this same environment by toggling drawing back on and forcing a frame to be drawn such as by calling view#invalidate(). Once drawn and the screenshot captured, this can then be turned back off.

Java documentation for android.graphics.HardwareRenderer.setDrawingEnabled(boolean).

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.

Applies to