John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package android.view; |
| 18 | |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 19 | import android.annotation.NonNull; |
Chris Craik | a753f4c | 2014-07-24 12:39:17 -0700 | [diff] [blame] | 20 | import android.annotation.Nullable; |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 21 | import android.graphics.Matrix; |
Chris Craik | b49f446 | 2014-03-20 12:44:20 -0700 | [diff] [blame] | 22 | import android.graphics.Outline; |
John Reck | 25fbb3f | 2014-06-12 13:46:45 -0700 | [diff] [blame] | 23 | import android.graphics.Paint; |
Chris Craik | a753f4c | 2014-07-24 12:39:17 -0700 | [diff] [blame] | 24 | import android.graphics.Rect; |
Doris Liu | 766431a | 2016-02-04 22:17:11 +0000 | [diff] [blame] | 25 | import android.graphics.drawable.AnimatedVectorDrawable; |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 26 | |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 27 | import dalvik.annotation.optimization.CriticalNative; |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 28 | import dalvik.annotation.optimization.FastNative; |
| 29 | |
John Reck | b99fff5 | 2016-11-16 15:21:57 -0800 | [diff] [blame] | 30 | import libcore.util.NativeAllocationRegistry; |
| 31 | |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 32 | /** |
| 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 Craik | f6829a0 | 2015-03-10 10:28:59 -0700 | [diff] [blame] | 35 | * {@link DisplayListCanvas}. Replaying the operations from a display list avoids |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 36 | * 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 Craik | f6829a0 | 2015-03-10 10:28:59 -0700 | [diff] [blame] | 52 | * <p>Display lists can only be replayed using a {@link DisplayListCanvas}. They are not |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 53 | * 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 Iliev | 45faba5 | 2016-06-28 13:33:15 -0400 | [diff] [blame] | 59 | * ThreadedRenderer renderer = myView.getThreadedRenderer(); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 60 | * if (renderer != null) { |
| 61 | * DisplayList displayList = renderer.createDisplayList(); |
Chris Craik | f6829a0 | 2015-03-10 10:28:59 -0700 | [diff] [blame] | 62 | * DisplayListCanvas canvas = displayList.start(width, height); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 63 | * 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 Craik | f6829a0 | 2015-03-10 10:28:59 -0700 | [diff] [blame] | 76 | * DisplayListCanvas displayListCanvas = (DisplayListCanvas) canvas; |
| 77 | * displayListCanvas.drawDisplayList(mDisplayList); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 78 | * } |
| 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 Craik | f6829a0 | 2015-03-10 10:28:59 -0700 | [diff] [blame] | 101 | * DisplayListCanvas canvas = mDisplayList.start(width, height); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 102 | * 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 Craik | f6829a0 | 2015-03-10 10:28:59 -0700 | [diff] [blame] | 114 | * DisplayListCanvas displayListCanvas = (DisplayListCanvas) canvas; |
| 115 | * displayListCanvas.drawDisplayList(mDisplayList); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 116 | * } |
| 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 | */ |
| 134 | public class RenderNode { |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 135 | |
John Reck | b99fff5 | 2016-11-16 15:21:57 -0800 | [diff] [blame] | 136 | // 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 Reck | 119907c | 2014-08-14 09:02:01 -0700 | [diff] [blame] | 142 | // Do not access directly unless you are ThreadedRenderer |
John Reck | b99fff5 | 2016-11-16 15:21:57 -0800 | [diff] [blame] | 143 | final long mNativeRenderNode; |
John Reck | 119907c | 2014-08-14 09:02:01 -0700 | [diff] [blame] | 144 | private final View mOwningView; |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 145 | |
John Reck | 119907c | 2014-08-14 09:02:01 -0700 | [diff] [blame] | 146 | private RenderNode(String name, View owningView) { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 147 | mNativeRenderNode = nCreate(name); |
John Reck | b99fff5 | 2016-11-16 15:21:57 -0800 | [diff] [blame] | 148 | NoImagePreloadHolder.sRegistry.registerNativeAllocation(this, mNativeRenderNode); |
John Reck | 119907c | 2014-08-14 09:02:01 -0700 | [diff] [blame] | 149 | mOwningView = owningView; |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 150 | } |
| 151 | |
| 152 | /** |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 153 | * @see RenderNode#adopt(long) |
| 154 | */ |
| 155 | private RenderNode(long nativePtr) { |
| 156 | mNativeRenderNode = nativePtr; |
John Reck | b99fff5 | 2016-11-16 15:21:57 -0800 | [diff] [blame] | 157 | NoImagePreloadHolder.sRegistry.registerNativeAllocation(this, mNativeRenderNode); |
John Reck | 119907c | 2014-08-14 09:02:01 -0700 | [diff] [blame] | 158 | mOwningView = null; |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 159 | } |
| 160 | |
| 161 | /** |
John Reck | 3acf0382 | 2016-11-02 11:14:47 -0700 | [diff] [blame] | 162 | * 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 Reck | b99fff5 | 2016-11-16 15:21:57 -0800 | [diff] [blame] | 167 | // TODO: Removed temporarily |
John Reck | 3acf0382 | 2016-11-02 11:14:47 -0700 | [diff] [blame] | 168 | } |
| 169 | |
| 170 | /** |
Chris Craik | 9a347f1 | 2014-06-27 17:23:47 -0700 | [diff] [blame] | 171 | * Creates a new RenderNode that can be used to record batches of |
| 172 | * drawing operations, and store / apply render properties when drawn. |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 173 | * |
Chris Craik | 9a347f1 | 2014-06-27 17:23:47 -0700 | [diff] [blame] | 174 | * @param name The name of the RenderNode, used for debugging purpose. May be null. |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 175 | * |
Chris Craik | 9a347f1 | 2014-06-27 17:23:47 -0700 | [diff] [blame] | 176 | * @return A new RenderNode. |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 177 | */ |
John Reck | 119907c | 2014-08-14 09:02:01 -0700 | [diff] [blame] | 178 | public static RenderNode create(String name, @Nullable View owningView) { |
| 179 | return new RenderNode(name, owningView); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 180 | } |
| 181 | |
| 182 | /** |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 183 | * 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 Reck | 3acf0382 | 2016-11-02 11:14:47 -0700 | [diff] [blame] | 192 | /** |
| 193 | * Enable callbacks for position changes. |
| 194 | */ |
| 195 | public void requestPositionUpdates(SurfaceView view) { |
| 196 | nRequestPositionUpdates(mNativeRenderNode, view); |
| 197 | } |
| 198 | |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 199 | |
| 200 | /** |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 201 | * 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 Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 204 | * |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 205 | * Calling this method will mark the render node invalid until |
Chris Craik | f6829a0 | 2015-03-10 10:28:59 -0700 | [diff] [blame] | 206 | * {@link #end(DisplayListCanvas)} is called. |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 207 | * Only valid render nodes can be replayed. |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 208 | * |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 209 | * @param width The width of the recording viewport |
| 210 | * @param height The height of the recording viewport |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 211 | * |
| 212 | * @return A canvas to record drawing operations. |
| 213 | * |
Chris Craik | f6829a0 | 2015-03-10 10:28:59 -0700 | [diff] [blame] | 214 | * @see #end(DisplayListCanvas) |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 215 | * @see #isValid() |
| 216 | */ |
Chris Craik | f6829a0 | 2015-03-10 10:28:59 -0700 | [diff] [blame] | 217 | public DisplayListCanvas start(int width, int height) { |
Derek Sollenberger | cc882b6 | 2015-07-09 15:51:20 -0400 | [diff] [blame] | 218 | return DisplayListCanvas.obtain(this, width, height); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 219 | } |
| 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 Craik | 3891f3a | 2015-04-02 15:28:08 -0700 | [diff] [blame] | 229 | public void end(DisplayListCanvas canvas) { |
Chris Craik | 003cc3d | 2015-10-16 10:24:55 -0700 | [diff] [blame] | 230 | long displayList = canvas.finishRecording(); |
| 231 | nSetDisplayList(mNativeRenderNode, displayList); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 232 | canvas.recycle(); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 233 | } |
| 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 Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 239 | */ |
Chris Craik | 003cc3d | 2015-10-16 10:24:55 -0700 | [diff] [blame] | 240 | public void discardDisplayList() { |
Chris Craik | 003cc3d | 2015-10-16 10:24:55 -0700 | [diff] [blame] | 241 | nSetDisplayList(mNativeRenderNode, 0); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 242 | } |
| 243 | |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 244 | /** |
Chris Craik | df0c431 | 2014-03-28 16:55:08 -0700 | [diff] [blame] | 245 | * 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 Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 247 | * |
| 248 | * @return boolean true if the display list is able to be replayed, false otherwise. |
| 249 | */ |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 250 | public boolean isValid() { |
| 251 | return nIsValid(mNativeRenderNode); |
| 252 | } |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 253 | |
| 254 | long getNativeDisplayList() { |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 255 | if (!isValid()) { |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 256 | throw new IllegalStateException("The display list is not valid."); |
| 257 | } |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 258 | return mNativeRenderNode; |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 259 | } |
| 260 | |
| 261 | /////////////////////////////////////////////////////////////////////////// |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 262 | // Matrix manipulation |
| 263 | /////////////////////////////////////////////////////////////////////////// |
| 264 | |
| 265 | public boolean hasIdentityMatrix() { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 266 | return nHasIdentityMatrix(mNativeRenderNode); |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 267 | } |
| 268 | |
| 269 | public void getMatrix(@NonNull Matrix outMatrix) { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 270 | nGetTransformMatrix(mNativeRenderNode, outMatrix.native_instance); |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 271 | } |
| 272 | |
| 273 | public void getInverseMatrix(@NonNull Matrix outMatrix) { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 274 | nGetInverseTransformMatrix(mNativeRenderNode, outMatrix.native_instance); |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 275 | } |
| 276 | |
| 277 | /////////////////////////////////////////////////////////////////////////// |
| 278 | // RenderProperty Setters |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 279 | /////////////////////////////////////////////////////////////////////////// |
| 280 | |
John Reck | 25fbb3f | 2014-06-12 13:46:45 -0700 | [diff] [blame] | 281 | public boolean setLayerType(int layerType) { |
| 282 | return nSetLayerType(mNativeRenderNode, layerType); |
| 283 | } |
| 284 | |
sergeyv | 342a7e6 | 2016-03-24 16:06:46 -0700 | [diff] [blame] | 285 | public boolean setLayerPaint(@Nullable Paint paint) { |
Derek Sollenberger | dfba4d3 | 2014-09-02 15:42:54 -0400 | [diff] [blame] | 286 | return nSetLayerPaint(mNativeRenderNode, paint != null ? paint.getNativeInstance() : 0); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 287 | } |
| 288 | |
Chris Craik | a753f4c | 2014-07-24 12:39:17 -0700 | [diff] [blame] | 289 | 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 Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 297 | /** |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 298 | * Set whether the Render node should clip itself to its bounds. This property is controlled by |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 299 | * the view's parent. |
| 300 | * |
| 301 | * @param clipToBounds true if the display list should clip to its bounds |
| 302 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 303 | public boolean setClipToBounds(boolean clipToBounds) { |
| 304 | return nSetClipToBounds(mNativeRenderNode, clipToBounds); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 305 | } |
| 306 | |
| 307 | /** |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 308 | * Sets whether the display list should be drawn immediately after the |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 309 | * closest ancestor display list containing a projection receiver. |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 310 | * |
| 311 | * @param shouldProject true if the display list should be projected onto a |
| 312 | * containing volume. |
| 313 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 314 | public boolean setProjectBackwards(boolean shouldProject) { |
| 315 | return nSetProjectBackwards(mNativeRenderNode, shouldProject); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 316 | } |
| 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 Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 323 | public boolean setProjectionReceiver(boolean shouldRecieve) { |
| 324 | return nSetProjectionReceiver(mNativeRenderNode, shouldRecieve); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 325 | } |
| 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 Craik | b49f446 | 2014-03-20 12:44:20 -0700 | [diff] [blame] | 331 | * Deep copies the data into native to simplify reference ownership. |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 332 | */ |
Chris Craik | 136d1af | 2016-04-04 13:40:39 -0700 | [diff] [blame] | 333 | public boolean setOutline(@Nullable Outline outline) { |
Chris Craik | 0645128 | 2014-07-21 10:25:54 -0700 | [diff] [blame] | 334 | if (outline == null) { |
| 335 | return nSetOutlineNone(mNativeRenderNode); |
Chris Craik | b49f446 | 2014-03-20 12:44:20 -0700 | [diff] [blame] | 336 | } |
Chris Craik | 136d1af | 2016-04-04 13:40:39 -0700 | [diff] [blame] | 337 | |
| 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 Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 349 | throw new IllegalArgumentException("Unrecognized outline?"); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 350 | } |
| 351 | |
Chris Craik | 5c75c52 | 2014-09-05 14:08:08 -0700 | [diff] [blame] | 352 | public boolean hasShadow() { |
| 353 | return nHasShadow(mNativeRenderNode); |
| 354 | } |
| 355 | |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 356 | /** |
| 357 | * Enables or disables clipping to the outline. |
| 358 | * |
| 359 | * @param clipToOutline true if clipping to the outline. |
| 360 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 361 | public boolean setClipToOutline(boolean clipToOutline) { |
| 362 | return nSetClipToOutline(mNativeRenderNode, clipToOutline); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 363 | } |
| 364 | |
Chris Craik | deeda3d | 2014-05-05 19:09:33 -0700 | [diff] [blame] | 365 | public boolean getClipToOutline() { |
| 366 | return nGetClipToOutline(mNativeRenderNode); |
| 367 | } |
| 368 | |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 369 | /** |
Chris Craik | 8c271ca | 2014-03-25 10:33:01 -0700 | [diff] [blame] | 370 | * Controls the RenderNode's circular reveal clip. |
| 371 | */ |
Chris Craik | af4d04c | 2014-07-29 12:50:14 -0700 | [diff] [blame] | 372 | public boolean setRevealClip(boolean shouldClip, |
Chris Craik | 8c271ca | 2014-03-25 10:33:01 -0700 | [diff] [blame] | 373 | float x, float y, float radius) { |
Chris Craik | af4d04c | 2014-07-29 12:50:14 -0700 | [diff] [blame] | 374 | return nSetRevealClip(mNativeRenderNode, shouldClip, x, y, radius); |
Chris Craik | 8c271ca | 2014-03-25 10:33:01 -0700 | [diff] [blame] | 375 | } |
| 376 | |
| 377 | /** |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 378 | * 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 Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 382 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 383 | public boolean setStaticMatrix(Matrix matrix) { |
| 384 | return nSetStaticMatrix(mNativeRenderNode, matrix.native_instance); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 385 | } |
| 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 Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 394 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 395 | public boolean setAnimationMatrix(Matrix matrix) { |
| 396 | return nSetAnimationMatrix(mNativeRenderNode, |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 397 | (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 Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 408 | public boolean setAlpha(float alpha) { |
| 409 | return nSetAlpha(mNativeRenderNode, alpha); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 410 | } |
| 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 Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 420 | return nGetAlpha(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 421 | } |
| 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 Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 434 | public boolean setHasOverlappingRendering(boolean hasOverlappingRendering) { |
| 435 | return nSetHasOverlappingRendering(mNativeRenderNode, hasOverlappingRendering); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 436 | } |
| 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 Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 447 | return nHasOverlappingRendering(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 448 | } |
| 449 | |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 450 | public boolean setElevation(float lift) { |
| 451 | return nSetElevation(mNativeRenderNode, lift); |
Chris Craik | cc39e16 | 2014-04-25 18:34:11 -0700 | [diff] [blame] | 452 | } |
| 453 | |
| 454 | public float getElevation() { |
| 455 | return nGetElevation(mNativeRenderNode); |
| 456 | } |
| 457 | |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 458 | /** |
| 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 Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 466 | public boolean setTranslationX(float translationX) { |
| 467 | return nSetTranslationX(mNativeRenderNode, translationX); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 468 | } |
| 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 Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 476 | return nGetTranslationX(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 477 | } |
| 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 Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 487 | public boolean setTranslationY(float translationY) { |
| 488 | return nSetTranslationY(mNativeRenderNode, translationY); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 489 | } |
| 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 Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 497 | return nGetTranslationY(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 498 | } |
| 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 Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 506 | public boolean setTranslationZ(float translationZ) { |
| 507 | return nSetTranslationZ(mNativeRenderNode, translationZ); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 508 | } |
| 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 Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 516 | return nGetTranslationZ(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 517 | } |
| 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 Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 527 | public boolean setRotation(float rotation) { |
| 528 | return nSetRotation(mNativeRenderNode, rotation); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 529 | } |
| 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 Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 537 | return nGetRotation(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 538 | } |
| 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 Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 548 | public boolean setRotationX(float rotationX) { |
| 549 | return nSetRotationX(mNativeRenderNode, rotationX); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 550 | } |
| 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 Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 558 | return nGetRotationX(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 559 | } |
| 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 Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 569 | public boolean setRotationY(float rotationY) { |
| 570 | return nSetRotationY(mNativeRenderNode, rotationY); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 571 | } |
| 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 Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 579 | return nGetRotationY(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 580 | } |
| 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 Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 590 | public boolean setScaleX(float scaleX) { |
| 591 | return nSetScaleX(mNativeRenderNode, scaleX); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 592 | } |
| 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 Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 600 | return nGetScaleX(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 601 | } |
| 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 Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 611 | public boolean setScaleY(float scaleY) { |
| 612 | return nSetScaleY(mNativeRenderNode, scaleY); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 613 | } |
| 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 Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 621 | return nGetScaleY(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 622 | } |
| 623 | |
| 624 | /** |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 625 | * 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 Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 632 | public boolean setPivotX(float pivotX) { |
| 633 | return nSetPivotX(mNativeRenderNode, pivotX); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 634 | } |
| 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 Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 642 | return nGetPivotX(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 643 | } |
| 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 Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 653 | public boolean setPivotY(float pivotY) { |
| 654 | return nSetPivotY(mNativeRenderNode, pivotY); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 655 | } |
| 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 Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 663 | return nGetPivotY(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 664 | } |
| 665 | |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 666 | public boolean isPivotExplicitlySet() { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 667 | return nIsPivotExplicitlySet(mNativeRenderNode); |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 668 | } |
| 669 | |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 670 | /** |
| 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 Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 680 | public boolean setCameraDistance(float distance) { |
| 681 | return nSetCameraDistance(mNativeRenderNode, distance); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 682 | } |
| 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 Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 690 | return nGetCameraDistance(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 691 | } |
| 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 Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 699 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 700 | public boolean setLeft(int left) { |
| 701 | return nSetLeft(mNativeRenderNode, left); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 702 | } |
| 703 | |
| 704 | /** |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 705 | * 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 Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 710 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 711 | public boolean setTop(int top) { |
| 712 | return nSetTop(mNativeRenderNode, top); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 713 | } |
| 714 | |
| 715 | /** |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 716 | * 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 Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 721 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 722 | public boolean setRight(int right) { |
| 723 | return nSetRight(mNativeRenderNode, right); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 724 | } |
| 725 | |
| 726 | /** |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 727 | * 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 Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 732 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 733 | public boolean setBottom(int bottom) { |
| 734 | return nSetBottom(mNativeRenderNode, bottom); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 735 | } |
| 736 | |
| 737 | /** |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 738 | * 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 Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 750 | public boolean setLeftTopRightBottom(int left, int top, int right, int bottom) { |
| 751 | return nSetLeftTopRightBottom(mNativeRenderNode, left, top, right, bottom); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 752 | } |
| 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 Craik | a753f4c | 2014-07-24 12:39:17 -0700 | [diff] [blame] | 762 | public boolean offsetLeftAndRight(int offset) { |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 763 | return nOffsetLeftAndRight(mNativeRenderNode, offset); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 764 | } |
| 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 Craik | a753f4c | 2014-07-24 12:39:17 -0700 | [diff] [blame] | 774 | public boolean offsetTopAndBottom(int offset) { |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 775 | return nOffsetTopAndBottom(mNativeRenderNode, offset); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 776 | } |
| 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 Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 781 | */ |
| 782 | public void output() { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 783 | nOutput(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 784 | } |
| 785 | |
John Reck | fe5e7b7 | 2014-05-23 17:42:28 -0700 | [diff] [blame] | 786 | /** |
| 787 | * Gets the size of the DisplayList for debug purposes. |
| 788 | */ |
| 789 | public int getDebugSize() { |
| 790 | return nGetDebugSize(mNativeRenderNode); |
| 791 | } |
| 792 | |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 793 | /////////////////////////////////////////////////////////////////////////// |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 794 | // Animations |
| 795 | /////////////////////////////////////////////////////////////////////////// |
| 796 | |
| 797 | public void addAnimator(RenderNodeAnimator animator) { |
John Reck | 119907c | 2014-08-14 09:02:01 -0700 | [diff] [blame] | 798 | if (mOwningView == null || mOwningView.mAttachInfo == null) { |
| 799 | throw new IllegalStateException("Cannot start this animator on a detached view!"); |
| 800 | } |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 801 | nAddAnimator(mNativeRenderNode, animator.getNativeAnimator()); |
John Reck | 119907c | 2014-08-14 09:02:01 -0700 | [diff] [blame] | 802 | mOwningView.mAttachInfo.mViewRootImpl.registerAnimatingRenderNode(this); |
| 803 | } |
| 804 | |
Doris Liu | 8b08320 | 2016-02-19 21:46:06 +0000 | [diff] [blame] | 805 | public boolean isAttached() { |
| 806 | return mOwningView != null && mOwningView.mAttachInfo != null; |
| 807 | } |
| 808 | |
Doris Liu | 67ce99b | 2016-05-17 16:50:31 -0700 | [diff] [blame] | 809 | public void registerVectorDrawableAnimator( |
| 810 | AnimatedVectorDrawable.VectorDrawableAnimatorRT animatorSet) { |
Doris Liu | 766431a | 2016-02-04 22:17:11 +0000 | [diff] [blame] | 811 | if (mOwningView == null || mOwningView.mAttachInfo == null) { |
| 812 | throw new IllegalStateException("Cannot start this animator on a detached view!"); |
| 813 | } |
Doris Liu | 67ce99b | 2016-05-17 16:50:31 -0700 | [diff] [blame] | 814 | mOwningView.mAttachInfo.mViewRootImpl.registerVectorDrawableAnimator(animatorSet); |
Doris Liu | 766431a | 2016-02-04 22:17:11 +0000 | [diff] [blame] | 815 | } |
| 816 | |
John Reck | 119907c | 2014-08-14 09:02:01 -0700 | [diff] [blame] | 817 | public void endAllAnimators() { |
| 818 | nEndAllAnimators(mNativeRenderNode); |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 819 | } |
| 820 | |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 821 | /////////////////////////////////////////////////////////////////////////// |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 822 | // Regular JNI methods |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 823 | /////////////////////////////////////////////////////////////////////////// |
| 824 | |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 825 | private static native long nCreate(String name); |
John Reck | 44b49f0 | 2016-03-25 14:29:48 -0700 | [diff] [blame] | 826 | |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 827 | private static native long nGetNativeFinalizer(); |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 828 | private static native void nOutput(long renderNode); |
John Reck | fe5e7b7 | 2014-05-23 17:42:28 -0700 | [diff] [blame] | 829 | private static native int nGetDebugSize(long renderNode); |
John Reck | f648108 | 2016-02-02 15:18:23 -0800 | [diff] [blame] | 830 | private static native void nRequestPositionUpdates(long renderNode, SurfaceView callback); |
| 831 | |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 832 | // Animations |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 833 | |
| 834 | private static native void nAddAnimator(long renderNode, long animatorPtr); |
John Reck | 119907c | 2014-08-14 09:02:01 -0700 | [diff] [blame] | 835 | private static native void nEndAllAnimators(long renderNode); |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 836 | |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 837 | |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 838 | /////////////////////////////////////////////////////////////////////////// |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 839 | // @FastNative methods |
| 840 | /////////////////////////////////////////////////////////////////////////// |
| 841 | |
| 842 | @FastNative |
| 843 | private static native void nSetDisplayList(long renderNode, long newData); |
| 844 | |
| 845 | |
| 846 | /////////////////////////////////////////////////////////////////////////// |
| 847 | // @CriticalNative methods |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 848 | /////////////////////////////////////////////////////////////////////////// |
| 849 | |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 850 | @CriticalNative |
| 851 | private static native boolean nIsValid(long renderNode); |
| 852 | |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 853 | // Matrix |
| 854 | |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 855 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 856 | private static native void nGetTransformMatrix(long renderNode, long nativeMatrix); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 857 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 858 | private static native void nGetInverseTransformMatrix(long renderNode, long nativeMatrix); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 859 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 860 | private static native boolean nHasIdentityMatrix(long renderNode); |
| 861 | |
| 862 | // Properties |
| 863 | |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 864 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 865 | private static native boolean nOffsetTopAndBottom(long renderNode, int offset); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 866 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 867 | private static native boolean nOffsetLeftAndRight(long renderNode, int offset); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 868 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 869 | private static native boolean nSetLeftTopRightBottom(long renderNode, int left, int top, |
| 870 | int right, int bottom); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 871 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 872 | private static native boolean nSetBottom(long renderNode, int bottom); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 873 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 874 | private static native boolean nSetRight(long renderNode, int right); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 875 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 876 | private static native boolean nSetTop(long renderNode, int top); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 877 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 878 | private static native boolean nSetLeft(long renderNode, int left); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 879 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 880 | private static native boolean nSetCameraDistance(long renderNode, float distance); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 881 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 882 | private static native boolean nSetPivotY(long renderNode, float pivotY); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 883 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 884 | private static native boolean nSetPivotX(long renderNode, float pivotX); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 885 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 886 | private static native boolean nSetLayerType(long renderNode, int layerType); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 887 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 888 | private static native boolean nSetLayerPaint(long renderNode, long paint); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 889 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 890 | private static native boolean nSetClipToBounds(long renderNode, boolean clipToBounds); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 891 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 892 | private static native boolean nSetClipBounds(long renderNode, int left, int top, |
| 893 | int right, int bottom); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 894 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 895 | private static native boolean nSetClipBoundsEmpty(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 896 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 897 | private static native boolean nSetProjectBackwards(long renderNode, boolean shouldProject); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 898 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 899 | private static native boolean nSetProjectionReceiver(long renderNode, boolean shouldRecieve); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 900 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 901 | private static native boolean nSetOutlineRoundRect(long renderNode, int left, int top, |
| 902 | int right, int bottom, float radius, float alpha); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 903 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 904 | private static native boolean nSetOutlineConvexPath(long renderNode, long nativePath, |
| 905 | float alpha); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 906 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 907 | private static native boolean nSetOutlineEmpty(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 908 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 909 | private static native boolean nSetOutlineNone(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 910 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 911 | private static native boolean nHasShadow(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 912 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 913 | private static native boolean nSetClipToOutline(long renderNode, boolean clipToOutline); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 914 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 915 | private static native boolean nSetRevealClip(long renderNode, |
| 916 | boolean shouldClip, float x, float y, float radius); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 917 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 918 | private static native boolean nSetAlpha(long renderNode, float alpha); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 919 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 920 | private static native boolean nSetHasOverlappingRendering(long renderNode, |
| 921 | boolean hasOverlappingRendering); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 922 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 923 | private static native boolean nSetElevation(long renderNode, float lift); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 924 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 925 | private static native boolean nSetTranslationX(long renderNode, float translationX); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 926 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 927 | private static native boolean nSetTranslationY(long renderNode, float translationY); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 928 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 929 | private static native boolean nSetTranslationZ(long renderNode, float translationZ); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 930 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 931 | private static native boolean nSetRotation(long renderNode, float rotation); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 932 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 933 | private static native boolean nSetRotationX(long renderNode, float rotationX); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 934 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 935 | private static native boolean nSetRotationY(long renderNode, float rotationY); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 936 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 937 | private static native boolean nSetScaleX(long renderNode, float scaleX); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 938 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 939 | private static native boolean nSetScaleY(long renderNode, float scaleY); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 940 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 941 | private static native boolean nSetStaticMatrix(long renderNode, long nativeMatrix); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 942 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 943 | private static native boolean nSetAnimationMatrix(long renderNode, long animationMatrix); |
| 944 | |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 945 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 946 | private static native boolean nHasOverlappingRendering(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 947 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 948 | private static native boolean nGetClipToOutline(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 949 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 950 | private static native float nGetAlpha(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 951 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 952 | private static native float nGetCameraDistance(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 953 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 954 | private static native float nGetScaleX(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 955 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 956 | private static native float nGetScaleY(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 957 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 958 | private static native float nGetElevation(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 959 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 960 | private static native float nGetTranslationX(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 961 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 962 | private static native float nGetTranslationY(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 963 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 964 | private static native float nGetTranslationZ(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 965 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 966 | private static native float nGetRotation(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 967 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 968 | private static native float nGetRotationX(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 969 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 970 | private static native float nGetRotationY(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 971 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 972 | private static native boolean nIsPivotExplicitlySet(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 973 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 974 | private static native float nGetPivotX(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 975 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 976 | private static native float nGetPivotY(long renderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 977 | } |