blob: ea6e63c3b9dece6c16fd3615aa291ad6f92d5254 [file] [log] [blame]
John Reckf666ad72014-03-14 16:24:57 -07001/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.view;
18
Chris Craik49e6c732014-03-31 12:34:11 -070019import android.annotation.NonNull;
Chris Craika753f4c2014-07-24 12:39:17 -070020import android.annotation.Nullable;
John Reckf666ad72014-03-14 16:24:57 -070021import android.graphics.Matrix;
Chris Craikb49f4462014-03-20 12:44:20 -070022import android.graphics.Outline;
John Reck25fbb3f2014-06-12 13:46:45 -070023import android.graphics.Paint;
Chris Craika753f4c2014-07-24 12:39:17 -070024import android.graphics.Rect;
Doris Liu766431a2016-02-04 22:17:11 +000025import android.graphics.drawable.AnimatedVectorDrawable;
John Reckf666ad72014-03-14 16:24:57 -070026
Chris Craikfc294242016-12-13 18:10:46 -080027import dalvik.annotation.optimization.CriticalNative;
John Reck395e9b82016-08-24 13:22:37 -070028import dalvik.annotation.optimization.FastNative;
29
John Reckb99fff52016-11-16 15:21:57 -080030import libcore.util.NativeAllocationRegistry;
31
John Reckf666ad72014-03-14 16:24:57 -070032/**
33 * <p>A display list records a series of graphics related operations and can replay
34 * them later. Display lists are usually built by recording operations on a
Chris Craikf6829a02015-03-10 10:28:59 -070035 * {@link DisplayListCanvas}. Replaying the operations from a display list avoids
John Reckf666ad72014-03-14 16:24:57 -070036 * executing application code on every frame, and is thus much more efficient.</p>
37 *
38 * <p>Display lists are used internally for all views by default, and are not
39 * typically used directly. One reason to consider using a display is a custom
40 * {@link View} implementation that needs to issue a large number of drawing commands.
41 * When the view invalidates, all the drawing commands must be reissued, even if
42 * large portions of the drawing command stream stay the same frame to frame, which
43 * can become a performance bottleneck. To solve this issue, a custom View might split
44 * its content into several display lists. A display list is updated only when its
45 * content, and only its content, needs to be updated.</p>
46 *
47 * <p>A text editor might for instance store each paragraph into its own display list.
48 * Thus when the user inserts or removes characters, only the display list of the
49 * affected paragraph needs to be recorded again.</p>
50 *
51 * <h3>Hardware acceleration</h3>
Chris Craikf6829a02015-03-10 10:28:59 -070052 * <p>Display lists can only be replayed using a {@link DisplayListCanvas}. They are not
John Reckf666ad72014-03-14 16:24:57 -070053 * supported in software. Always make sure that the {@link android.graphics.Canvas}
54 * you are using to render a display list is hardware accelerated using
55 * {@link android.graphics.Canvas#isHardwareAccelerated()}.</p>
56 *
57 * <h3>Creating a display list</h3>
58 * <pre class="prettyprint">
Stan Iliev45faba52016-06-28 13:33:15 -040059 * ThreadedRenderer renderer = myView.getThreadedRenderer();
John Reckf666ad72014-03-14 16:24:57 -070060 * if (renderer != null) {
61 * DisplayList displayList = renderer.createDisplayList();
Chris Craikf6829a02015-03-10 10:28:59 -070062 * DisplayListCanvas canvas = displayList.start(width, height);
John Reckf666ad72014-03-14 16:24:57 -070063 * try {
64 * // Draw onto the canvas
65 * // For instance: canvas.drawBitmap(...);
66 * } finally {
67 * displayList.end();
68 * }
69 * }
70 * </pre>
71 *
72 * <h3>Rendering a display list on a View</h3>
73 * <pre class="prettyprint">
74 * protected void onDraw(Canvas canvas) {
75 * if (canvas.isHardwareAccelerated()) {
Chris Craikf6829a02015-03-10 10:28:59 -070076 * DisplayListCanvas displayListCanvas = (DisplayListCanvas) canvas;
77 * displayListCanvas.drawDisplayList(mDisplayList);
John Reckf666ad72014-03-14 16:24:57 -070078 * }
79 * }
80 * </pre>
81 *
82 * <h3>Releasing resources</h3>
83 * <p>This step is not mandatory but recommended if you want to release resources
84 * held by a display list as soon as possible.</p>
85 * <pre class="prettyprint">
86 * // Mark this display list invalid, it cannot be used for drawing anymore,
87 * // and release resources held by this display list
88 * displayList.clear();
89 * </pre>
90 *
91 * <h3>Properties</h3>
92 * <p>In addition, a display list offers several properties, such as
93 * {@link #setScaleX(float)} or {@link #setLeft(int)}, that can be used to affect all
94 * the drawing commands recorded within. For instance, these properties can be used
95 * to move around a large number of images without re-issuing all the individual
96 * <code>drawBitmap()</code> calls.</p>
97 *
98 * <pre class="prettyprint">
99 * private void createDisplayList() {
100 * mDisplayList = DisplayList.create("MyDisplayList");
Chris Craikf6829a02015-03-10 10:28:59 -0700101 * DisplayListCanvas canvas = mDisplayList.start(width, height);
John Reckf666ad72014-03-14 16:24:57 -0700102 * try {
103 * for (Bitmap b : mBitmaps) {
104 * canvas.drawBitmap(b, 0.0f, 0.0f, null);
105 * canvas.translate(0.0f, b.getHeight());
106 * }
107 * } finally {
108 * displayList.end();
109 * }
110 * }
111 *
112 * protected void onDraw(Canvas canvas) {
113 * if (canvas.isHardwareAccelerated()) {
Chris Craikf6829a02015-03-10 10:28:59 -0700114 * DisplayListCanvas displayListCanvas = (DisplayListCanvas) canvas;
115 * displayListCanvas.drawDisplayList(mDisplayList);
John Reckf666ad72014-03-14 16:24:57 -0700116 * }
117 * }
118 *
119 * private void moveContentBy(int x) {
120 * // This will move all the bitmaps recorded inside the display list
121 * // by x pixels to the right and redraw this view. All the commands
122 * // recorded in createDisplayList() won't be re-issued, only onDraw()
123 * // will be invoked and will execute very quickly
124 * mDisplayList.offsetLeftAndRight(x);
125 * invalidate();
126 * }
127 * </pre>
128 *
129 * <h3>Threading</h3>
130 * <p>Display lists must be created on and manipulated from the UI thread only.</p>
131 *
132 * @hide
133 */
134public class RenderNode {
John Reckf666ad72014-03-14 16:24:57 -0700135
John Reckb99fff52016-11-16 15:21:57 -0800136 // Use a Holder to allow static initialization in the boot image.
137 private static class NoImagePreloadHolder {
138 public static final NativeAllocationRegistry sRegistry = new NativeAllocationRegistry(
139 RenderNode.class.getClassLoader(), nGetNativeFinalizer(), 1024);
140 }
141
John Reck119907c2014-08-14 09:02:01 -0700142 // Do not access directly unless you are ThreadedRenderer
John Reckb99fff52016-11-16 15:21:57 -0800143 final long mNativeRenderNode;
John Reck119907c2014-08-14 09:02:01 -0700144 private final View mOwningView;
John Reckf666ad72014-03-14 16:24:57 -0700145
John Reck119907c2014-08-14 09:02:01 -0700146 private RenderNode(String name, View owningView) {
John Reck8de65a82014-04-09 15:23:38 -0700147 mNativeRenderNode = nCreate(name);
John Reckb99fff52016-11-16 15:21:57 -0800148 NoImagePreloadHolder.sRegistry.registerNativeAllocation(this, mNativeRenderNode);
John Reck119907c2014-08-14 09:02:01 -0700149 mOwningView = owningView;
John Reckf666ad72014-03-14 16:24:57 -0700150 }
151
152 /**
John Recke45b1fd2014-04-15 09:50:16 -0700153 * @see RenderNode#adopt(long)
154 */
155 private RenderNode(long nativePtr) {
156 mNativeRenderNode = nativePtr;
John Reckb99fff52016-11-16 15:21:57 -0800157 NoImagePreloadHolder.sRegistry.registerNativeAllocation(this, mNativeRenderNode);
John Reck119907c2014-08-14 09:02:01 -0700158 mOwningView = null;
John Recke45b1fd2014-04-15 09:50:16 -0700159 }
160
161 /**
John Reck3acf03822016-11-02 11:14:47 -0700162 * Immediately destroys the RenderNode
163 * Only suitable for testing/benchmarking where waiting for the GC/finalizer
164 * is not feasible.
165 */
166 public void destroy() {
John Reckb99fff52016-11-16 15:21:57 -0800167 // TODO: Removed temporarily
John Reck3acf03822016-11-02 11:14:47 -0700168 }
169
170 /**
Chris Craik9a347f12014-06-27 17:23:47 -0700171 * Creates a new RenderNode that can be used to record batches of
172 * drawing operations, and store / apply render properties when drawn.
John Reckf666ad72014-03-14 16:24:57 -0700173 *
Chris Craik9a347f12014-06-27 17:23:47 -0700174 * @param name The name of the RenderNode, used for debugging purpose. May be null.
John Reckf666ad72014-03-14 16:24:57 -0700175 *
Chris Craik9a347f12014-06-27 17:23:47 -0700176 * @return A new RenderNode.
John Reckf666ad72014-03-14 16:24:57 -0700177 */
John Reck119907c2014-08-14 09:02:01 -0700178 public static RenderNode create(String name, @Nullable View owningView) {
179 return new RenderNode(name, owningView);
John Reckf666ad72014-03-14 16:24:57 -0700180 }
181
182 /**
John Recke45b1fd2014-04-15 09:50:16 -0700183 * Adopts an existing native render node.
184 *
185 * Note: This will *NOT* incRef() on the native object, however it will
186 * decRef() when it is destroyed. The caller should have already incRef'd it
187 */
188 public static RenderNode adopt(long nativePtr) {
189 return new RenderNode(nativePtr);
190 }
191
John Reck3acf03822016-11-02 11:14:47 -0700192 /**
193 * Enable callbacks for position changes.
194 */
195 public void requestPositionUpdates(SurfaceView view) {
196 nRequestPositionUpdates(mNativeRenderNode, view);
197 }
198
John Recke45b1fd2014-04-15 09:50:16 -0700199
200 /**
Chris Craik49e6c732014-03-31 12:34:11 -0700201 * Starts recording a display list for the render node. All
202 * operations performed on the returned canvas are recorded and
203 * stored in this display list.
John Reckf666ad72014-03-14 16:24:57 -0700204 *
Chris Craik49e6c732014-03-31 12:34:11 -0700205 * Calling this method will mark the render node invalid until
Chris Craikf6829a02015-03-10 10:28:59 -0700206 * {@link #end(DisplayListCanvas)} is called.
Chris Craik49e6c732014-03-31 12:34:11 -0700207 * Only valid render nodes can be replayed.
John Reckf666ad72014-03-14 16:24:57 -0700208 *
Chris Craik49e6c732014-03-31 12:34:11 -0700209 * @param width The width of the recording viewport
210 * @param height The height of the recording viewport
John Reckf666ad72014-03-14 16:24:57 -0700211 *
212 * @return A canvas to record drawing operations.
213 *
Chris Craikf6829a02015-03-10 10:28:59 -0700214 * @see #end(DisplayListCanvas)
John Reckf666ad72014-03-14 16:24:57 -0700215 * @see #isValid()
216 */
Chris Craikf6829a02015-03-10 10:28:59 -0700217 public DisplayListCanvas start(int width, int height) {
Derek Sollenbergercc882b62015-07-09 15:51:20 -0400218 return DisplayListCanvas.obtain(this, width, height);
John Reckf666ad72014-03-14 16:24:57 -0700219 }
220
221 /**
222 * Ends the recording for this display list. A display list cannot be
223 * replayed if recording is not finished. Calling this method marks
224 * the display list valid and {@link #isValid()} will return true.
225 *
226 * @see #start(int, int)
227 * @see #isValid()
228 */
Chris Craik3891f3a2015-04-02 15:28:08 -0700229 public void end(DisplayListCanvas canvas) {
Chris Craik003cc3d2015-10-16 10:24:55 -0700230 long displayList = canvas.finishRecording();
231 nSetDisplayList(mNativeRenderNode, displayList);
John Reckf666ad72014-03-14 16:24:57 -0700232 canvas.recycle();
John Reckf666ad72014-03-14 16:24:57 -0700233 }
234
235 /**
236 * Reset native resources. This is called when cleaning up the state of display lists
237 * during destruction of hardware resources, to ensure that we do not hold onto
238 * obsolete resources after related resources are gone.
John Reckf666ad72014-03-14 16:24:57 -0700239 */
Chris Craik003cc3d2015-10-16 10:24:55 -0700240 public void discardDisplayList() {
Chris Craik003cc3d2015-10-16 10:24:55 -0700241 nSetDisplayList(mNativeRenderNode, 0);
John Reckf666ad72014-03-14 16:24:57 -0700242 }
243
John Reckf666ad72014-03-14 16:24:57 -0700244 /**
Chris Craikdf0c4312014-03-28 16:55:08 -0700245 * Returns whether the RenderNode's display list content is currently usable.
246 * If this returns false, the display list should be re-recorded prior to replaying it.
John Reckf666ad72014-03-14 16:24:57 -0700247 *
248 * @return boolean true if the display list is able to be replayed, false otherwise.
249 */
John Reck2de950d2017-01-25 10:58:30 -0800250 public boolean isValid() {
251 return nIsValid(mNativeRenderNode);
252 }
John Reckf666ad72014-03-14 16:24:57 -0700253
254 long getNativeDisplayList() {
John Reck2de950d2017-01-25 10:58:30 -0800255 if (!isValid()) {
John Reckf666ad72014-03-14 16:24:57 -0700256 throw new IllegalStateException("The display list is not valid.");
257 }
John Reck8de65a82014-04-09 15:23:38 -0700258 return mNativeRenderNode;
John Reckf666ad72014-03-14 16:24:57 -0700259 }
260
261 ///////////////////////////////////////////////////////////////////////////
Chris Craik49e6c732014-03-31 12:34:11 -0700262 // Matrix manipulation
263 ///////////////////////////////////////////////////////////////////////////
264
265 public boolean hasIdentityMatrix() {
John Reck8de65a82014-04-09 15:23:38 -0700266 return nHasIdentityMatrix(mNativeRenderNode);
Chris Craik49e6c732014-03-31 12:34:11 -0700267 }
268
269 public void getMatrix(@NonNull Matrix outMatrix) {
John Reck8de65a82014-04-09 15:23:38 -0700270 nGetTransformMatrix(mNativeRenderNode, outMatrix.native_instance);
Chris Craik49e6c732014-03-31 12:34:11 -0700271 }
272
273 public void getInverseMatrix(@NonNull Matrix outMatrix) {
John Reck8de65a82014-04-09 15:23:38 -0700274 nGetInverseTransformMatrix(mNativeRenderNode, outMatrix.native_instance);
Chris Craik49e6c732014-03-31 12:34:11 -0700275 }
276
277 ///////////////////////////////////////////////////////////////////////////
278 // RenderProperty Setters
John Reckf666ad72014-03-14 16:24:57 -0700279 ///////////////////////////////////////////////////////////////////////////
280
John Reck25fbb3f2014-06-12 13:46:45 -0700281 public boolean setLayerType(int layerType) {
282 return nSetLayerType(mNativeRenderNode, layerType);
283 }
284
sergeyv342a7e62016-03-24 16:06:46 -0700285 public boolean setLayerPaint(@Nullable Paint paint) {
Derek Sollenbergerdfba4d32014-09-02 15:42:54 -0400286 return nSetLayerPaint(mNativeRenderNode, paint != null ? paint.getNativeInstance() : 0);
John Reckf666ad72014-03-14 16:24:57 -0700287 }
288
Chris Craika753f4c2014-07-24 12:39:17 -0700289 public boolean setClipBounds(@Nullable Rect rect) {
290 if (rect == null) {
291 return nSetClipBoundsEmpty(mNativeRenderNode);
292 } else {
293 return nSetClipBounds(mNativeRenderNode, rect.left, rect.top, rect.right, rect.bottom);
294 }
295 }
296
John Reckf666ad72014-03-14 16:24:57 -0700297 /**
Chris Craik49e6c732014-03-31 12:34:11 -0700298 * Set whether the Render node should clip itself to its bounds. This property is controlled by
John Reckf666ad72014-03-14 16:24:57 -0700299 * the view's parent.
300 *
301 * @param clipToBounds true if the display list should clip to its bounds
302 */
John Reck79c7de72014-05-23 10:33:31 -0700303 public boolean setClipToBounds(boolean clipToBounds) {
304 return nSetClipToBounds(mNativeRenderNode, clipToBounds);
John Reckf666ad72014-03-14 16:24:57 -0700305 }
306
307 /**
John Reckf666ad72014-03-14 16:24:57 -0700308 * Sets whether the display list should be drawn immediately after the
Chris Craik49e6c732014-03-31 12:34:11 -0700309 * closest ancestor display list containing a projection receiver.
John Reckf666ad72014-03-14 16:24:57 -0700310 *
311 * @param shouldProject true if the display list should be projected onto a
312 * containing volume.
313 */
John Reck79c7de72014-05-23 10:33:31 -0700314 public boolean setProjectBackwards(boolean shouldProject) {
315 return nSetProjectBackwards(mNativeRenderNode, shouldProject);
John Reckf666ad72014-03-14 16:24:57 -0700316 }
317
318 /**
319 * Sets whether the display list is a projection receiver - that its parent
320 * DisplayList should draw any descendent DisplayLists with
321 * ProjectBackwards=true directly on top of it. Default value is false.
322 */
John Reck79c7de72014-05-23 10:33:31 -0700323 public boolean setProjectionReceiver(boolean shouldRecieve) {
324 return nSetProjectionReceiver(mNativeRenderNode, shouldRecieve);
John Reckf666ad72014-03-14 16:24:57 -0700325 }
326
327 /**
328 * Sets the outline, defining the shape that casts a shadow, and the path to
329 * be clipped if setClipToOutline is set.
330 *
Chris Craikb49f4462014-03-20 12:44:20 -0700331 * Deep copies the data into native to simplify reference ownership.
John Reckf666ad72014-03-14 16:24:57 -0700332 */
Chris Craik136d1af2016-04-04 13:40:39 -0700333 public boolean setOutline(@Nullable Outline outline) {
Chris Craik06451282014-07-21 10:25:54 -0700334 if (outline == null) {
335 return nSetOutlineNone(mNativeRenderNode);
Chris Craikb49f4462014-03-20 12:44:20 -0700336 }
Chris Craik136d1af2016-04-04 13:40:39 -0700337
338 switch(outline.mMode) {
339 case Outline.MODE_EMPTY:
340 return nSetOutlineEmpty(mNativeRenderNode);
341 case Outline.MODE_ROUND_RECT:
342 return nSetOutlineRoundRect(mNativeRenderNode, outline.mRect.left, outline.mRect.top,
343 outline.mRect.right, outline.mRect.bottom, outline.mRadius, outline.mAlpha);
344 case Outline.MODE_CONVEX_PATH:
345 return nSetOutlineConvexPath(mNativeRenderNode, outline.mPath.mNativePath,
346 outline.mAlpha);
347 }
348
John Reck79c7de72014-05-23 10:33:31 -0700349 throw new IllegalArgumentException("Unrecognized outline?");
John Reckf666ad72014-03-14 16:24:57 -0700350 }
351
Chris Craik5c75c522014-09-05 14:08:08 -0700352 public boolean hasShadow() {
353 return nHasShadow(mNativeRenderNode);
354 }
355
John Reckf666ad72014-03-14 16:24:57 -0700356 /**
357 * Enables or disables clipping to the outline.
358 *
359 * @param clipToOutline true if clipping to the outline.
360 */
John Reck79c7de72014-05-23 10:33:31 -0700361 public boolean setClipToOutline(boolean clipToOutline) {
362 return nSetClipToOutline(mNativeRenderNode, clipToOutline);
John Reckf666ad72014-03-14 16:24:57 -0700363 }
364
Chris Craikdeeda3d2014-05-05 19:09:33 -0700365 public boolean getClipToOutline() {
366 return nGetClipToOutline(mNativeRenderNode);
367 }
368
John Reckf666ad72014-03-14 16:24:57 -0700369 /**
Chris Craik8c271ca2014-03-25 10:33:01 -0700370 * Controls the RenderNode's circular reveal clip.
371 */
Chris Craikaf4d04c2014-07-29 12:50:14 -0700372 public boolean setRevealClip(boolean shouldClip,
Chris Craik8c271ca2014-03-25 10:33:01 -0700373 float x, float y, float radius) {
Chris Craikaf4d04c2014-07-29 12:50:14 -0700374 return nSetRevealClip(mNativeRenderNode, shouldClip, x, y, radius);
Chris Craik8c271ca2014-03-25 10:33:01 -0700375 }
376
377 /**
John Reckf666ad72014-03-14 16:24:57 -0700378 * Set the static matrix on the display list. The specified matrix is combined with other
379 * transforms (such as {@link #setScaleX(float)}, {@link #setRotation(float)}, etc.)
380 *
381 * @param matrix A transform matrix to apply to this display list
John Reckf666ad72014-03-14 16:24:57 -0700382 */
John Reck79c7de72014-05-23 10:33:31 -0700383 public boolean setStaticMatrix(Matrix matrix) {
384 return nSetStaticMatrix(mNativeRenderNode, matrix.native_instance);
John Reckf666ad72014-03-14 16:24:57 -0700385 }
386
387 /**
388 * Set the Animation matrix on the display list. This matrix exists if an Animation is
389 * currently playing on a View, and is set on the display list during at draw() time. When
390 * the Animation finishes, the matrix should be cleared by sending <code>null</code>
391 * for the matrix parameter.
392 *
393 * @param matrix The matrix, null indicates that the matrix should be cleared.
John Reckf666ad72014-03-14 16:24:57 -0700394 */
John Reck79c7de72014-05-23 10:33:31 -0700395 public boolean setAnimationMatrix(Matrix matrix) {
396 return nSetAnimationMatrix(mNativeRenderNode,
John Reckf666ad72014-03-14 16:24:57 -0700397 (matrix != null) ? matrix.native_instance : 0);
398 }
399
400 /**
401 * Sets the translucency level for the display list.
402 *
403 * @param alpha The translucency of the display list, must be a value between 0.0f and 1.0f
404 *
405 * @see View#setAlpha(float)
406 * @see #getAlpha()
407 */
John Reck79c7de72014-05-23 10:33:31 -0700408 public boolean setAlpha(float alpha) {
409 return nSetAlpha(mNativeRenderNode, alpha);
John Reckf666ad72014-03-14 16:24:57 -0700410 }
411
412 /**
413 * Returns the translucency level of this display list.
414 *
415 * @return A value between 0.0f and 1.0f
416 *
417 * @see #setAlpha(float)
418 */
419 public float getAlpha() {
John Reck8de65a82014-04-09 15:23:38 -0700420 return nGetAlpha(mNativeRenderNode);
John Reckf666ad72014-03-14 16:24:57 -0700421 }
422
423 /**
424 * Sets whether the display list renders content which overlaps. Non-overlapping rendering
425 * can use a fast path for alpha that avoids rendering to an offscreen buffer. By default
426 * display lists consider they do not have overlapping content.
427 *
428 * @param hasOverlappingRendering False if the content is guaranteed to be non-overlapping,
429 * true otherwise.
430 *
431 * @see android.view.View#hasOverlappingRendering()
432 * @see #hasOverlappingRendering()
433 */
John Reck79c7de72014-05-23 10:33:31 -0700434 public boolean setHasOverlappingRendering(boolean hasOverlappingRendering) {
435 return nSetHasOverlappingRendering(mNativeRenderNode, hasOverlappingRendering);
John Reckf666ad72014-03-14 16:24:57 -0700436 }
437
438 /**
439 * Indicates whether the content of this display list overlaps.
440 *
441 * @return True if this display list renders content which overlaps, false otherwise.
442 *
443 * @see #setHasOverlappingRendering(boolean)
444 */
445 public boolean hasOverlappingRendering() {
446 //noinspection SimplifiableIfStatement
John Reck8de65a82014-04-09 15:23:38 -0700447 return nHasOverlappingRendering(mNativeRenderNode);
John Reckf666ad72014-03-14 16:24:57 -0700448 }
449
John Reck79c7de72014-05-23 10:33:31 -0700450 public boolean setElevation(float lift) {
451 return nSetElevation(mNativeRenderNode, lift);
Chris Craikcc39e162014-04-25 18:34:11 -0700452 }
453
454 public float getElevation() {
455 return nGetElevation(mNativeRenderNode);
456 }
457
John Reckf666ad72014-03-14 16:24:57 -0700458 /**
459 * Sets the translation value for the display list on the X axis.
460 *
461 * @param translationX The X axis translation value of the display list, in pixels
462 *
463 * @see View#setTranslationX(float)
464 * @see #getTranslationX()
465 */
John Reck79c7de72014-05-23 10:33:31 -0700466 public boolean setTranslationX(float translationX) {
467 return nSetTranslationX(mNativeRenderNode, translationX);
John Reckf666ad72014-03-14 16:24:57 -0700468 }
469
470 /**
471 * Returns the translation value for this display list on the X axis, in pixels.
472 *
473 * @see #setTranslationX(float)
474 */
475 public float getTranslationX() {
John Reck8de65a82014-04-09 15:23:38 -0700476 return nGetTranslationX(mNativeRenderNode);
John Reckf666ad72014-03-14 16:24:57 -0700477 }
478
479 /**
480 * Sets the translation value for the display list on the Y axis.
481 *
482 * @param translationY The Y axis translation value of the display list, in pixels
483 *
484 * @see View#setTranslationY(float)
485 * @see #getTranslationY()
486 */
John Reck79c7de72014-05-23 10:33:31 -0700487 public boolean setTranslationY(float translationY) {
488 return nSetTranslationY(mNativeRenderNode, translationY);
John Reckf666ad72014-03-14 16:24:57 -0700489 }
490
491 /**
492 * Returns the translation value for this display list on the Y axis, in pixels.
493 *
494 * @see #setTranslationY(float)
495 */
496 public float getTranslationY() {
John Reck8de65a82014-04-09 15:23:38 -0700497 return nGetTranslationY(mNativeRenderNode);
John Reckf666ad72014-03-14 16:24:57 -0700498 }
499
500 /**
501 * Sets the translation value for the display list on the Z axis.
502 *
503 * @see View#setTranslationZ(float)
504 * @see #getTranslationZ()
505 */
John Reck79c7de72014-05-23 10:33:31 -0700506 public boolean setTranslationZ(float translationZ) {
507 return nSetTranslationZ(mNativeRenderNode, translationZ);
John Reckf666ad72014-03-14 16:24:57 -0700508 }
509
510 /**
511 * Returns the translation value for this display list on the Z axis.
512 *
513 * @see #setTranslationZ(float)
514 */
515 public float getTranslationZ() {
John Reck8de65a82014-04-09 15:23:38 -0700516 return nGetTranslationZ(mNativeRenderNode);
John Reckf666ad72014-03-14 16:24:57 -0700517 }
518
519 /**
520 * Sets the rotation value for the display list around the Z axis.
521 *
522 * @param rotation The rotation value of the display list, in degrees
523 *
524 * @see View#setRotation(float)
525 * @see #getRotation()
526 */
John Reck79c7de72014-05-23 10:33:31 -0700527 public boolean setRotation(float rotation) {
528 return nSetRotation(mNativeRenderNode, rotation);
John Reckf666ad72014-03-14 16:24:57 -0700529 }
530
531 /**
532 * Returns the rotation value for this display list around the Z axis, in degrees.
533 *
534 * @see #setRotation(float)
535 */
536 public float getRotation() {
John Reck8de65a82014-04-09 15:23:38 -0700537 return nGetRotation(mNativeRenderNode);
John Reckf666ad72014-03-14 16:24:57 -0700538 }
539
540 /**
541 * Sets the rotation value for the display list around the X axis.
542 *
543 * @param rotationX The rotation value of the display list, in degrees
544 *
545 * @see View#setRotationX(float)
546 * @see #getRotationX()
547 */
John Reck79c7de72014-05-23 10:33:31 -0700548 public boolean setRotationX(float rotationX) {
549 return nSetRotationX(mNativeRenderNode, rotationX);
John Reckf666ad72014-03-14 16:24:57 -0700550 }
551
552 /**
553 * Returns the rotation value for this display list around the X axis, in degrees.
554 *
555 * @see #setRotationX(float)
556 */
557 public float getRotationX() {
John Reck8de65a82014-04-09 15:23:38 -0700558 return nGetRotationX(mNativeRenderNode);
John Reckf666ad72014-03-14 16:24:57 -0700559 }
560
561 /**
562 * Sets the rotation value for the display list around the Y axis.
563 *
564 * @param rotationY The rotation value of the display list, in degrees
565 *
566 * @see View#setRotationY(float)
567 * @see #getRotationY()
568 */
John Reck79c7de72014-05-23 10:33:31 -0700569 public boolean setRotationY(float rotationY) {
570 return nSetRotationY(mNativeRenderNode, rotationY);
John Reckf666ad72014-03-14 16:24:57 -0700571 }
572
573 /**
574 * Returns the rotation value for this display list around the Y axis, in degrees.
575 *
576 * @see #setRotationY(float)
577 */
578 public float getRotationY() {
John Reck8de65a82014-04-09 15:23:38 -0700579 return nGetRotationY(mNativeRenderNode);
John Reckf666ad72014-03-14 16:24:57 -0700580 }
581
582 /**
583 * Sets the scale value for the display list on the X axis.
584 *
585 * @param scaleX The scale value of the display list
586 *
587 * @see View#setScaleX(float)
588 * @see #getScaleX()
589 */
John Reck79c7de72014-05-23 10:33:31 -0700590 public boolean setScaleX(float scaleX) {
591 return nSetScaleX(mNativeRenderNode, scaleX);
John Reckf666ad72014-03-14 16:24:57 -0700592 }
593
594 /**
595 * Returns the scale value for this display list on the X axis.
596 *
597 * @see #setScaleX(float)
598 */
599 public float getScaleX() {
John Reck8de65a82014-04-09 15:23:38 -0700600 return nGetScaleX(mNativeRenderNode);
John Reckf666ad72014-03-14 16:24:57 -0700601 }
602
603 /**
604 * Sets the scale value for the display list on the Y axis.
605 *
606 * @param scaleY The scale value of the display list
607 *
608 * @see View#setScaleY(float)
609 * @see #getScaleY()
610 */
John Reck79c7de72014-05-23 10:33:31 -0700611 public boolean setScaleY(float scaleY) {
612 return nSetScaleY(mNativeRenderNode, scaleY);
John Reckf666ad72014-03-14 16:24:57 -0700613 }
614
615 /**
616 * Returns the scale value for this display list on the Y axis.
617 *
618 * @see #setScaleY(float)
619 */
620 public float getScaleY() {
John Reck8de65a82014-04-09 15:23:38 -0700621 return nGetScaleY(mNativeRenderNode);
John Reckf666ad72014-03-14 16:24:57 -0700622 }
623
624 /**
John Reckf666ad72014-03-14 16:24:57 -0700625 * Sets the pivot value for the display list on the X axis
626 *
627 * @param pivotX The pivot value of the display list on the X axis, in pixels
628 *
629 * @see View#setPivotX(float)
630 * @see #getPivotX()
631 */
John Reck79c7de72014-05-23 10:33:31 -0700632 public boolean setPivotX(float pivotX) {
633 return nSetPivotX(mNativeRenderNode, pivotX);
John Reckf666ad72014-03-14 16:24:57 -0700634 }
635
636 /**
637 * Returns the pivot value for this display list on the X axis, in pixels.
638 *
639 * @see #setPivotX(float)
640 */
641 public float getPivotX() {
John Reck8de65a82014-04-09 15:23:38 -0700642 return nGetPivotX(mNativeRenderNode);
John Reckf666ad72014-03-14 16:24:57 -0700643 }
644
645 /**
646 * Sets the pivot value for the display list on the Y axis
647 *
648 * @param pivotY The pivot value of the display list on the Y axis, in pixels
649 *
650 * @see View#setPivotY(float)
651 * @see #getPivotY()
652 */
John Reck79c7de72014-05-23 10:33:31 -0700653 public boolean setPivotY(float pivotY) {
654 return nSetPivotY(mNativeRenderNode, pivotY);
John Reckf666ad72014-03-14 16:24:57 -0700655 }
656
657 /**
658 * Returns the pivot value for this display list on the Y axis, in pixels.
659 *
660 * @see #setPivotY(float)
661 */
662 public float getPivotY() {
John Reck8de65a82014-04-09 15:23:38 -0700663 return nGetPivotY(mNativeRenderNode);
John Reckf666ad72014-03-14 16:24:57 -0700664 }
665
Chris Craik49e6c732014-03-31 12:34:11 -0700666 public boolean isPivotExplicitlySet() {
John Reck8de65a82014-04-09 15:23:38 -0700667 return nIsPivotExplicitlySet(mNativeRenderNode);
Chris Craik49e6c732014-03-31 12:34:11 -0700668 }
669
John Reckf666ad72014-03-14 16:24:57 -0700670 /**
671 * Sets the camera distance for the display list. Refer to
672 * {@link View#setCameraDistance(float)} for more information on how to
673 * use this property.
674 *
675 * @param distance The distance in Z of the camera of the display list
676 *
677 * @see View#setCameraDistance(float)
678 * @see #getCameraDistance()
679 */
John Reck79c7de72014-05-23 10:33:31 -0700680 public boolean setCameraDistance(float distance) {
681 return nSetCameraDistance(mNativeRenderNode, distance);
John Reckf666ad72014-03-14 16:24:57 -0700682 }
683
684 /**
685 * Returns the distance in Z of the camera of the display list.
686 *
687 * @see #setCameraDistance(float)
688 */
689 public float getCameraDistance() {
John Reck8de65a82014-04-09 15:23:38 -0700690 return nGetCameraDistance(mNativeRenderNode);
John Reckf666ad72014-03-14 16:24:57 -0700691 }
692
693 /**
694 * Sets the left position for the display list.
695 *
696 * @param left The left position, in pixels, of the display list
697 *
698 * @see View#setLeft(int)
John Reckf666ad72014-03-14 16:24:57 -0700699 */
John Reck79c7de72014-05-23 10:33:31 -0700700 public boolean setLeft(int left) {
701 return nSetLeft(mNativeRenderNode, left);
John Reckf666ad72014-03-14 16:24:57 -0700702 }
703
704 /**
John Reckf666ad72014-03-14 16:24:57 -0700705 * Sets the top position for the display list.
706 *
707 * @param top The top position, in pixels, of the display list
708 *
709 * @see View#setTop(int)
John Reckf666ad72014-03-14 16:24:57 -0700710 */
John Reck79c7de72014-05-23 10:33:31 -0700711 public boolean setTop(int top) {
712 return nSetTop(mNativeRenderNode, top);
John Reckf666ad72014-03-14 16:24:57 -0700713 }
714
715 /**
John Reckf666ad72014-03-14 16:24:57 -0700716 * Sets the right position for the display list.
717 *
718 * @param right The right position, in pixels, of the display list
719 *
720 * @see View#setRight(int)
John Reckf666ad72014-03-14 16:24:57 -0700721 */
John Reck79c7de72014-05-23 10:33:31 -0700722 public boolean setRight(int right) {
723 return nSetRight(mNativeRenderNode, right);
John Reckf666ad72014-03-14 16:24:57 -0700724 }
725
726 /**
John Reckf666ad72014-03-14 16:24:57 -0700727 * Sets the bottom position for the display list.
728 *
729 * @param bottom The bottom position, in pixels, of the display list
730 *
731 * @see View#setBottom(int)
John Reckf666ad72014-03-14 16:24:57 -0700732 */
John Reck79c7de72014-05-23 10:33:31 -0700733 public boolean setBottom(int bottom) {
734 return nSetBottom(mNativeRenderNode, bottom);
John Reckf666ad72014-03-14 16:24:57 -0700735 }
736
737 /**
John Reckf666ad72014-03-14 16:24:57 -0700738 * Sets the left and top positions for the display list
739 *
740 * @param left The left position of the display list, in pixels
741 * @param top The top position of the display list, in pixels
742 * @param right The right position of the display list, in pixels
743 * @param bottom The bottom position of the display list, in pixels
744 *
745 * @see View#setLeft(int)
746 * @see View#setTop(int)
747 * @see View#setRight(int)
748 * @see View#setBottom(int)
749 */
John Reck79c7de72014-05-23 10:33:31 -0700750 public boolean setLeftTopRightBottom(int left, int top, int right, int bottom) {
751 return nSetLeftTopRightBottom(mNativeRenderNode, left, top, right, bottom);
John Reckf666ad72014-03-14 16:24:57 -0700752 }
753
754 /**
755 * Offsets the left and right positions for the display list
756 *
757 * @param offset The amount that the left and right positions of the display
758 * list are offset, in pixels
759 *
760 * @see View#offsetLeftAndRight(int)
761 */
Chris Craika753f4c2014-07-24 12:39:17 -0700762 public boolean offsetLeftAndRight(int offset) {
John Reck79c7de72014-05-23 10:33:31 -0700763 return nOffsetLeftAndRight(mNativeRenderNode, offset);
John Reckf666ad72014-03-14 16:24:57 -0700764 }
765
766 /**
767 * Offsets the top and bottom values for the display list
768 *
769 * @param offset The amount that the top and bottom positions of the display
770 * list are offset, in pixels
771 *
772 * @see View#offsetTopAndBottom(int)
773 */
Chris Craika753f4c2014-07-24 12:39:17 -0700774 public boolean offsetTopAndBottom(int offset) {
John Reck79c7de72014-05-23 10:33:31 -0700775 return nOffsetTopAndBottom(mNativeRenderNode, offset);
John Reckf666ad72014-03-14 16:24:57 -0700776 }
777
778 /**
779 * Outputs the display list to the log. This method exists for use by
780 * tools to output display lists for selected nodes to the log.
John Reckf666ad72014-03-14 16:24:57 -0700781 */
782 public void output() {
John Reck8de65a82014-04-09 15:23:38 -0700783 nOutput(mNativeRenderNode);
John Reckf666ad72014-03-14 16:24:57 -0700784 }
785
John Reckfe5e7b72014-05-23 17:42:28 -0700786 /**
787 * Gets the size of the DisplayList for debug purposes.
788 */
789 public int getDebugSize() {
790 return nGetDebugSize(mNativeRenderNode);
791 }
792
John Reckf666ad72014-03-14 16:24:57 -0700793 ///////////////////////////////////////////////////////////////////////////
John Recke45b1fd2014-04-15 09:50:16 -0700794 // Animations
795 ///////////////////////////////////////////////////////////////////////////
796
797 public void addAnimator(RenderNodeAnimator animator) {
John Reck119907c2014-08-14 09:02:01 -0700798 if (mOwningView == null || mOwningView.mAttachInfo == null) {
799 throw new IllegalStateException("Cannot start this animator on a detached view!");
800 }
John Recke45b1fd2014-04-15 09:50:16 -0700801 nAddAnimator(mNativeRenderNode, animator.getNativeAnimator());
John Reck119907c2014-08-14 09:02:01 -0700802 mOwningView.mAttachInfo.mViewRootImpl.registerAnimatingRenderNode(this);
803 }
804
Doris Liu8b083202016-02-19 21:46:06 +0000805 public boolean isAttached() {
806 return mOwningView != null && mOwningView.mAttachInfo != null;
807 }
808
Doris Liu67ce99b2016-05-17 16:50:31 -0700809 public void registerVectorDrawableAnimator(
810 AnimatedVectorDrawable.VectorDrawableAnimatorRT animatorSet) {
Doris Liu766431a2016-02-04 22:17:11 +0000811 if (mOwningView == null || mOwningView.mAttachInfo == null) {
812 throw new IllegalStateException("Cannot start this animator on a detached view!");
813 }
Doris Liu67ce99b2016-05-17 16:50:31 -0700814 mOwningView.mAttachInfo.mViewRootImpl.registerVectorDrawableAnimator(animatorSet);
Doris Liu766431a2016-02-04 22:17:11 +0000815 }
816
John Reck119907c2014-08-14 09:02:01 -0700817 public void endAllAnimators() {
818 nEndAllAnimators(mNativeRenderNode);
John Recke45b1fd2014-04-15 09:50:16 -0700819 }
820
John Recke45b1fd2014-04-15 09:50:16 -0700821 ///////////////////////////////////////////////////////////////////////////
Chris Craikfc294242016-12-13 18:10:46 -0800822 // Regular JNI methods
John Reckf666ad72014-03-14 16:24:57 -0700823 ///////////////////////////////////////////////////////////////////////////
824
John Reck2de950d2017-01-25 10:58:30 -0800825 private static native long nCreate(String name);
John Reck44b49f02016-03-25 14:29:48 -0700826
John Reck395e9b82016-08-24 13:22:37 -0700827 private static native long nGetNativeFinalizer();
John Reck8de65a82014-04-09 15:23:38 -0700828 private static native void nOutput(long renderNode);
John Reckfe5e7b72014-05-23 17:42:28 -0700829 private static native int nGetDebugSize(long renderNode);
John Reckf6481082016-02-02 15:18:23 -0800830 private static native void nRequestPositionUpdates(long renderNode, SurfaceView callback);
831
John Recke45b1fd2014-04-15 09:50:16 -0700832 // Animations
John Recke45b1fd2014-04-15 09:50:16 -0700833
834 private static native void nAddAnimator(long renderNode, long animatorPtr);
John Reck119907c2014-08-14 09:02:01 -0700835 private static native void nEndAllAnimators(long renderNode);
John Recke45b1fd2014-04-15 09:50:16 -0700836
Chris Craikfc294242016-12-13 18:10:46 -0800837
John Recke45b1fd2014-04-15 09:50:16 -0700838 ///////////////////////////////////////////////////////////////////////////
Chris Craikfc294242016-12-13 18:10:46 -0800839 // @FastNative methods
840 ///////////////////////////////////////////////////////////////////////////
841
842 @FastNative
843 private static native void nSetDisplayList(long renderNode, long newData);
844
845
846 ///////////////////////////////////////////////////////////////////////////
847 // @CriticalNative methods
John Reckf666ad72014-03-14 16:24:57 -0700848 ///////////////////////////////////////////////////////////////////////////
849
John Reck2de950d2017-01-25 10:58:30 -0800850 @CriticalNative
851 private static native boolean nIsValid(long renderNode);
852
John Reck395e9b82016-08-24 13:22:37 -0700853 // Matrix
854
Chris Craikfc294242016-12-13 18:10:46 -0800855 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700856 private static native void nGetTransformMatrix(long renderNode, long nativeMatrix);
Chris Craikfc294242016-12-13 18:10:46 -0800857 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700858 private static native void nGetInverseTransformMatrix(long renderNode, long nativeMatrix);
Chris Craikfc294242016-12-13 18:10:46 -0800859 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700860 private static native boolean nHasIdentityMatrix(long renderNode);
861
862 // Properties
863
Chris Craikfc294242016-12-13 18:10:46 -0800864 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700865 private static native boolean nOffsetTopAndBottom(long renderNode, int offset);
Chris Craikfc294242016-12-13 18:10:46 -0800866 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700867 private static native boolean nOffsetLeftAndRight(long renderNode, int offset);
Chris Craikfc294242016-12-13 18:10:46 -0800868 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700869 private static native boolean nSetLeftTopRightBottom(long renderNode, int left, int top,
870 int right, int bottom);
Chris Craikfc294242016-12-13 18:10:46 -0800871 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700872 private static native boolean nSetBottom(long renderNode, int bottom);
Chris Craikfc294242016-12-13 18:10:46 -0800873 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700874 private static native boolean nSetRight(long renderNode, int right);
Chris Craikfc294242016-12-13 18:10:46 -0800875 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700876 private static native boolean nSetTop(long renderNode, int top);
Chris Craikfc294242016-12-13 18:10:46 -0800877 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700878 private static native boolean nSetLeft(long renderNode, int left);
Chris Craikfc294242016-12-13 18:10:46 -0800879 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700880 private static native boolean nSetCameraDistance(long renderNode, float distance);
Chris Craikfc294242016-12-13 18:10:46 -0800881 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700882 private static native boolean nSetPivotY(long renderNode, float pivotY);
Chris Craikfc294242016-12-13 18:10:46 -0800883 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700884 private static native boolean nSetPivotX(long renderNode, float pivotX);
Chris Craikfc294242016-12-13 18:10:46 -0800885 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700886 private static native boolean nSetLayerType(long renderNode, int layerType);
Chris Craikfc294242016-12-13 18:10:46 -0800887 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700888 private static native boolean nSetLayerPaint(long renderNode, long paint);
Chris Craikfc294242016-12-13 18:10:46 -0800889 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700890 private static native boolean nSetClipToBounds(long renderNode, boolean clipToBounds);
Chris Craikfc294242016-12-13 18:10:46 -0800891 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700892 private static native boolean nSetClipBounds(long renderNode, int left, int top,
893 int right, int bottom);
Chris Craikfc294242016-12-13 18:10:46 -0800894 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700895 private static native boolean nSetClipBoundsEmpty(long renderNode);
Chris Craikfc294242016-12-13 18:10:46 -0800896 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700897 private static native boolean nSetProjectBackwards(long renderNode, boolean shouldProject);
Chris Craikfc294242016-12-13 18:10:46 -0800898 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700899 private static native boolean nSetProjectionReceiver(long renderNode, boolean shouldRecieve);
Chris Craikfc294242016-12-13 18:10:46 -0800900 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700901 private static native boolean nSetOutlineRoundRect(long renderNode, int left, int top,
902 int right, int bottom, float radius, float alpha);
Chris Craikfc294242016-12-13 18:10:46 -0800903 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700904 private static native boolean nSetOutlineConvexPath(long renderNode, long nativePath,
905 float alpha);
Chris Craikfc294242016-12-13 18:10:46 -0800906 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700907 private static native boolean nSetOutlineEmpty(long renderNode);
Chris Craikfc294242016-12-13 18:10:46 -0800908 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700909 private static native boolean nSetOutlineNone(long renderNode);
Chris Craikfc294242016-12-13 18:10:46 -0800910 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700911 private static native boolean nHasShadow(long renderNode);
Chris Craikfc294242016-12-13 18:10:46 -0800912 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700913 private static native boolean nSetClipToOutline(long renderNode, boolean clipToOutline);
Chris Craikfc294242016-12-13 18:10:46 -0800914 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700915 private static native boolean nSetRevealClip(long renderNode,
916 boolean shouldClip, float x, float y, float radius);
Chris Craikfc294242016-12-13 18:10:46 -0800917 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700918 private static native boolean nSetAlpha(long renderNode, float alpha);
Chris Craikfc294242016-12-13 18:10:46 -0800919 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700920 private static native boolean nSetHasOverlappingRendering(long renderNode,
921 boolean hasOverlappingRendering);
Chris Craikfc294242016-12-13 18:10:46 -0800922 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700923 private static native boolean nSetElevation(long renderNode, float lift);
Chris Craikfc294242016-12-13 18:10:46 -0800924 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700925 private static native boolean nSetTranslationX(long renderNode, float translationX);
Chris Craikfc294242016-12-13 18:10:46 -0800926 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700927 private static native boolean nSetTranslationY(long renderNode, float translationY);
Chris Craikfc294242016-12-13 18:10:46 -0800928 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700929 private static native boolean nSetTranslationZ(long renderNode, float translationZ);
Chris Craikfc294242016-12-13 18:10:46 -0800930 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700931 private static native boolean nSetRotation(long renderNode, float rotation);
Chris Craikfc294242016-12-13 18:10:46 -0800932 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700933 private static native boolean nSetRotationX(long renderNode, float rotationX);
Chris Craikfc294242016-12-13 18:10:46 -0800934 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700935 private static native boolean nSetRotationY(long renderNode, float rotationY);
Chris Craikfc294242016-12-13 18:10:46 -0800936 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700937 private static native boolean nSetScaleX(long renderNode, float scaleX);
Chris Craikfc294242016-12-13 18:10:46 -0800938 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700939 private static native boolean nSetScaleY(long renderNode, float scaleY);
Chris Craikfc294242016-12-13 18:10:46 -0800940 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700941 private static native boolean nSetStaticMatrix(long renderNode, long nativeMatrix);
Chris Craikfc294242016-12-13 18:10:46 -0800942 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700943 private static native boolean nSetAnimationMatrix(long renderNode, long animationMatrix);
944
Chris Craikfc294242016-12-13 18:10:46 -0800945 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700946 private static native boolean nHasOverlappingRendering(long renderNode);
Chris Craikfc294242016-12-13 18:10:46 -0800947 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700948 private static native boolean nGetClipToOutline(long renderNode);
Chris Craikfc294242016-12-13 18:10:46 -0800949 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700950 private static native float nGetAlpha(long renderNode);
Chris Craikfc294242016-12-13 18:10:46 -0800951 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700952 private static native float nGetCameraDistance(long renderNode);
Chris Craikfc294242016-12-13 18:10:46 -0800953 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700954 private static native float nGetScaleX(long renderNode);
Chris Craikfc294242016-12-13 18:10:46 -0800955 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700956 private static native float nGetScaleY(long renderNode);
Chris Craikfc294242016-12-13 18:10:46 -0800957 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700958 private static native float nGetElevation(long renderNode);
Chris Craikfc294242016-12-13 18:10:46 -0800959 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700960 private static native float nGetTranslationX(long renderNode);
Chris Craikfc294242016-12-13 18:10:46 -0800961 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700962 private static native float nGetTranslationY(long renderNode);
Chris Craikfc294242016-12-13 18:10:46 -0800963 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700964 private static native float nGetTranslationZ(long renderNode);
Chris Craikfc294242016-12-13 18:10:46 -0800965 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700966 private static native float nGetRotation(long renderNode);
Chris Craikfc294242016-12-13 18:10:46 -0800967 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700968 private static native float nGetRotationX(long renderNode);
Chris Craikfc294242016-12-13 18:10:46 -0800969 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700970 private static native float nGetRotationY(long renderNode);
Chris Craikfc294242016-12-13 18:10:46 -0800971 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700972 private static native boolean nIsPivotExplicitlySet(long renderNode);
Chris Craikfc294242016-12-13 18:10:46 -0800973 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700974 private static native float nGetPivotX(long renderNode);
Chris Craikfc294242016-12-13 18:10:46 -0800975 @CriticalNative
John Reck395e9b82016-08-24 13:22:37 -0700976 private static native float nGetPivotY(long renderNode);
John Reckf666ad72014-03-14 16:24:57 -0700977}