Methods Summary |
---|
public void | addAnimator(RenderNodeAnimator animator)
if (mOwningView == null || mOwningView.mAttachInfo == null) {
throw new IllegalStateException("Cannot start this animator on a detached view!");
}
nAddAnimator(mNativeRenderNode, animator.getNativeAnimator());
mOwningView.mAttachInfo.mViewRootImpl.registerAnimatingRenderNode(this);
|
public static android.view.RenderNode | adopt(long nativePtr)Adopts an existing native render node.
Note: This will *NOT* incRef() on the native object, however it will
decRef() when it is destroyed. The caller should have already incRef'd it
return new RenderNode(nativePtr);
|
public static android.view.RenderNode | create(java.lang.String name, View owningView)Creates a new RenderNode that can be used to record batches of
drawing operations, and store / apply render properties when drawn.
return new RenderNode(name, owningView);
|
public void | destroyDisplayListData()Reset native resources. This is called when cleaning up the state of display lists
during destruction of hardware resources, to ensure that we do not hold onto
obsolete resources after related resources are gone.
if (!mValid) return;
nSetDisplayListData(mNativeRenderNode, 0);
mValid = false;
|
public void | end(HardwareCanvas endCanvas)Ends the recording for this display list. A display list cannot be
replayed if recording is not finished. Calling this method marks
the display list valid and {@link #isValid()} will return true.
if (!(endCanvas instanceof GLES20RecordingCanvas)) {
throw new IllegalArgumentException("Passed an invalid canvas to end!");
}
GLES20RecordingCanvas canvas = (GLES20RecordingCanvas) endCanvas;
canvas.onPostDraw();
long renderNodeData = canvas.finishRecording();
nSetDisplayListData(mNativeRenderNode, renderNodeData);
canvas.recycle();
mValid = true;
|
public void | endAllAnimators()
nEndAllAnimators(mNativeRenderNode);
|
protected void | finalize()
try {
nDestroyRenderNode(mNativeRenderNode);
} finally {
super.finalize();
}
|
public float | getAlpha()Returns the translucency level of this display list.
return nGetAlpha(mNativeRenderNode);
|
public float | getCameraDistance()Returns the distance in Z of the camera of the display list.
return nGetCameraDistance(mNativeRenderNode);
|
public boolean | getClipToOutline()
return nGetClipToOutline(mNativeRenderNode);
|
public int | getDebugSize()Gets the size of the DisplayList for debug purposes.
return nGetDebugSize(mNativeRenderNode);
|
public float | getElevation()
return nGetElevation(mNativeRenderNode);
|
public void | getInverseMatrix(android.graphics.Matrix outMatrix)
nGetInverseTransformMatrix(mNativeRenderNode, outMatrix.native_instance);
|
public void | getMatrix(android.graphics.Matrix outMatrix)
nGetTransformMatrix(mNativeRenderNode, outMatrix.native_instance);
|
long | getNativeDisplayList()
if (!mValid) {
throw new IllegalStateException("The display list is not valid.");
}
return mNativeRenderNode;
|
public float | getPivotX()Returns the pivot value for this display list on the X axis, in pixels.
return nGetPivotX(mNativeRenderNode);
|
public float | getPivotY()Returns the pivot value for this display list on the Y axis, in pixels.
return nGetPivotY(mNativeRenderNode);
|
public float | getRotation()Returns the rotation value for this display list around the Z axis, in degrees.
return nGetRotation(mNativeRenderNode);
|
public float | getRotationX()Returns the rotation value for this display list around the X axis, in degrees.
return nGetRotationX(mNativeRenderNode);
|
public float | getRotationY()Returns the rotation value for this display list around the Y axis, in degrees.
return nGetRotationY(mNativeRenderNode);
|
public float | getScaleX()Returns the scale value for this display list on the X axis.
return nGetScaleX(mNativeRenderNode);
|
public float | getScaleY()Returns the scale value for this display list on the Y axis.
return nGetScaleY(mNativeRenderNode);
|
public float | getTranslationX()Returns the translation value for this display list on the X axis, in pixels.
return nGetTranslationX(mNativeRenderNode);
|
public float | getTranslationY()Returns the translation value for this display list on the Y axis, in pixels.
return nGetTranslationY(mNativeRenderNode);
|
public float | getTranslationZ()Returns the translation value for this display list on the Z axis.
return nGetTranslationZ(mNativeRenderNode);
|
public boolean | hasIdentityMatrix()
return nHasIdentityMatrix(mNativeRenderNode);
|
public boolean | hasOverlappingRendering()Indicates whether the content of this display list overlaps.
//noinspection SimplifiableIfStatement
return nHasOverlappingRendering(mNativeRenderNode);
|
public boolean | hasShadow()
return nHasShadow(mNativeRenderNode);
|
public boolean | isPivotExplicitlySet()
return nIsPivotExplicitlySet(mNativeRenderNode);
|
public boolean | isValid()Returns whether the RenderNode's display list content is currently usable.
If this returns false, the display list should be re-recorded prior to replaying it. return mValid;
|
private static native void | nAddAnimator(long renderNode, long animatorPtr)
|
private static native long | nCreate(java.lang.String name)
|
private static native void | nDestroyRenderNode(long renderNode)
|
private static native void | nEndAllAnimators(long renderNode)
|
private static native float | nGetAlpha(long renderNode)
|
private static native float | nGetCameraDistance(long renderNode)
|
private static native boolean | nGetClipToOutline(long renderNode)
|
private static native int | nGetDebugSize(long renderNode)
|
private static native float | nGetElevation(long renderNode)
|
private static native void | nGetInverseTransformMatrix(long renderNode, long nativeMatrix)
|
private static native float | nGetPivotX(long renderNode)
|
private static native float | nGetPivotY(long renderNode)
|
private static native float | nGetRotation(long renderNode)
|
private static native float | nGetRotationX(long renderNode)
|
private static native float | nGetRotationY(long renderNode)
|
private static native float | nGetScaleX(long renderNode)
|
private static native float | nGetScaleY(long renderNode)
|
private static native void | nGetTransformMatrix(long renderNode, long nativeMatrix)
|
private static native float | nGetTranslationX(long renderNode)
|
private static native float | nGetTranslationY(long renderNode)
|
private static native float | nGetTranslationZ(long renderNode)
|
private static native boolean | nHasIdentityMatrix(long renderNode)
|
private static native boolean | nHasOverlappingRendering(long renderNode)
|
private static native boolean | nHasShadow(long renderNode)
|
private static native boolean | nIsPivotExplicitlySet(long renderNode)
|
private static native boolean | nOffsetLeftAndRight(long renderNode, int offset)
|
private static native boolean | nOffsetTopAndBottom(long renderNode, int offset)
|
private static native void | nOutput(long renderNode)
|
private static native boolean | nSetAlpha(long renderNode, float alpha)
|
private static native boolean | nSetAnimationMatrix(long renderNode, long animationMatrix)
|
private static native boolean | nSetBottom(long renderNode, int bottom)
|
private static native boolean | nSetCameraDistance(long renderNode, float distance)
|
private static native boolean | nSetClipBounds(long renderNode, int left, int top, int right, int bottom)
|
private static native boolean | nSetClipBoundsEmpty(long renderNode)
|
private static native boolean | nSetClipToBounds(long renderNode, boolean clipToBounds)
|
private static native boolean | nSetClipToOutline(long renderNode, boolean clipToOutline)
|
private static native void | nSetDisplayListData(long renderNode, long newData)
|
private static native boolean | nSetElevation(long renderNode, float lift)
|
private static native boolean | nSetHasOverlappingRendering(long renderNode, boolean hasOverlappingRendering)
|
private static native boolean | nSetLayerPaint(long renderNode, long paint)
|
private static native boolean | nSetLayerType(long renderNode, int layerType)
|
private static native boolean | nSetLeft(long renderNode, int left)
|
private static native boolean | nSetLeftTopRightBottom(long renderNode, int left, int top, int right, int bottom)
|
private static native boolean | nSetOutlineConvexPath(long renderNode, long nativePath, float alpha)
|
private static native boolean | nSetOutlineEmpty(long renderNode)
|
private static native boolean | nSetOutlineNone(long renderNode)
|
private static native boolean | nSetOutlineRoundRect(long renderNode, int left, int top, int right, int bottom, float radius, float alpha)
|
private static native boolean | nSetPivotX(long renderNode, float pivotX)
|
private static native boolean | nSetPivotY(long renderNode, float pivotY)
|
private static native boolean | nSetProjectBackwards(long renderNode, boolean shouldProject)
|
private static native boolean | nSetProjectionReceiver(long renderNode, boolean shouldRecieve)
|
private static native boolean | nSetRevealClip(long renderNode, boolean shouldClip, float x, float y, float radius)
|
private static native boolean | nSetRight(long renderNode, int right)
|
private static native boolean | nSetRotation(long renderNode, float rotation)
|
private static native boolean | nSetRotationX(long renderNode, float rotationX)
|
private static native boolean | nSetRotationY(long renderNode, float rotationY)
|
private static native boolean | nSetScaleX(long renderNode, float scaleX)
|
private static native boolean | nSetScaleY(long renderNode, float scaleY)
|
private static native boolean | nSetStaticMatrix(long renderNode, long nativeMatrix)
|
private static native boolean | nSetTop(long renderNode, int top)
|
private static native boolean | nSetTranslationX(long renderNode, float translationX)
|
private static native boolean | nSetTranslationY(long renderNode, float translationY)
|
private static native boolean | nSetTranslationZ(long renderNode, float translationZ)
|
public boolean | offsetLeftAndRight(int offset)Offsets the left and right positions for the display list
return nOffsetLeftAndRight(mNativeRenderNode, offset);
|
public boolean | offsetTopAndBottom(int offset)Offsets the top and bottom values for the display list
return nOffsetTopAndBottom(mNativeRenderNode, offset);
|
public void | output()Outputs the display list to the log. This method exists for use by
tools to output display lists for selected nodes to the log.
nOutput(mNativeRenderNode);
|
public boolean | setAlpha(float alpha)Sets the translucency level for the display list.
return nSetAlpha(mNativeRenderNode, alpha);
|
public boolean | setAnimationMatrix(android.graphics.Matrix matrix)Set the Animation matrix on the display list. This matrix exists if an Animation is
currently playing on a View, and is set on the display list during at draw() time. When
the Animation finishes, the matrix should be cleared by sending null
for the matrix parameter.
return nSetAnimationMatrix(mNativeRenderNode,
(matrix != null) ? matrix.native_instance : 0);
|
public boolean | setBottom(int bottom)Sets the bottom position for the display list.
return nSetBottom(mNativeRenderNode, bottom);
|
public boolean | setCameraDistance(float distance)Sets the camera distance for the display list. Refer to
{@link View#setCameraDistance(float)} for more information on how to
use this property.
return nSetCameraDistance(mNativeRenderNode, distance);
|
public boolean | setClipBounds(android.graphics.Rect rect)
if (rect == null) {
return nSetClipBoundsEmpty(mNativeRenderNode);
} else {
return nSetClipBounds(mNativeRenderNode, rect.left, rect.top, rect.right, rect.bottom);
}
|
public boolean | setClipToBounds(boolean clipToBounds)Set whether the Render node should clip itself to its bounds. This property is controlled by
the view's parent.
return nSetClipToBounds(mNativeRenderNode, clipToBounds);
|
public boolean | setClipToOutline(boolean clipToOutline)Enables or disables clipping to the outline.
return nSetClipToOutline(mNativeRenderNode, clipToOutline);
|
public boolean | setElevation(float lift)
return nSetElevation(mNativeRenderNode, lift);
|
public boolean | setHasOverlappingRendering(boolean hasOverlappingRendering)Sets whether the display list renders content which overlaps. Non-overlapping rendering
can use a fast path for alpha that avoids rendering to an offscreen buffer. By default
display lists consider they do not have overlapping content.
return nSetHasOverlappingRendering(mNativeRenderNode, hasOverlappingRendering);
|
public boolean | setLayerPaint(android.graphics.Paint paint)
return nSetLayerPaint(mNativeRenderNode, paint != null ? paint.mNativePaint : 0);
|
public boolean | setLayerType(int layerType)
return nSetLayerType(mNativeRenderNode, layerType);
|
public boolean | setLeft(int left)Sets the left position for the display list.
return nSetLeft(mNativeRenderNode, left);
|
public boolean | setLeftTopRightBottom(int left, int top, int right, int bottom)Sets the left and top positions for the display list
return nSetLeftTopRightBottom(mNativeRenderNode, left, top, right, bottom);
|
public boolean | setOutline(android.graphics.Outline outline)Sets the outline, defining the shape that casts a shadow, and the path to
be clipped if setClipToOutline is set.
Deep copies the data into native to simplify reference ownership.
if (outline == null) {
return nSetOutlineNone(mNativeRenderNode);
} else if (outline.isEmpty()) {
return nSetOutlineEmpty(mNativeRenderNode);
} else if (outline.mRect != null) {
return nSetOutlineRoundRect(mNativeRenderNode, outline.mRect.left, outline.mRect.top,
outline.mRect.right, outline.mRect.bottom, outline.mRadius, outline.mAlpha);
} else if (outline.mPath != null) {
return nSetOutlineConvexPath(mNativeRenderNode, outline.mPath.mNativePath,
outline.mAlpha);
}
throw new IllegalArgumentException("Unrecognized outline?");
|
public boolean | setPivotX(float pivotX)Sets the pivot value for the display list on the X axis
return nSetPivotX(mNativeRenderNode, pivotX);
|
public boolean | setPivotY(float pivotY)Sets the pivot value for the display list on the Y axis
return nSetPivotY(mNativeRenderNode, pivotY);
|
public boolean | setProjectBackwards(boolean shouldProject)Sets whether the display list should be drawn immediately after the
closest ancestor display list containing a projection receiver.
return nSetProjectBackwards(mNativeRenderNode, shouldProject);
|
public boolean | setProjectionReceiver(boolean shouldRecieve)Sets whether the display list is a projection receiver - that its parent
DisplayList should draw any descendent DisplayLists with
ProjectBackwards=true directly on top of it. Default value is false.
return nSetProjectionReceiver(mNativeRenderNode, shouldRecieve);
|
public boolean | setRevealClip(boolean shouldClip, float x, float y, float radius)Controls the RenderNode's circular reveal clip.
return nSetRevealClip(mNativeRenderNode, shouldClip, x, y, radius);
|
public boolean | setRight(int right)Sets the right position for the display list.
return nSetRight(mNativeRenderNode, right);
|
public boolean | setRotation(float rotation)Sets the rotation value for the display list around the Z axis.
return nSetRotation(mNativeRenderNode, rotation);
|
public boolean | setRotationX(float rotationX)Sets the rotation value for the display list around the X axis.
return nSetRotationX(mNativeRenderNode, rotationX);
|
public boolean | setRotationY(float rotationY)Sets the rotation value for the display list around the Y axis.
return nSetRotationY(mNativeRenderNode, rotationY);
|
public boolean | setScaleX(float scaleX)Sets the scale value for the display list on the X axis.
return nSetScaleX(mNativeRenderNode, scaleX);
|
public boolean | setScaleY(float scaleY)Sets the scale value for the display list on the Y axis.
return nSetScaleY(mNativeRenderNode, scaleY);
|
public boolean | setStaticMatrix(android.graphics.Matrix matrix)Set the static matrix on the display list. The specified matrix is combined with other
transforms (such as {@link #setScaleX(float)}, {@link #setRotation(float)}, etc.)
return nSetStaticMatrix(mNativeRenderNode, matrix.native_instance);
|
public boolean | setTop(int top)Sets the top position for the display list.
return nSetTop(mNativeRenderNode, top);
|
public boolean | setTranslationX(float translationX)Sets the translation value for the display list on the X axis.
return nSetTranslationX(mNativeRenderNode, translationX);
|
public boolean | setTranslationY(float translationY)Sets the translation value for the display list on the Y axis.
return nSetTranslationY(mNativeRenderNode, translationY);
|
public boolean | setTranslationZ(float translationZ)Sets the translation value for the display list on the Z axis.
return nSetTranslationZ(mNativeRenderNode, translationZ);
|
public HardwareCanvas | start(int width, int height)Starts recording a display list for the render node. All
operations performed on the returned canvas are recorded and
stored in this display list.
Calling this method will mark the render node invalid until
{@link #end(HardwareCanvas)} is called.
Only valid render nodes can be replayed.
HardwareCanvas canvas = GLES20RecordingCanvas.obtain(this);
canvas.setViewport(width, height);
// The dirty rect should always be null for a display list
canvas.onPreDraw(null);
return canvas;
|