diff options
Diffstat (limited to 'graphics/java/android')
| -rw-r--r-- | graphics/java/android/graphics/RenderNode.java | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/RenderNode.java b/graphics/java/android/graphics/RenderNode.java index 5e48ea1c98d8..760f83baec9b 100644 --- a/graphics/java/android/graphics/RenderNode.java +++ b/graphics/java/android/graphics/RenderNode.java @@ -808,14 +808,37 @@ public final class RenderNode { * for the matrix parameter. * * @param matrix The matrix, null indicates that the matrix should be cleared. + * @see #getAnimationMatrix() + * * @hide TODO Do we want this? */ - public boolean setAnimationMatrix(Matrix matrix) { + public boolean setAnimationMatrix(@Nullable Matrix matrix) { return nSetAnimationMatrix(mNativeRenderNode, (matrix != null) ? matrix.native_instance : 0); } /** + * Returns the previously set Animation matrix. This matrix exists if an Animation is + * currently playing on a View, and is set on the display list during at draw() time. + * Returns <code>null</code> when there is no transformation provided by + * {@link #setAnimationMatrix(Matrix)}. + * + * @return the current Animation matrix. + * @see #setAnimationMatrix(Matrix) + * + * @hide + */ + @Nullable + public Matrix getAnimationMatrix() { + Matrix output = new Matrix(); + if (nGetAnimationMatrix(mNativeRenderNode, output.native_instance)) { + return output; + } else { + return null; + } + } + + /** * Sets the translucency level for the display list. * * @param alpha The translucency of the display list, must be a value between 0.0f and 1.0f @@ -1660,6 +1683,9 @@ public final class RenderNode { private static native boolean nHasOverlappingRendering(long renderNode); @CriticalNative + private static native boolean nGetAnimationMatrix(long renderNode, long animationMatrix); + + @CriticalNative private static native boolean nGetClipToOutline(long renderNode); @CriticalNative |