Share via


RenderNode.SetUseCompositingLayer(Boolean, Paint) Method

Definition

Controls whether or not to force this RenderNode to render to an intermediate buffer.

[Android.Runtime.Register("setUseCompositingLayer", "(ZLandroid/graphics/Paint;)Z", "", ApiSince=29)]
public bool SetUseCompositingLayer (bool forceToLayer, Android.Graphics.Paint? paint);
[<Android.Runtime.Register("setUseCompositingLayer", "(ZLandroid/graphics/Paint;)Z", "", ApiSince=29)>]
member this.SetUseCompositingLayer : bool * Android.Graphics.Paint -> bool

Parameters

forceToLayer
Boolean

if true this forces the RenderNode to use an intermediate buffer. Default & generally recommended value is false.

paint
Paint

The blend mode, alpha, and ColorFilter to apply to the compositing layer. Only applies if forceToLayer is true. The paint's alpha is multiplied with #getAlpha() to resolve the final alpha of the RenderNode. If null then no additional composition effects are applied on top of the composition layer.

Returns

True if the value changed, false if the new value was the same as the previous value.

Attributes

Remarks

Controls whether or not to force this RenderNode to render to an intermediate buffer. Internally RenderNode will already promote itself to a composition layer if it's useful for performance or required for the current combination of #setAlpha(float) and #setHasOverlappingRendering(boolean).

The usage of this is instead to allow for either overriding of the internal behavior if it's measured to be necessary for the particular rendering content in question or, more usefully, to add a composition effect to the RenderNode via the optional paint parameter.

Note: When a RenderNode is using a compositing layer it will also result in clipToBounds=true behavior.

Java documentation for android.graphics.RenderNode.setUseCompositingLayer(boolean, android.graphics.Paint).

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