Jason Sams | 49a05d7 | 2010-12-29 14:31:29 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 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.renderscript; |
| 18 | |
Stephen Hines | 9c9ad3f8c2 | 2012-05-07 15:34:29 -0700 | [diff] [blame] | 19 | /** |
Tim Murray | c11e25c | 2013-04-09 11:01:01 -0700 | [diff] [blame] | 20 | * Only intended for use by generated reflected code. |
Jason Sams | 49a05d7 | 2010-12-29 14:31:29 -0800 | [diff] [blame] | 21 | * |
Xusong Wang | 8b4548c | 2021-01-05 10:09:52 -0800 | [diff] [blame] | 22 | * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a |
| 23 | * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration |
| 24 | * guide</a> for the proposed alternatives. |
Jason Sams | 49a05d7 | 2010-12-29 14:31:29 -0800 | [diff] [blame] | 25 | **/ |
Xusong Wang | 8b4548c | 2021-01-05 10:09:52 -0800 | [diff] [blame] | 26 | @Deprecated |
Jason Sams | 49a05d7 | 2010-12-29 14:31:29 -0800 | [diff] [blame] | 27 | public class AllocationAdapter extends Allocation { |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 28 | Type mWindow; |
| 29 | |
| 30 | AllocationAdapter(long id, RenderScript rs, Allocation alloc, Type t) { |
Jason Sams | ba862d1 | 2011-07-07 15:24:42 -0700 | [diff] [blame] | 31 | super(id, rs, alloc.mType, alloc.mUsage); |
| 32 | mAdaptedAllocation = alloc; |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 33 | mWindow = t; |
Jason Sams | 49a05d7 | 2010-12-29 14:31:29 -0800 | [diff] [blame] | 34 | } |
| 35 | |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 36 | /* |
Tim Murray | 460a049 | 2013-11-19 12:45:54 -0800 | [diff] [blame] | 37 | long getID(RenderScript rs) { |
Jason Sams | 48fe534 | 2011-07-08 13:52:30 -0700 | [diff] [blame] | 38 | throw new RSInvalidStateException( |
| 39 | "This operation is not supported with adapters at this time."); |
Jason Sams | ee2d809 | 2011-06-21 16:42:42 -0700 | [diff] [blame] | 40 | } |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 41 | */ |
Jason Sams | 49a05d7 | 2010-12-29 14:31:29 -0800 | [diff] [blame] | 42 | |
Jason Sams | ba862d1 | 2011-07-07 15:24:42 -0700 | [diff] [blame] | 43 | void initLOD(int lod) { |
Jason Sams | ee2d809 | 2011-06-21 16:42:42 -0700 | [diff] [blame] | 44 | if (lod < 0) { |
| 45 | throw new RSIllegalArgumentException("Attempting to set negative lod (" + lod + ")."); |
| 46 | } |
| 47 | |
Jason Sams | ba862d1 | 2011-07-07 15:24:42 -0700 | [diff] [blame] | 48 | int tx = mAdaptedAllocation.mType.getX(); |
| 49 | int ty = mAdaptedAllocation.mType.getY(); |
| 50 | int tz = mAdaptedAllocation.mType.getZ(); |
Jason Sams | ee2d809 | 2011-06-21 16:42:42 -0700 | [diff] [blame] | 51 | |
| 52 | for (int ct=0; ct < lod; ct++) { |
| 53 | if ((tx==1) && (ty == 1) && (tz == 1)) { |
| 54 | throw new RSIllegalArgumentException("Attempting to set lod (" + lod + ") out of range."); |
| 55 | } |
| 56 | |
| 57 | if (tx > 1) tx >>= 1; |
| 58 | if (ty > 1) ty >>= 1; |
| 59 | if (tz > 1) tz >>= 1; |
| 60 | } |
| 61 | |
Jason Sams | ba862d1 | 2011-07-07 15:24:42 -0700 | [diff] [blame] | 62 | mCurrentDimX = tx; |
| 63 | mCurrentDimY = ty; |
| 64 | mCurrentDimZ = tz; |
| 65 | mCurrentCount = mCurrentDimX; |
| 66 | if (mCurrentDimY > 1) { |
| 67 | mCurrentCount *= mCurrentDimY; |
Jason Sams | ee2d809 | 2011-06-21 16:42:42 -0700 | [diff] [blame] | 68 | } |
Jason Sams | ba862d1 | 2011-07-07 15:24:42 -0700 | [diff] [blame] | 69 | if (mCurrentDimZ > 1) { |
| 70 | mCurrentCount *= mCurrentDimZ; |
Jason Sams | ee2d809 | 2011-06-21 16:42:42 -0700 | [diff] [blame] | 71 | } |
Jason Sams | ba862d1 | 2011-07-07 15:24:42 -0700 | [diff] [blame] | 72 | mSelectedY = 0; |
| 73 | mSelectedZ = 0; |
Jason Sams | ee2d809 | 2011-06-21 16:42:42 -0700 | [diff] [blame] | 74 | } |
| 75 | |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 76 | private void updateOffsets() { |
| 77 | int a1 = 0, a2 = 0, a3 = 0, a4 = 0; |
| 78 | |
Jason Sams | add04be | 2015-02-25 16:42:00 -0800 | [diff] [blame] | 79 | if (mSelectedArray != null) { |
| 80 | if (mSelectedArray.length > 0) { |
| 81 | a1 = mSelectedArray[0]; |
| 82 | } |
| 83 | if (mSelectedArray.length > 1) { |
| 84 | a2 = mSelectedArray[2]; |
| 85 | } |
| 86 | if (mSelectedArray.length > 2) { |
| 87 | a3 = mSelectedArray[2]; |
| 88 | } |
| 89 | if (mSelectedArray.length > 3) { |
| 90 | a4 = mSelectedArray[3]; |
| 91 | } |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 92 | } |
| 93 | mRS.nAllocationAdapterOffset(getID(mRS), mSelectedX, mSelectedY, mSelectedZ, |
| 94 | mSelectedLOD, mSelectedFace.mID, a1, a2, a3, a4); |
| 95 | |
| 96 | } |
| 97 | |
Stephen Hines | 9c9ad3f8c2 | 2012-05-07 15:34:29 -0700 | [diff] [blame] | 98 | /** |
Jason Sams | ee2d809 | 2011-06-21 16:42:42 -0700 | [diff] [blame] | 99 | * Set the active LOD. The LOD must be within the range for the |
Jason Sams | ba862d1 | 2011-07-07 15:24:42 -0700 | [diff] [blame] | 100 | * type being adapted. The base allocation must have mipmaps. |
| 101 | * |
| 102 | * Because this changes the dimensions of the adapter the |
| 103 | * current Y and Z will be reset. |
Jason Sams | ee2d809 | 2011-06-21 16:42:42 -0700 | [diff] [blame] | 104 | * |
| 105 | * @param lod The LOD to make active. |
| 106 | */ |
Jason Sams | 49a05d7 | 2010-12-29 14:31:29 -0800 | [diff] [blame] | 107 | public void setLOD(int lod) { |
Jason Sams | ba862d1 | 2011-07-07 15:24:42 -0700 | [diff] [blame] | 108 | if (!mAdaptedAllocation.getType().hasMipmaps()) { |
Jason Sams | ee2d809 | 2011-06-21 16:42:42 -0700 | [diff] [blame] | 109 | throw new RSInvalidStateException("Cannot set LOD when the allocation type does not include mipmaps."); |
| 110 | } |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 111 | if (mWindow.hasMipmaps()) { |
Jason Sams | ee2d809 | 2011-06-21 16:42:42 -0700 | [diff] [blame] | 112 | throw new RSInvalidStateException("Cannot set LOD when the adapter includes mipmaps."); |
| 113 | } |
| 114 | |
| 115 | initLOD(lod); |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 116 | mSelectedLOD = lod; |
| 117 | updateOffsets(); |
Jason Sams | 49a05d7 | 2010-12-29 14:31:29 -0800 | [diff] [blame] | 118 | } |
| 119 | |
Stephen Hines | 9c9ad3f8c2 | 2012-05-07 15:34:29 -0700 | [diff] [blame] | 120 | /** |
Jason Sams | ba862d1 | 2011-07-07 15:24:42 -0700 | [diff] [blame] | 121 | * Set the active Face. The base allocation must be of a type |
| 122 | * that includes faces. |
| 123 | * |
| 124 | * @param cf The face to make active. |
| 125 | */ |
Jason Sams | 49a05d7 | 2010-12-29 14:31:29 -0800 | [diff] [blame] | 126 | public void setFace(Type.CubemapFace cf) { |
Jason Sams | ba862d1 | 2011-07-07 15:24:42 -0700 | [diff] [blame] | 127 | if (!mAdaptedAllocation.getType().hasFaces()) { |
| 128 | throw new RSInvalidStateException("Cannot set Face when the allocation type does not include faces."); |
| 129 | } |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 130 | if (mWindow.hasFaces()) { |
| 131 | throw new RSInvalidStateException("Cannot set face when the adapter includes faces."); |
Jason Sams | ba862d1 | 2011-07-07 15:24:42 -0700 | [diff] [blame] | 132 | } |
| 133 | if (cf == null) { |
| 134 | throw new RSIllegalArgumentException("Cannot set null face."); |
| 135 | } |
| 136 | |
Alex Sakhartchouk | 304b1f5 | 2011-06-14 11:13:19 -0700 | [diff] [blame] | 137 | mSelectedFace = cf; |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 138 | updateOffsets(); |
| 139 | } |
| 140 | |
| 141 | |
| 142 | /** |
Jason Sams | 2066667 | 2015-03-20 15:08:45 -0700 | [diff] [blame] | 143 | * |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 144 | * Set the active X. The x value must be within the range for |
| 145 | * the allocation being adapted. |
| 146 | * |
| 147 | * @param x The x to make active. |
| 148 | */ |
| 149 | public void setX(int x) { |
| 150 | if (mAdaptedAllocation.getType().getX() <= x) { |
| 151 | throw new RSInvalidStateException("Cannot set X greater than dimension of allocation."); |
| 152 | } |
| 153 | if (mWindow.getX() == mAdaptedAllocation.getType().getX()) { |
| 154 | throw new RSInvalidStateException("Cannot set X when the adapter includes X."); |
| 155 | } |
| 156 | if ((mWindow.getX() + x) >= mAdaptedAllocation.getType().getX()) { |
| 157 | throw new RSInvalidStateException("Cannot set (X + window) which would be larger than dimension of allocation."); |
| 158 | } |
| 159 | |
| 160 | mSelectedX = x; |
| 161 | updateOffsets(); |
Jason Sams | 49a05d7 | 2010-12-29 14:31:29 -0800 | [diff] [blame] | 162 | } |
| 163 | |
Stephen Hines | 9c9ad3f8c2 | 2012-05-07 15:34:29 -0700 | [diff] [blame] | 164 | /** |
Jason Sams | ba862d1 | 2011-07-07 15:24:42 -0700 | [diff] [blame] | 165 | * Set the active Y. The y value must be within the range for |
| 166 | * the allocation being adapted. The base allocation must |
| 167 | * contain the Y dimension. |
| 168 | * |
| 169 | * @param y The y to make active. |
| 170 | */ |
Jason Sams | 49a05d7 | 2010-12-29 14:31:29 -0800 | [diff] [blame] | 171 | public void setY(int y) { |
Jason Sams | ba862d1 | 2011-07-07 15:24:42 -0700 | [diff] [blame] | 172 | if (mAdaptedAllocation.getType().getY() == 0) { |
| 173 | throw new RSInvalidStateException("Cannot set Y when the allocation type does not include Y dim."); |
| 174 | } |
| 175 | if (mAdaptedAllocation.getType().getY() <= y) { |
| 176 | throw new RSInvalidStateException("Cannot set Y greater than dimension of allocation."); |
| 177 | } |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 178 | if (mWindow.getY() == mAdaptedAllocation.getType().getY()) { |
Jason Sams | ba862d1 | 2011-07-07 15:24:42 -0700 | [diff] [blame] | 179 | throw new RSInvalidStateException("Cannot set Y when the adapter includes Y."); |
| 180 | } |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 181 | if ((mWindow.getY() + y) >= mAdaptedAllocation.getType().getY()) { |
| 182 | throw new RSInvalidStateException("Cannot set (Y + window) which would be larger than dimension of allocation."); |
| 183 | } |
Jason Sams | ba862d1 | 2011-07-07 15:24:42 -0700 | [diff] [blame] | 184 | |
| 185 | mSelectedY = y; |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 186 | updateOffsets(); |
Jason Sams | 49a05d7 | 2010-12-29 14:31:29 -0800 | [diff] [blame] | 187 | } |
| 188 | |
Stephen Hines | 9c9ad3f8c2 | 2012-05-07 15:34:29 -0700 | [diff] [blame] | 189 | /** |
Jason Sams | ba862d1 | 2011-07-07 15:24:42 -0700 | [diff] [blame] | 190 | * Set the active Z. The z value must be within the range for |
| 191 | * the allocation being adapted. The base allocation must |
| 192 | * contain the Z dimension. |
| 193 | * |
| 194 | * @param z The z to make active. |
| 195 | */ |
Jason Sams | 49a05d7 | 2010-12-29 14:31:29 -0800 | [diff] [blame] | 196 | public void setZ(int z) { |
Jason Sams | ba862d1 | 2011-07-07 15:24:42 -0700 | [diff] [blame] | 197 | if (mAdaptedAllocation.getType().getZ() == 0) { |
| 198 | throw new RSInvalidStateException("Cannot set Z when the allocation type does not include Z dim."); |
| 199 | } |
| 200 | if (mAdaptedAllocation.getType().getZ() <= z) { |
| 201 | throw new RSInvalidStateException("Cannot set Z greater than dimension of allocation."); |
| 202 | } |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 203 | if (mWindow.getZ() == mAdaptedAllocation.getType().getZ()) { |
Jason Sams | ba862d1 | 2011-07-07 15:24:42 -0700 | [diff] [blame] | 204 | throw new RSInvalidStateException("Cannot set Z when the adapter includes Z."); |
| 205 | } |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 206 | if ((mWindow.getZ() + z) >= mAdaptedAllocation.getType().getZ()) { |
| 207 | throw new RSInvalidStateException("Cannot set (Z + window) which would be larger than dimension of allocation."); |
| 208 | } |
Jason Sams | ba862d1 | 2011-07-07 15:24:42 -0700 | [diff] [blame] | 209 | |
| 210 | mSelectedZ = z; |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 211 | updateOffsets(); |
| 212 | } |
| 213 | |
| 214 | /** |
Jason Sams | d016266 | 2015-04-15 17:18:10 -0700 | [diff] [blame] | 215 | * @hide |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 216 | */ |
| 217 | public void setArray(int arrayNum, int arrayVal) { |
| 218 | if (mAdaptedAllocation.getType().getArray(arrayNum) == 0) { |
| 219 | throw new RSInvalidStateException("Cannot set arrayNum when the allocation type does not include arrayNum dim."); |
| 220 | } |
| 221 | if (mAdaptedAllocation.getType().getArray(arrayNum) <= arrayVal) { |
| 222 | throw new RSInvalidStateException("Cannot set arrayNum greater than dimension of allocation."); |
| 223 | } |
| 224 | if (mWindow.getArray(arrayNum) == mAdaptedAllocation.getType().getArray(arrayNum)) { |
| 225 | throw new RSInvalidStateException("Cannot set arrayNum when the adapter includes arrayNum."); |
| 226 | } |
| 227 | if ((mWindow.getArray(arrayNum) + arrayVal) >= mAdaptedAllocation.getType().getArray(arrayNum)) { |
| 228 | throw new RSInvalidStateException("Cannot set (arrayNum + window) which would be larger than dimension of allocation."); |
| 229 | } |
| 230 | |
| 231 | mSelectedArray[arrayNum] = arrayVal; |
| 232 | updateOffsets(); |
Jason Sams | 49a05d7 | 2010-12-29 14:31:29 -0800 | [diff] [blame] | 233 | } |
| 234 | |
Jason Sams | ba862d1 | 2011-07-07 15:24:42 -0700 | [diff] [blame] | 235 | static public AllocationAdapter create1D(RenderScript rs, Allocation a) { |
| 236 | rs.validate(); |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 237 | Type t = Type.createX(rs, a.getElement(), a.getType().getX()); |
| 238 | return createTyped(rs, a, t); |
Jason Sams | ba862d1 | 2011-07-07 15:24:42 -0700 | [diff] [blame] | 239 | } |
Jason Sams | 49a05d7 | 2010-12-29 14:31:29 -0800 | [diff] [blame] | 240 | |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 241 | |
Jason Sams | 49a05d7 | 2010-12-29 14:31:29 -0800 | [diff] [blame] | 242 | static public AllocationAdapter create2D(RenderScript rs, Allocation a) { |
| 243 | rs.validate(); |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 244 | Type t = Type.createXY(rs, a.getElement(), a.getType().getX(), a.getType().getY()); |
| 245 | return createTyped(rs, a, t); |
Jason Sams | 49a05d7 | 2010-12-29 14:31:29 -0800 | [diff] [blame] | 246 | } |
| 247 | |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 248 | /** |
Jason Sams | 2066667 | 2015-03-20 15:08:45 -0700 | [diff] [blame] | 249 | * |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 250 | * |
Pirama Arumuga Nainar | 115b411 | 2015-10-07 19:59:48 -0700 | [diff] [blame] | 251 | * Create an arbitrary window into the base allocation. |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 252 | * The type describes the shape of the window. |
| 253 | * |
| 254 | * Any dimensions present in the type must be equal or smaller |
| 255 | * to the dimensions in the source allocation. A dimension |
| 256 | * present in the allocation that is not present in the type |
Pirama Arumuga Nainar | 115b411 | 2015-10-07 19:59:48 -0700 | [diff] [blame] | 257 | * will be constrained away with the selectors. |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 258 | * |
Pirama Arumuga Nainar | 115b411 | 2015-10-07 19:59:48 -0700 | [diff] [blame] | 259 | * If a dimension is present in both the type and allocation, one of |
| 260 | * two things will happen. |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 261 | * |
Pirama Arumuga Nainar | 115b411 | 2015-10-07 19:59:48 -0700 | [diff] [blame] | 262 | * If the type is smaller than the allocation, a window will be |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 263 | * created, the selected value in the adapter for that dimension |
Pirama Arumuga Nainar | 115b411 | 2015-10-07 19:59:48 -0700 | [diff] [blame] | 264 | * will act as the base address, and the type will describe the |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 265 | * size of the view starting at that point. |
| 266 | * |
Pirama Arumuga Nainar | 115b411 | 2015-10-07 19:59:48 -0700 | [diff] [blame] | 267 | * If the type and allocation dimension are of the same size, |
Jason Sams | 46ba27e3 | 2015-02-06 17:45:15 -0800 | [diff] [blame] | 268 | * then setting the selector for the dimension will be an error. |
| 269 | */ |
| 270 | static public AllocationAdapter createTyped(RenderScript rs, Allocation a, Type t) { |
| 271 | rs.validate(); |
| 272 | |
| 273 | if (a.mAdaptedAllocation != null) { |
| 274 | throw new RSInvalidStateException("Adapters cannot be nested."); |
| 275 | } |
| 276 | |
| 277 | if (!a.getType().getElement().equals(t.getElement())) { |
| 278 | throw new RSInvalidStateException("Element must match Allocation type."); |
| 279 | } |
| 280 | |
| 281 | if (t.hasFaces() || t.hasMipmaps()) { |
| 282 | throw new RSInvalidStateException("Adapters do not support window types with Mipmaps or Faces."); |
| 283 | } |
| 284 | |
| 285 | Type at = a.getType(); |
| 286 | if ((t.getX() > at.getX()) || |
| 287 | (t.getY() > at.getY()) || |
| 288 | (t.getZ() > at.getZ()) || |
| 289 | (t.getArrayCount() > at.getArrayCount())) { |
| 290 | |
| 291 | throw new RSInvalidStateException("Type cannot have dimension larger than the source allocation."); |
| 292 | } |
| 293 | |
| 294 | if (t.getArrayCount() > 0) { |
| 295 | for (int i = 0; i < t.getArray(i); i++) { |
| 296 | if (t.getArray(i) > at.getArray(i)) { |
| 297 | throw new RSInvalidStateException("Type cannot have dimension larger than the source allocation."); |
| 298 | } |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | // Create the object |
| 303 | long id = rs.nAllocationAdapterCreate(a.getID(rs), t.getID(rs)); |
| 304 | if (id == 0) { |
| 305 | throw new RSRuntimeException("AllocationAdapter creation failed."); |
| 306 | } |
| 307 | return new AllocationAdapter(id, rs, a, t); |
| 308 | } |
Jason Sams | 49a05d7 | 2010-12-29 14:31:29 -0800 | [diff] [blame] | 309 | |
Stephen Hines | 9c9ad3f8c2 | 2012-05-07 15:34:29 -0700 | [diff] [blame] | 310 | /** |
Jason Sams | ba862d1 | 2011-07-07 15:24:42 -0700 | [diff] [blame] | 311 | * Override the Allocation resize. Resizing adapters is not |
| 312 | * allowed and will throw a RSInvalidStateException. |
| 313 | * |
| 314 | * @param dimX ignored. |
| 315 | */ |
| 316 | public synchronized void resize(int dimX) { |
| 317 | throw new RSInvalidStateException("Resize not allowed for Adapters."); |
| 318 | } |
| 319 | |
Jason Sams | 49a05d7 | 2010-12-29 14:31:29 -0800 | [diff] [blame] | 320 | } |
| 321 | |
| 322 | |