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; |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 21 | import android.annotation.UnsupportedAppUsage; |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 22 | import android.graphics.Matrix; |
Chris Craik | b49f446 | 2014-03-20 12:44:20 -0700 | [diff] [blame] | 23 | import android.graphics.Outline; |
John Reck | 25fbb3f | 2014-06-12 13:46:45 -0700 | [diff] [blame] | 24 | import android.graphics.Paint; |
Chris Craik | a753f4c | 2014-07-24 12:39:17 -0700 | [diff] [blame] | 25 | import android.graphics.Rect; |
Doris Liu | 766431a | 2016-02-04 22:17:11 +0000 | [diff] [blame] | 26 | import android.graphics.drawable.AnimatedVectorDrawable; |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 27 | |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 28 | import dalvik.annotation.optimization.CriticalNative; |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 29 | import dalvik.annotation.optimization.FastNative; |
| 30 | |
John Reck | b99fff5 | 2016-11-16 15:21:57 -0800 | [diff] [blame] | 31 | import libcore.util.NativeAllocationRegistry; |
| 32 | |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 33 | /** |
| 34 | * <p>A display list records a series of graphics related operations and can replay |
| 35 | * them later. Display lists are usually built by recording operations on a |
Chris Craik | f6829a0 | 2015-03-10 10:28:59 -0700 | [diff] [blame] | 36 | * {@link DisplayListCanvas}. Replaying the operations from a display list avoids |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 37 | * executing application code on every frame, and is thus much more efficient.</p> |
| 38 | * |
| 39 | * <p>Display lists are used internally for all views by default, and are not |
| 40 | * typically used directly. One reason to consider using a display is a custom |
| 41 | * {@link View} implementation that needs to issue a large number of drawing commands. |
| 42 | * When the view invalidates, all the drawing commands must be reissued, even if |
| 43 | * large portions of the drawing command stream stay the same frame to frame, which |
| 44 | * can become a performance bottleneck. To solve this issue, a custom View might split |
| 45 | * its content into several display lists. A display list is updated only when its |
| 46 | * content, and only its content, needs to be updated.</p> |
| 47 | * |
| 48 | * <p>A text editor might for instance store each paragraph into its own display list. |
| 49 | * Thus when the user inserts or removes characters, only the display list of the |
| 50 | * affected paragraph needs to be recorded again.</p> |
| 51 | * |
| 52 | * <h3>Hardware acceleration</h3> |
Chris Craik | f6829a0 | 2015-03-10 10:28:59 -0700 | [diff] [blame] | 53 | * <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] | 54 | * supported in software. Always make sure that the {@link android.graphics.Canvas} |
| 55 | * you are using to render a display list is hardware accelerated using |
| 56 | * {@link android.graphics.Canvas#isHardwareAccelerated()}.</p> |
| 57 | * |
| 58 | * <h3>Creating a display list</h3> |
| 59 | * <pre class="prettyprint"> |
Stan Iliev | 45faba5 | 2016-06-28 13:33:15 -0400 | [diff] [blame] | 60 | * ThreadedRenderer renderer = myView.getThreadedRenderer(); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 61 | * if (renderer != null) { |
| 62 | * DisplayList displayList = renderer.createDisplayList(); |
Chris Craik | f6829a0 | 2015-03-10 10:28:59 -0700 | [diff] [blame] | 63 | * DisplayListCanvas canvas = displayList.start(width, height); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 64 | * try { |
| 65 | * // Draw onto the canvas |
| 66 | * // For instance: canvas.drawBitmap(...); |
| 67 | * } finally { |
| 68 | * displayList.end(); |
| 69 | * } |
| 70 | * } |
| 71 | * </pre> |
| 72 | * |
| 73 | * <h3>Rendering a display list on a View</h3> |
| 74 | * <pre class="prettyprint"> |
| 75 | * protected void onDraw(Canvas canvas) { |
| 76 | * if (canvas.isHardwareAccelerated()) { |
Chris Craik | f6829a0 | 2015-03-10 10:28:59 -0700 | [diff] [blame] | 77 | * DisplayListCanvas displayListCanvas = (DisplayListCanvas) canvas; |
| 78 | * displayListCanvas.drawDisplayList(mDisplayList); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 79 | * } |
| 80 | * } |
| 81 | * </pre> |
| 82 | * |
| 83 | * <h3>Releasing resources</h3> |
| 84 | * <p>This step is not mandatory but recommended if you want to release resources |
| 85 | * held by a display list as soon as possible.</p> |
| 86 | * <pre class="prettyprint"> |
| 87 | * // Mark this display list invalid, it cannot be used for drawing anymore, |
| 88 | * // and release resources held by this display list |
| 89 | * displayList.clear(); |
| 90 | * </pre> |
| 91 | * |
| 92 | * <h3>Properties</h3> |
| 93 | * <p>In addition, a display list offers several properties, such as |
| 94 | * {@link #setScaleX(float)} or {@link #setLeft(int)}, that can be used to affect all |
| 95 | * the drawing commands recorded within. For instance, these properties can be used |
| 96 | * to move around a large number of images without re-issuing all the individual |
| 97 | * <code>drawBitmap()</code> calls.</p> |
| 98 | * |
| 99 | * <pre class="prettyprint"> |
| 100 | * private void createDisplayList() { |
| 101 | * mDisplayList = DisplayList.create("MyDisplayList"); |
Chris Craik | f6829a0 | 2015-03-10 10:28:59 -0700 | [diff] [blame] | 102 | * DisplayListCanvas canvas = mDisplayList.start(width, height); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 103 | * try { |
| 104 | * for (Bitmap b : mBitmaps) { |
| 105 | * canvas.drawBitmap(b, 0.0f, 0.0f, null); |
| 106 | * canvas.translate(0.0f, b.getHeight()); |
| 107 | * } |
| 108 | * } finally { |
| 109 | * displayList.end(); |
| 110 | * } |
| 111 | * } |
| 112 | * |
| 113 | * protected void onDraw(Canvas canvas) { |
| 114 | * if (canvas.isHardwareAccelerated()) { |
Chris Craik | f6829a0 | 2015-03-10 10:28:59 -0700 | [diff] [blame] | 115 | * DisplayListCanvas displayListCanvas = (DisplayListCanvas) canvas; |
| 116 | * displayListCanvas.drawDisplayList(mDisplayList); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 117 | * } |
| 118 | * } |
| 119 | * |
| 120 | * private void moveContentBy(int x) { |
| 121 | * // This will move all the bitmaps recorded inside the display list |
| 122 | * // by x pixels to the right and redraw this view. All the commands |
| 123 | * // recorded in createDisplayList() won't be re-issued, only onDraw() |
| 124 | * // will be invoked and will execute very quickly |
| 125 | * mDisplayList.offsetLeftAndRight(x); |
| 126 | * invalidate(); |
| 127 | * } |
| 128 | * </pre> |
| 129 | * |
| 130 | * <h3>Threading</h3> |
| 131 | * <p>Display lists must be created on and manipulated from the UI thread only.</p> |
| 132 | * |
| 133 | * @hide |
| 134 | */ |
| 135 | public class RenderNode { |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 136 | |
John Reck | b99fff5 | 2016-11-16 15:21:57 -0800 | [diff] [blame] | 137 | // Use a Holder to allow static initialization in the boot image. |
| 138 | private static class NoImagePreloadHolder { |
| 139 | public static final NativeAllocationRegistry sRegistry = new NativeAllocationRegistry( |
| 140 | RenderNode.class.getClassLoader(), nGetNativeFinalizer(), 1024); |
| 141 | } |
| 142 | |
John Reck | 119907c | 2014-08-14 09:02:01 -0700 | [diff] [blame] | 143 | // Do not access directly unless you are ThreadedRenderer |
John Reck | b99fff5 | 2016-11-16 15:21:57 -0800 | [diff] [blame] | 144 | final long mNativeRenderNode; |
John Reck | 119907c | 2014-08-14 09:02:01 -0700 | [diff] [blame] | 145 | private final View mOwningView; |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 146 | |
John Reck | 119907c | 2014-08-14 09:02:01 -0700 | [diff] [blame] | 147 | private RenderNode(String name, View owningView) { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 148 | mNativeRenderNode = nCreate(name); |
John Reck | b99fff5 | 2016-11-16 15:21:57 -0800 | [diff] [blame] | 149 | NoImagePreloadHolder.sRegistry.registerNativeAllocation(this, mNativeRenderNode); |
John Reck | 119907c | 2014-08-14 09:02:01 -0700 | [diff] [blame] | 150 | mOwningView = owningView; |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 151 | } |
| 152 | |
| 153 | /** |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 154 | * @see RenderNode#adopt(long) |
| 155 | */ |
| 156 | private RenderNode(long nativePtr) { |
| 157 | mNativeRenderNode = nativePtr; |
John Reck | b99fff5 | 2016-11-16 15:21:57 -0800 | [diff] [blame] | 158 | NoImagePreloadHolder.sRegistry.registerNativeAllocation(this, mNativeRenderNode); |
John Reck | 119907c | 2014-08-14 09:02:01 -0700 | [diff] [blame] | 159 | mOwningView = null; |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 160 | } |
| 161 | |
| 162 | /** |
John Reck | 3acf0382 | 2016-11-02 11:14:47 -0700 | [diff] [blame] | 163 | * Immediately destroys the RenderNode |
| 164 | * Only suitable for testing/benchmarking where waiting for the GC/finalizer |
| 165 | * is not feasible. |
| 166 | */ |
| 167 | public void destroy() { |
John Reck | b99fff5 | 2016-11-16 15:21:57 -0800 | [diff] [blame] | 168 | // TODO: Removed temporarily |
John Reck | 3acf0382 | 2016-11-02 11:14:47 -0700 | [diff] [blame] | 169 | } |
| 170 | |
| 171 | /** |
Chris Craik | 9a347f1 | 2014-06-27 17:23:47 -0700 | [diff] [blame] | 172 | * Creates a new RenderNode that can be used to record batches of |
| 173 | * drawing operations, and store / apply render properties when drawn. |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 174 | * |
Chris Craik | 9a347f1 | 2014-06-27 17:23:47 -0700 | [diff] [blame] | 175 | * @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] | 176 | * |
Chris Craik | 9a347f1 | 2014-06-27 17:23:47 -0700 | [diff] [blame] | 177 | * @return A new RenderNode. |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 178 | */ |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 179 | @UnsupportedAppUsage |
John Reck | 119907c | 2014-08-14 09:02:01 -0700 | [diff] [blame] | 180 | public static RenderNode create(String name, @Nullable View owningView) { |
| 181 | return new RenderNode(name, owningView); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 182 | } |
| 183 | |
| 184 | /** |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 185 | * Adopts an existing native render node. |
| 186 | * |
| 187 | * Note: This will *NOT* incRef() on the native object, however it will |
| 188 | * decRef() when it is destroyed. The caller should have already incRef'd it |
| 189 | */ |
| 190 | public static RenderNode adopt(long nativePtr) { |
| 191 | return new RenderNode(nativePtr); |
| 192 | } |
| 193 | |
John Reck | 3acf0382 | 2016-11-02 11:14:47 -0700 | [diff] [blame] | 194 | /** |
| 195 | * Enable callbacks for position changes. |
| 196 | */ |
| 197 | public void requestPositionUpdates(SurfaceView view) { |
| 198 | nRequestPositionUpdates(mNativeRenderNode, view); |
| 199 | } |
| 200 | |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 201 | |
| 202 | /** |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 203 | * Starts recording a display list for the render node. All |
| 204 | * operations performed on the returned canvas are recorded and |
| 205 | * stored in this display list. |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 206 | * |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 207 | * Calling this method will mark the render node invalid until |
Chris Craik | f6829a0 | 2015-03-10 10:28:59 -0700 | [diff] [blame] | 208 | * {@link #end(DisplayListCanvas)} is called. |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 209 | * Only valid render nodes can be replayed. |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 210 | * |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 211 | * @param width The width of the recording viewport |
| 212 | * @param height The height of the recording viewport |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 213 | * |
| 214 | * @return A canvas to record drawing operations. |
| 215 | * |
Chris Craik | f6829a0 | 2015-03-10 10:28:59 -0700 | [diff] [blame] | 216 | * @see #end(DisplayListCanvas) |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 217 | * @see #isValid() |
| 218 | */ |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 219 | @UnsupportedAppUsage |
Chris Craik | f6829a0 | 2015-03-10 10:28:59 -0700 | [diff] [blame] | 220 | public DisplayListCanvas start(int width, int height) { |
Derek Sollenberger | cc882b6 | 2015-07-09 15:51:20 -0400 | [diff] [blame] | 221 | return DisplayListCanvas.obtain(this, width, height); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 222 | } |
| 223 | |
| 224 | /** |
| 225 | * Ends the recording for this display list. A display list cannot be |
| 226 | * replayed if recording is not finished. Calling this method marks |
| 227 | * the display list valid and {@link #isValid()} will return true. |
| 228 | * |
| 229 | * @see #start(int, int) |
| 230 | * @see #isValid() |
| 231 | */ |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 232 | @UnsupportedAppUsage |
Chris Craik | 3891f3a | 2015-04-02 15:28:08 -0700 | [diff] [blame] | 233 | public void end(DisplayListCanvas canvas) { |
Chris Craik | 003cc3d | 2015-10-16 10:24:55 -0700 | [diff] [blame] | 234 | long displayList = canvas.finishRecording(); |
| 235 | nSetDisplayList(mNativeRenderNode, displayList); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 236 | canvas.recycle(); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 237 | } |
| 238 | |
| 239 | /** |
| 240 | * Reset native resources. This is called when cleaning up the state of display lists |
| 241 | * during destruction of hardware resources, to ensure that we do not hold onto |
| 242 | * obsolete resources after related resources are gone. |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 243 | */ |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 244 | @UnsupportedAppUsage |
Chris Craik | 003cc3d | 2015-10-16 10:24:55 -0700 | [diff] [blame] | 245 | public void discardDisplayList() { |
Chris Craik | 003cc3d | 2015-10-16 10:24:55 -0700 | [diff] [blame] | 246 | nSetDisplayList(mNativeRenderNode, 0); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 247 | } |
| 248 | |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 249 | /** |
Chris Craik | df0c431 | 2014-03-28 16:55:08 -0700 | [diff] [blame] | 250 | * Returns whether the RenderNode's display list content is currently usable. |
| 251 | * 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] | 252 | * |
| 253 | * @return boolean true if the display list is able to be replayed, false otherwise. |
| 254 | */ |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 255 | @UnsupportedAppUsage |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 256 | public boolean isValid() { |
| 257 | return nIsValid(mNativeRenderNode); |
| 258 | } |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 259 | |
| 260 | long getNativeDisplayList() { |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 261 | if (!isValid()) { |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 262 | throw new IllegalStateException("The display list is not valid."); |
| 263 | } |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 264 | return mNativeRenderNode; |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 265 | } |
| 266 | |
| 267 | /////////////////////////////////////////////////////////////////////////// |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 268 | // Matrix manipulation |
| 269 | /////////////////////////////////////////////////////////////////////////// |
| 270 | |
| 271 | public boolean hasIdentityMatrix() { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 272 | return nHasIdentityMatrix(mNativeRenderNode); |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 273 | } |
| 274 | |
| 275 | public void getMatrix(@NonNull Matrix outMatrix) { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 276 | nGetTransformMatrix(mNativeRenderNode, outMatrix.native_instance); |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 277 | } |
| 278 | |
| 279 | public void getInverseMatrix(@NonNull Matrix outMatrix) { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 280 | nGetInverseTransformMatrix(mNativeRenderNode, outMatrix.native_instance); |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 281 | } |
| 282 | |
| 283 | /////////////////////////////////////////////////////////////////////////// |
| 284 | // RenderProperty Setters |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 285 | /////////////////////////////////////////////////////////////////////////// |
| 286 | |
John Reck | 25fbb3f | 2014-06-12 13:46:45 -0700 | [diff] [blame] | 287 | public boolean setLayerType(int layerType) { |
| 288 | return nSetLayerType(mNativeRenderNode, layerType); |
| 289 | } |
| 290 | |
sergeyv | 342a7e6 | 2016-03-24 16:06:46 -0700 | [diff] [blame] | 291 | public boolean setLayerPaint(@Nullable Paint paint) { |
Derek Sollenberger | dfba4d3 | 2014-09-02 15:42:54 -0400 | [diff] [blame] | 292 | return nSetLayerPaint(mNativeRenderNode, paint != null ? paint.getNativeInstance() : 0); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 293 | } |
| 294 | |
Chris Craik | a753f4c | 2014-07-24 12:39:17 -0700 | [diff] [blame] | 295 | public boolean setClipBounds(@Nullable Rect rect) { |
| 296 | if (rect == null) { |
| 297 | return nSetClipBoundsEmpty(mNativeRenderNode); |
| 298 | } else { |
| 299 | return nSetClipBounds(mNativeRenderNode, rect.left, rect.top, rect.right, rect.bottom); |
| 300 | } |
| 301 | } |
| 302 | |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 303 | /** |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 304 | * 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] | 305 | * the view's parent. |
| 306 | * |
| 307 | * @param clipToBounds true if the display list should clip to its bounds |
| 308 | */ |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 309 | @UnsupportedAppUsage |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 310 | public boolean setClipToBounds(boolean clipToBounds) { |
| 311 | return nSetClipToBounds(mNativeRenderNode, clipToBounds); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 312 | } |
| 313 | |
| 314 | /** |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 315 | * Sets whether the display list should be drawn immediately after the |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 316 | * closest ancestor display list containing a projection receiver. |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 317 | * |
| 318 | * @param shouldProject true if the display list should be projected onto a |
| 319 | * containing volume. |
| 320 | */ |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 321 | @UnsupportedAppUsage |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 322 | public boolean setProjectBackwards(boolean shouldProject) { |
| 323 | return nSetProjectBackwards(mNativeRenderNode, shouldProject); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 324 | } |
| 325 | |
| 326 | /** |
| 327 | * Sets whether the display list is a projection receiver - that its parent |
| 328 | * DisplayList should draw any descendent DisplayLists with |
| 329 | * ProjectBackwards=true directly on top of it. Default value is false. |
| 330 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 331 | public boolean setProjectionReceiver(boolean shouldRecieve) { |
| 332 | return nSetProjectionReceiver(mNativeRenderNode, shouldRecieve); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 333 | } |
| 334 | |
| 335 | /** |
| 336 | * Sets the outline, defining the shape that casts a shadow, and the path to |
| 337 | * be clipped if setClipToOutline is set. |
| 338 | * |
Chris Craik | b49f446 | 2014-03-20 12:44:20 -0700 | [diff] [blame] | 339 | * Deep copies the data into native to simplify reference ownership. |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 340 | */ |
Chris Craik | 136d1af | 2016-04-04 13:40:39 -0700 | [diff] [blame] | 341 | public boolean setOutline(@Nullable Outline outline) { |
Chris Craik | 0645128 | 2014-07-21 10:25:54 -0700 | [diff] [blame] | 342 | if (outline == null) { |
| 343 | return nSetOutlineNone(mNativeRenderNode); |
Chris Craik | b49f446 | 2014-03-20 12:44:20 -0700 | [diff] [blame] | 344 | } |
Chris Craik | 136d1af | 2016-04-04 13:40:39 -0700 | [diff] [blame] | 345 | |
| 346 | switch(outline.mMode) { |
| 347 | case Outline.MODE_EMPTY: |
| 348 | return nSetOutlineEmpty(mNativeRenderNode); |
| 349 | case Outline.MODE_ROUND_RECT: |
| 350 | return nSetOutlineRoundRect(mNativeRenderNode, outline.mRect.left, outline.mRect.top, |
| 351 | outline.mRect.right, outline.mRect.bottom, outline.mRadius, outline.mAlpha); |
| 352 | case Outline.MODE_CONVEX_PATH: |
| 353 | return nSetOutlineConvexPath(mNativeRenderNode, outline.mPath.mNativePath, |
| 354 | outline.mAlpha); |
| 355 | } |
| 356 | |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 357 | throw new IllegalArgumentException("Unrecognized outline?"); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 358 | } |
| 359 | |
Chris Craik | 5c75c52 | 2014-09-05 14:08:08 -0700 | [diff] [blame] | 360 | public boolean hasShadow() { |
| 361 | return nHasShadow(mNativeRenderNode); |
| 362 | } |
| 363 | |
John Reck | d8be4a0 | 2017-11-17 15:06:24 -0800 | [diff] [blame] | 364 | /** setSpotShadowColor */ |
| 365 | public boolean setSpotShadowColor(int color) { |
| 366 | return nSetSpotShadowColor(mNativeRenderNode, color); |
| 367 | } |
| 368 | |
| 369 | /** setAmbientShadowColor */ |
| 370 | public boolean setAmbientShadowColor(int color) { |
| 371 | return nSetAmbientShadowColor(mNativeRenderNode, color); |
| 372 | } |
| 373 | |
| 374 | /** getSpotShadowColor */ |
| 375 | public int getSpotShadowColor() { |
| 376 | return nGetSpotShadowColor(mNativeRenderNode); |
| 377 | } |
| 378 | |
| 379 | /** getAmbientShadowColor */ |
| 380 | public int getAmbientShadowColor() { |
| 381 | return nGetAmbientShadowColor(mNativeRenderNode); |
John Reck | 3c0369b | 2017-11-13 16:47:35 -0800 | [diff] [blame] | 382 | } |
| 383 | |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 384 | /** |
| 385 | * Enables or disables clipping to the outline. |
| 386 | * |
| 387 | * @param clipToOutline true if clipping to the outline. |
| 388 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 389 | public boolean setClipToOutline(boolean clipToOutline) { |
| 390 | return nSetClipToOutline(mNativeRenderNode, clipToOutline); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 391 | } |
| 392 | |
Chris Craik | deeda3d | 2014-05-05 19:09:33 -0700 | [diff] [blame] | 393 | public boolean getClipToOutline() { |
| 394 | return nGetClipToOutline(mNativeRenderNode); |
| 395 | } |
| 396 | |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 397 | /** |
Chris Craik | 8c271ca | 2014-03-25 10:33:01 -0700 | [diff] [blame] | 398 | * Controls the RenderNode's circular reveal clip. |
| 399 | */ |
Chris Craik | af4d04c | 2014-07-29 12:50:14 -0700 | [diff] [blame] | 400 | public boolean setRevealClip(boolean shouldClip, |
Chris Craik | 8c271ca | 2014-03-25 10:33:01 -0700 | [diff] [blame] | 401 | float x, float y, float radius) { |
Chris Craik | af4d04c | 2014-07-29 12:50:14 -0700 | [diff] [blame] | 402 | return nSetRevealClip(mNativeRenderNode, shouldClip, x, y, radius); |
Chris Craik | 8c271ca | 2014-03-25 10:33:01 -0700 | [diff] [blame] | 403 | } |
| 404 | |
| 405 | /** |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 406 | * Set the static matrix on the display list. The specified matrix is combined with other |
| 407 | * transforms (such as {@link #setScaleX(float)}, {@link #setRotation(float)}, etc.) |
| 408 | * |
| 409 | * @param matrix A transform matrix to apply to this display list |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 410 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 411 | public boolean setStaticMatrix(Matrix matrix) { |
| 412 | return nSetStaticMatrix(mNativeRenderNode, matrix.native_instance); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 413 | } |
| 414 | |
| 415 | /** |
| 416 | * Set the Animation matrix on the display list. This matrix exists if an Animation is |
| 417 | * currently playing on a View, and is set on the display list during at draw() time. When |
| 418 | * the Animation finishes, the matrix should be cleared by sending <code>null</code> |
| 419 | * for the matrix parameter. |
| 420 | * |
| 421 | * @param matrix The matrix, null indicates that the matrix should be cleared. |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 422 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 423 | public boolean setAnimationMatrix(Matrix matrix) { |
| 424 | return nSetAnimationMatrix(mNativeRenderNode, |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 425 | (matrix != null) ? matrix.native_instance : 0); |
| 426 | } |
| 427 | |
| 428 | /** |
| 429 | * Sets the translucency level for the display list. |
| 430 | * |
| 431 | * @param alpha The translucency of the display list, must be a value between 0.0f and 1.0f |
| 432 | * |
| 433 | * @see View#setAlpha(float) |
| 434 | * @see #getAlpha() |
| 435 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 436 | public boolean setAlpha(float alpha) { |
| 437 | return nSetAlpha(mNativeRenderNode, alpha); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 438 | } |
| 439 | |
| 440 | /** |
| 441 | * Returns the translucency level of this display list. |
| 442 | * |
| 443 | * @return A value between 0.0f and 1.0f |
| 444 | * |
| 445 | * @see #setAlpha(float) |
| 446 | */ |
| 447 | public float getAlpha() { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 448 | return nGetAlpha(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 449 | } |
| 450 | |
| 451 | /** |
| 452 | * Sets whether the display list renders content which overlaps. Non-overlapping rendering |
| 453 | * can use a fast path for alpha that avoids rendering to an offscreen buffer. By default |
| 454 | * display lists consider they do not have overlapping content. |
| 455 | * |
| 456 | * @param hasOverlappingRendering False if the content is guaranteed to be non-overlapping, |
| 457 | * true otherwise. |
| 458 | * |
| 459 | * @see android.view.View#hasOverlappingRendering() |
| 460 | * @see #hasOverlappingRendering() |
| 461 | */ |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 462 | @UnsupportedAppUsage |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 463 | public boolean setHasOverlappingRendering(boolean hasOverlappingRendering) { |
| 464 | return nSetHasOverlappingRendering(mNativeRenderNode, hasOverlappingRendering); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 465 | } |
| 466 | |
| 467 | /** |
| 468 | * Indicates whether the content of this display list overlaps. |
| 469 | * |
| 470 | * @return True if this display list renders content which overlaps, false otherwise. |
| 471 | * |
| 472 | * @see #setHasOverlappingRendering(boolean) |
| 473 | */ |
| 474 | public boolean hasOverlappingRendering() { |
| 475 | //noinspection SimplifiableIfStatement |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 476 | return nHasOverlappingRendering(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 477 | } |
| 478 | |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 479 | public boolean setElevation(float lift) { |
| 480 | return nSetElevation(mNativeRenderNode, lift); |
Chris Craik | cc39e16 | 2014-04-25 18:34:11 -0700 | [diff] [blame] | 481 | } |
| 482 | |
| 483 | public float getElevation() { |
| 484 | return nGetElevation(mNativeRenderNode); |
| 485 | } |
| 486 | |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 487 | /** |
| 488 | * Sets the translation value for the display list on the X axis. |
| 489 | * |
| 490 | * @param translationX The X axis translation value of the display list, in pixels |
| 491 | * |
| 492 | * @see View#setTranslationX(float) |
| 493 | * @see #getTranslationX() |
| 494 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 495 | public boolean setTranslationX(float translationX) { |
| 496 | return nSetTranslationX(mNativeRenderNode, translationX); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 497 | } |
| 498 | |
| 499 | /** |
| 500 | * Returns the translation value for this display list on the X axis, in pixels. |
| 501 | * |
| 502 | * @see #setTranslationX(float) |
| 503 | */ |
| 504 | public float getTranslationX() { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 505 | return nGetTranslationX(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 506 | } |
| 507 | |
| 508 | /** |
| 509 | * Sets the translation value for the display list on the Y axis. |
| 510 | * |
| 511 | * @param translationY The Y axis translation value of the display list, in pixels |
| 512 | * |
| 513 | * @see View#setTranslationY(float) |
| 514 | * @see #getTranslationY() |
| 515 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 516 | public boolean setTranslationY(float translationY) { |
| 517 | return nSetTranslationY(mNativeRenderNode, translationY); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 518 | } |
| 519 | |
| 520 | /** |
| 521 | * Returns the translation value for this display list on the Y axis, in pixels. |
| 522 | * |
| 523 | * @see #setTranslationY(float) |
| 524 | */ |
| 525 | public float getTranslationY() { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 526 | return nGetTranslationY(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 527 | } |
| 528 | |
| 529 | /** |
| 530 | * Sets the translation value for the display list on the Z axis. |
| 531 | * |
| 532 | * @see View#setTranslationZ(float) |
| 533 | * @see #getTranslationZ() |
| 534 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 535 | public boolean setTranslationZ(float translationZ) { |
| 536 | return nSetTranslationZ(mNativeRenderNode, translationZ); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 537 | } |
| 538 | |
| 539 | /** |
| 540 | * Returns the translation value for this display list on the Z axis. |
| 541 | * |
| 542 | * @see #setTranslationZ(float) |
| 543 | */ |
| 544 | public float getTranslationZ() { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 545 | return nGetTranslationZ(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 546 | } |
| 547 | |
| 548 | /** |
| 549 | * Sets the rotation value for the display list around the Z axis. |
| 550 | * |
| 551 | * @param rotation The rotation value of the display list, in degrees |
| 552 | * |
| 553 | * @see View#setRotation(float) |
| 554 | * @see #getRotation() |
| 555 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 556 | public boolean setRotation(float rotation) { |
| 557 | return nSetRotation(mNativeRenderNode, rotation); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 558 | } |
| 559 | |
| 560 | /** |
| 561 | * Returns the rotation value for this display list around the Z axis, in degrees. |
| 562 | * |
| 563 | * @see #setRotation(float) |
| 564 | */ |
| 565 | public float getRotation() { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 566 | return nGetRotation(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 567 | } |
| 568 | |
| 569 | /** |
| 570 | * Sets the rotation value for the display list around the X axis. |
| 571 | * |
| 572 | * @param rotationX The rotation value of the display list, in degrees |
| 573 | * |
| 574 | * @see View#setRotationX(float) |
| 575 | * @see #getRotationX() |
| 576 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 577 | public boolean setRotationX(float rotationX) { |
| 578 | return nSetRotationX(mNativeRenderNode, rotationX); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 579 | } |
| 580 | |
| 581 | /** |
| 582 | * Returns the rotation value for this display list around the X axis, in degrees. |
| 583 | * |
| 584 | * @see #setRotationX(float) |
| 585 | */ |
| 586 | public float getRotationX() { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 587 | return nGetRotationX(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 588 | } |
| 589 | |
| 590 | /** |
| 591 | * Sets the rotation value for the display list around the Y axis. |
| 592 | * |
| 593 | * @param rotationY The rotation value of the display list, in degrees |
| 594 | * |
| 595 | * @see View#setRotationY(float) |
| 596 | * @see #getRotationY() |
| 597 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 598 | public boolean setRotationY(float rotationY) { |
| 599 | return nSetRotationY(mNativeRenderNode, rotationY); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 600 | } |
| 601 | |
| 602 | /** |
| 603 | * Returns the rotation value for this display list around the Y axis, in degrees. |
| 604 | * |
| 605 | * @see #setRotationY(float) |
| 606 | */ |
| 607 | public float getRotationY() { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 608 | return nGetRotationY(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 609 | } |
| 610 | |
| 611 | /** |
| 612 | * Sets the scale value for the display list on the X axis. |
| 613 | * |
| 614 | * @param scaleX The scale value of the display list |
| 615 | * |
| 616 | * @see View#setScaleX(float) |
| 617 | * @see #getScaleX() |
| 618 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 619 | public boolean setScaleX(float scaleX) { |
| 620 | return nSetScaleX(mNativeRenderNode, scaleX); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 621 | } |
| 622 | |
| 623 | /** |
| 624 | * Returns the scale value for this display list on the X axis. |
| 625 | * |
| 626 | * @see #setScaleX(float) |
| 627 | */ |
| 628 | public float getScaleX() { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 629 | return nGetScaleX(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 630 | } |
| 631 | |
| 632 | /** |
| 633 | * Sets the scale value for the display list on the Y axis. |
| 634 | * |
| 635 | * @param scaleY The scale value of the display list |
| 636 | * |
| 637 | * @see View#setScaleY(float) |
| 638 | * @see #getScaleY() |
| 639 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 640 | public boolean setScaleY(float scaleY) { |
| 641 | return nSetScaleY(mNativeRenderNode, scaleY); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 642 | } |
| 643 | |
| 644 | /** |
| 645 | * Returns the scale value for this display list on the Y axis. |
| 646 | * |
| 647 | * @see #setScaleY(float) |
| 648 | */ |
| 649 | public float getScaleY() { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 650 | return nGetScaleY(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 651 | } |
| 652 | |
| 653 | /** |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 654 | * Sets the pivot value for the display list on the X axis |
| 655 | * |
| 656 | * @param pivotX The pivot value of the display list on the X axis, in pixels |
| 657 | * |
| 658 | * @see View#setPivotX(float) |
| 659 | * @see #getPivotX() |
| 660 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 661 | public boolean setPivotX(float pivotX) { |
| 662 | return nSetPivotX(mNativeRenderNode, pivotX); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 663 | } |
| 664 | |
| 665 | /** |
| 666 | * Returns the pivot value for this display list on the X axis, in pixels. |
| 667 | * |
| 668 | * @see #setPivotX(float) |
| 669 | */ |
| 670 | public float getPivotX() { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 671 | return nGetPivotX(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 672 | } |
| 673 | |
| 674 | /** |
| 675 | * Sets the pivot value for the display list on the Y axis |
| 676 | * |
| 677 | * @param pivotY The pivot value of the display list on the Y axis, in pixels |
| 678 | * |
| 679 | * @see View#setPivotY(float) |
| 680 | * @see #getPivotY() |
| 681 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 682 | public boolean setPivotY(float pivotY) { |
| 683 | return nSetPivotY(mNativeRenderNode, pivotY); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 684 | } |
| 685 | |
| 686 | /** |
| 687 | * Returns the pivot value for this display list on the Y axis, in pixels. |
| 688 | * |
| 689 | * @see #setPivotY(float) |
| 690 | */ |
| 691 | public float getPivotY() { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 692 | return nGetPivotY(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 693 | } |
| 694 | |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 695 | public boolean isPivotExplicitlySet() { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 696 | return nIsPivotExplicitlySet(mNativeRenderNode); |
Chris Craik | 49e6c73 | 2014-03-31 12:34:11 -0700 | [diff] [blame] | 697 | } |
| 698 | |
John Reck | 8686e1f | 2018-03-21 16:31:21 -0700 | [diff] [blame] | 699 | /** lint */ |
| 700 | public boolean resetPivot() { |
| 701 | return nResetPivot(mNativeRenderNode); |
| 702 | } |
| 703 | |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 704 | /** |
| 705 | * Sets the camera distance for the display list. Refer to |
| 706 | * {@link View#setCameraDistance(float)} for more information on how to |
| 707 | * use this property. |
| 708 | * |
| 709 | * @param distance The distance in Z of the camera of the display list |
| 710 | * |
| 711 | * @see View#setCameraDistance(float) |
| 712 | * @see #getCameraDistance() |
| 713 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 714 | public boolean setCameraDistance(float distance) { |
| 715 | return nSetCameraDistance(mNativeRenderNode, distance); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 716 | } |
| 717 | |
| 718 | /** |
| 719 | * Returns the distance in Z of the camera of the display list. |
| 720 | * |
| 721 | * @see #setCameraDistance(float) |
| 722 | */ |
| 723 | public float getCameraDistance() { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 724 | return nGetCameraDistance(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 725 | } |
| 726 | |
| 727 | /** |
| 728 | * Sets the left position for the display list. |
| 729 | * |
| 730 | * @param left The left position, in pixels, of the display list |
| 731 | * |
| 732 | * @see View#setLeft(int) |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 733 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 734 | public boolean setLeft(int left) { |
| 735 | return nSetLeft(mNativeRenderNode, left); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 736 | } |
| 737 | |
| 738 | /** |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 739 | * Sets the top position for the display list. |
| 740 | * |
| 741 | * @param top The top position, in pixels, of the display list |
| 742 | * |
| 743 | * @see View#setTop(int) |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 744 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 745 | public boolean setTop(int top) { |
| 746 | return nSetTop(mNativeRenderNode, top); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 747 | } |
| 748 | |
| 749 | /** |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 750 | * Sets the right position for the display list. |
| 751 | * |
| 752 | * @param right The right position, in pixels, of the display list |
| 753 | * |
| 754 | * @see View#setRight(int) |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 755 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 756 | public boolean setRight(int right) { |
| 757 | return nSetRight(mNativeRenderNode, right); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 758 | } |
| 759 | |
| 760 | /** |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 761 | * Sets the bottom position for the display list. |
| 762 | * |
| 763 | * @param bottom The bottom position, in pixels, of the display list |
| 764 | * |
| 765 | * @see View#setBottom(int) |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 766 | */ |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 767 | public boolean setBottom(int bottom) { |
| 768 | return nSetBottom(mNativeRenderNode, bottom); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 769 | } |
| 770 | |
| 771 | /** |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 772 | * Sets the left and top positions for the display list |
| 773 | * |
| 774 | * @param left The left position of the display list, in pixels |
| 775 | * @param top The top position of the display list, in pixels |
| 776 | * @param right The right position of the display list, in pixels |
| 777 | * @param bottom The bottom position of the display list, in pixels |
| 778 | * |
| 779 | * @see View#setLeft(int) |
| 780 | * @see View#setTop(int) |
| 781 | * @see View#setRight(int) |
| 782 | * @see View#setBottom(int) |
| 783 | */ |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 784 | @UnsupportedAppUsage |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 785 | public boolean setLeftTopRightBottom(int left, int top, int right, int bottom) { |
| 786 | return nSetLeftTopRightBottom(mNativeRenderNode, left, top, right, bottom); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 787 | } |
| 788 | |
| 789 | /** |
| 790 | * Offsets the left and right positions for the display list |
| 791 | * |
| 792 | * @param offset The amount that the left and right positions of the display |
| 793 | * list are offset, in pixels |
| 794 | * |
| 795 | * @see View#offsetLeftAndRight(int) |
| 796 | */ |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 797 | @UnsupportedAppUsage |
Chris Craik | a753f4c | 2014-07-24 12:39:17 -0700 | [diff] [blame] | 798 | public boolean offsetLeftAndRight(int offset) { |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 799 | return nOffsetLeftAndRight(mNativeRenderNode, offset); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 800 | } |
| 801 | |
| 802 | /** |
| 803 | * Offsets the top and bottom values for the display list |
| 804 | * |
| 805 | * @param offset The amount that the top and bottom positions of the display |
| 806 | * list are offset, in pixels |
| 807 | * |
| 808 | * @see View#offsetTopAndBottom(int) |
| 809 | */ |
Chris Craik | a753f4c | 2014-07-24 12:39:17 -0700 | [diff] [blame] | 810 | public boolean offsetTopAndBottom(int offset) { |
John Reck | 79c7de7 | 2014-05-23 10:33:31 -0700 | [diff] [blame] | 811 | return nOffsetTopAndBottom(mNativeRenderNode, offset); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 812 | } |
| 813 | |
| 814 | /** |
| 815 | * Outputs the display list to the log. This method exists for use by |
| 816 | * tools to output display lists for selected nodes to the log. |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 817 | */ |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 818 | @UnsupportedAppUsage |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 819 | public void output() { |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 820 | nOutput(mNativeRenderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 821 | } |
| 822 | |
John Reck | fe5e7b7 | 2014-05-23 17:42:28 -0700 | [diff] [blame] | 823 | /** |
| 824 | * Gets the size of the DisplayList for debug purposes. |
| 825 | */ |
| 826 | public int getDebugSize() { |
| 827 | return nGetDebugSize(mNativeRenderNode); |
| 828 | } |
| 829 | |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 830 | /////////////////////////////////////////////////////////////////////////// |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 831 | // Animations |
| 832 | /////////////////////////////////////////////////////////////////////////// |
| 833 | |
| 834 | public void addAnimator(RenderNodeAnimator animator) { |
John Reck | 119907c | 2014-08-14 09:02:01 -0700 | [diff] [blame] | 835 | if (mOwningView == null || mOwningView.mAttachInfo == null) { |
| 836 | throw new IllegalStateException("Cannot start this animator on a detached view!"); |
| 837 | } |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 838 | nAddAnimator(mNativeRenderNode, animator.getNativeAnimator()); |
John Reck | 119907c | 2014-08-14 09:02:01 -0700 | [diff] [blame] | 839 | mOwningView.mAttachInfo.mViewRootImpl.registerAnimatingRenderNode(this); |
| 840 | } |
| 841 | |
Doris Liu | 8b08320 | 2016-02-19 21:46:06 +0000 | [diff] [blame] | 842 | public boolean isAttached() { |
| 843 | return mOwningView != null && mOwningView.mAttachInfo != null; |
| 844 | } |
| 845 | |
Doris Liu | 67ce99b | 2016-05-17 16:50:31 -0700 | [diff] [blame] | 846 | public void registerVectorDrawableAnimator( |
| 847 | AnimatedVectorDrawable.VectorDrawableAnimatorRT animatorSet) { |
Doris Liu | 766431a | 2016-02-04 22:17:11 +0000 | [diff] [blame] | 848 | if (mOwningView == null || mOwningView.mAttachInfo == null) { |
| 849 | throw new IllegalStateException("Cannot start this animator on a detached view!"); |
| 850 | } |
Doris Liu | 67ce99b | 2016-05-17 16:50:31 -0700 | [diff] [blame] | 851 | mOwningView.mAttachInfo.mViewRootImpl.registerVectorDrawableAnimator(animatorSet); |
Doris Liu | 766431a | 2016-02-04 22:17:11 +0000 | [diff] [blame] | 852 | } |
| 853 | |
John Reck | 119907c | 2014-08-14 09:02:01 -0700 | [diff] [blame] | 854 | public void endAllAnimators() { |
| 855 | nEndAllAnimators(mNativeRenderNode); |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 856 | } |
| 857 | |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 858 | /////////////////////////////////////////////////////////////////////////// |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 859 | // Regular JNI methods |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 860 | /////////////////////////////////////////////////////////////////////////// |
| 861 | |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 862 | private static native long nCreate(String name); |
John Reck | 44b49f0 | 2016-03-25 14:29:48 -0700 | [diff] [blame] | 863 | |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 864 | private static native long nGetNativeFinalizer(); |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 865 | private static native void nOutput(long renderNode); |
John Reck | fe5e7b7 | 2014-05-23 17:42:28 -0700 | [diff] [blame] | 866 | private static native int nGetDebugSize(long renderNode); |
John Reck | f648108 | 2016-02-02 15:18:23 -0800 | [diff] [blame] | 867 | private static native void nRequestPositionUpdates(long renderNode, SurfaceView callback); |
| 868 | |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 869 | // Animations |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 870 | |
| 871 | private static native void nAddAnimator(long renderNode, long animatorPtr); |
John Reck | 119907c | 2014-08-14 09:02:01 -0700 | [diff] [blame] | 872 | private static native void nEndAllAnimators(long renderNode); |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 873 | |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 874 | |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 875 | /////////////////////////////////////////////////////////////////////////// |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 876 | // @FastNative methods |
| 877 | /////////////////////////////////////////////////////////////////////////// |
| 878 | |
| 879 | @FastNative |
| 880 | private static native void nSetDisplayList(long renderNode, long newData); |
| 881 | |
| 882 | |
| 883 | /////////////////////////////////////////////////////////////////////////// |
| 884 | // @CriticalNative methods |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 885 | /////////////////////////////////////////////////////////////////////////// |
| 886 | |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 887 | @CriticalNative |
| 888 | private static native boolean nIsValid(long renderNode); |
| 889 | |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 890 | // Matrix |
| 891 | |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 892 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 893 | private static native void nGetTransformMatrix(long renderNode, long nativeMatrix); |
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 void nGetInverseTransformMatrix(long renderNode, long nativeMatrix); |
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 nHasIdentityMatrix(long renderNode); |
| 898 | |
| 899 | // Properties |
| 900 | |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 901 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 902 | private static native boolean nOffsetTopAndBottom(long renderNode, int offset); |
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 nOffsetLeftAndRight(long renderNode, int offset); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 905 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 906 | private static native boolean nSetLeftTopRightBottom(long renderNode, int left, int top, |
| 907 | int right, int bottom); |
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 nSetBottom(long renderNode, int bottom); |
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 nSetRight(long renderNode, int right); |
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 nSetTop(long renderNode, int top); |
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 nSetLeft(long renderNode, int left); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 916 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 917 | private static native boolean nSetCameraDistance(long renderNode, float distance); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 918 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 919 | private static native boolean nSetPivotY(long renderNode, float pivotY); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 920 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 921 | private static native boolean nSetPivotX(long renderNode, float pivotX); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 922 | @CriticalNative |
John Reck | 8686e1f | 2018-03-21 16:31:21 -0700 | [diff] [blame] | 923 | private static native boolean nResetPivot(long renderNode); |
| 924 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 925 | private static native boolean nSetLayerType(long renderNode, int layerType); |
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 nSetLayerPaint(long renderNode, long paint); |
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 nSetClipToBounds(long renderNode, boolean clipToBounds); |
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 nSetClipBounds(long renderNode, int left, int top, |
| 932 | int right, int bottom); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 933 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 934 | private static native boolean nSetClipBoundsEmpty(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 935 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 936 | private static native boolean nSetProjectBackwards(long renderNode, boolean shouldProject); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 937 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 938 | private static native boolean nSetProjectionReceiver(long renderNode, boolean shouldRecieve); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 939 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 940 | private static native boolean nSetOutlineRoundRect(long renderNode, int left, int top, |
| 941 | int right, int bottom, float radius, float alpha); |
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 nSetOutlineConvexPath(long renderNode, long nativePath, |
| 944 | float alpha); |
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 nSetOutlineEmpty(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 nSetOutlineNone(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 boolean nHasShadow(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 951 | @CriticalNative |
John Reck | d8be4a0 | 2017-11-17 15:06:24 -0800 | [diff] [blame] | 952 | private static native boolean nSetSpotShadowColor(long renderNode, int color); |
| 953 | @CriticalNative |
| 954 | private static native boolean nSetAmbientShadowColor(long renderNode, int color); |
| 955 | @CriticalNative |
| 956 | private static native int nGetSpotShadowColor(long renderNode); |
| 957 | @CriticalNative |
| 958 | private static native int nGetAmbientShadowColor(long renderNode); |
John Reck | 3c0369b | 2017-11-13 16:47:35 -0800 | [diff] [blame] | 959 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 960 | private static native boolean nSetClipToOutline(long renderNode, boolean clipToOutline); |
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 boolean nSetRevealClip(long renderNode, |
| 963 | boolean shouldClip, float x, float y, float radius); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 964 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 965 | private static native boolean nSetAlpha(long renderNode, float alpha); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 966 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 967 | private static native boolean nSetHasOverlappingRendering(long renderNode, |
| 968 | boolean hasOverlappingRendering); |
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 boolean nSetElevation(long renderNode, float lift); |
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 nSetTranslationX(long renderNode, float translationX); |
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 boolean nSetTranslationY(long renderNode, float translationY); |
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 boolean nSetTranslationZ(long renderNode, float translationZ); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 977 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 978 | private static native boolean nSetRotation(long renderNode, float rotation); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 979 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 980 | private static native boolean nSetRotationX(long renderNode, float rotationX); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 981 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 982 | private static native boolean nSetRotationY(long renderNode, float rotationY); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 983 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 984 | private static native boolean nSetScaleX(long renderNode, float scaleX); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 985 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 986 | private static native boolean nSetScaleY(long renderNode, float scaleY); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 987 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 988 | private static native boolean nSetStaticMatrix(long renderNode, long nativeMatrix); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 989 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 990 | private static native boolean nSetAnimationMatrix(long renderNode, long animationMatrix); |
| 991 | |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 992 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 993 | private static native boolean nHasOverlappingRendering(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 994 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 995 | private static native boolean nGetClipToOutline(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 996 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 997 | private static native float nGetAlpha(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 998 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 999 | private static native float nGetCameraDistance(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 1000 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 1001 | private static native float nGetScaleX(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 1002 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 1003 | private static native float nGetScaleY(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 1004 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 1005 | private static native float nGetElevation(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 1006 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 1007 | private static native float nGetTranslationX(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 1008 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 1009 | private static native float nGetTranslationY(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 1010 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 1011 | private static native float nGetTranslationZ(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 1012 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 1013 | private static native float nGetRotation(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 1014 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 1015 | private static native float nGetRotationX(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 1016 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 1017 | private static native float nGetRotationY(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 1018 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 1019 | private static native boolean nIsPivotExplicitlySet(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 1020 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 1021 | private static native float nGetPivotX(long renderNode); |
Chris Craik | fc29424 | 2016-12-13 18:10:46 -0800 | [diff] [blame] | 1022 | @CriticalNative |
John Reck | 395e9b8 | 2016-08-24 13:22:37 -0700 | [diff] [blame] | 1023 | private static native float nGetPivotY(long renderNode); |
John Reck | f666ad7 | 2014-03-14 16:24:57 -0700 | [diff] [blame] | 1024 | } |