Jason Sams | 69f0d31 | 2009-08-03 18:11:17 -0700 | [diff] [blame] | 1 | /* |
Stephen Hines | adeb809 | 2012-04-20 14:26:06 -0700 | [diff] [blame] | 2 | * Copyright (C) 2008-2012 The Android Open Source Project |
Jason Sams | 69f0d31 | 2009-08-03 18:11:17 -0700 | [diff] [blame] | 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 | |
Jason Sams | 08a8158 | 2012-09-18 12:32:10 -0700 | [diff] [blame] | 19 | import android.util.SparseArray; |
| 20 | |
Stephen Hines | 9c9ad3f8c2 | 2012-05-07 15:34:29 -0700 | [diff] [blame] | 21 | /** |
Tim Murray | c11e25c | 2013-04-09 11:01:01 -0700 | [diff] [blame] | 22 | * The parent class for all executable scripts. This should not be used by |
| 23 | * applications. |
Jason Sams | 69f0d31 | 2009-08-03 18:11:17 -0700 | [diff] [blame] | 24 | **/ |
| 25 | public class Script extends BaseObj { |
Jason Sams | 08a8158 | 2012-09-18 12:32:10 -0700 | [diff] [blame] | 26 | |
| 27 | /** |
| 28 | * KernelID is an identifier for a Script + root function pair. It is used |
| 29 | * as an identifier for ScriptGroup creation. |
| 30 | * |
| 31 | * This class should not be directly created. Instead use the method in the |
| 32 | * reflected or intrinsic code "getKernelID_funcname()". |
| 33 | * |
| 34 | */ |
| 35 | public static final class KernelID extends BaseObj { |
| 36 | Script mScript; |
| 37 | int mSlot; |
| 38 | int mSig; |
Tim Murray | 7a629fa | 2013-11-19 12:45:54 -0800 | [diff] [blame] | 39 | KernelID(long id, RenderScript rs, Script s, int slot, int sig) { |
Jason Sams | 08a8158 | 2012-09-18 12:32:10 -0700 | [diff] [blame] | 40 | super(id, rs); |
| 41 | mScript = s; |
| 42 | mSlot = slot; |
| 43 | mSig = sig; |
Yang Ni | 6484b6b | 2016-03-24 09:40:32 -0700 | [diff] [blame^] | 44 | guard.open("destroy"); |
Jason Sams | 08a8158 | 2012-09-18 12:32:10 -0700 | [diff] [blame] | 45 | } |
| 46 | } |
| 47 | |
| 48 | private final SparseArray<KernelID> mKIDs = new SparseArray<KernelID>(); |
| 49 | /** |
| 50 | * Only to be used by generated reflected classes. |
Jason Sams | 08a8158 | 2012-09-18 12:32:10 -0700 | [diff] [blame] | 51 | */ |
Chris Wailes | be7b1de | 2014-07-15 10:56:14 -0700 | [diff] [blame] | 52 | protected KernelID createKernelID(int slot, int sig, Element ein, |
| 53 | Element eout) { |
Jason Sams | 08a8158 | 2012-09-18 12:32:10 -0700 | [diff] [blame] | 54 | KernelID k = mKIDs.get(slot); |
| 55 | if (k != null) { |
| 56 | return k; |
| 57 | } |
| 58 | |
Tim Murray | 7a629fa | 2013-11-19 12:45:54 -0800 | [diff] [blame] | 59 | long id = mRS.nScriptKernelIDCreate(getID(mRS), slot, sig); |
Jason Sams | 08a8158 | 2012-09-18 12:32:10 -0700 | [diff] [blame] | 60 | if (id == 0) { |
| 61 | throw new RSDriverException("Failed to create KernelID"); |
| 62 | } |
| 63 | |
| 64 | k = new KernelID(id, mRS, this, slot, sig); |
| 65 | mKIDs.put(slot, k); |
| 66 | return k; |
| 67 | } |
| 68 | |
| 69 | /** |
Yang Ni | be392ad | 2015-01-23 17:16:02 -0800 | [diff] [blame] | 70 | * InvokeID is an identifier for an invoke function. It is used |
| 71 | * as an identifier for ScriptGroup creation. |
| 72 | * |
| 73 | * This class should not be directly created. Instead use the method in the |
| 74 | * reflected or intrinsic code "getInvokeID_funcname()". |
| 75 | * |
| 76 | */ |
| 77 | public static final class InvokeID extends BaseObj { |
| 78 | Script mScript; |
| 79 | int mSlot; |
| 80 | InvokeID(long id, RenderScript rs, Script s, int slot) { |
| 81 | super(id, rs); |
| 82 | mScript = s; |
| 83 | mSlot = slot; |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | private final SparseArray<InvokeID> mIIDs = new SparseArray<InvokeID>(); |
| 88 | /** |
Yang Ni | be392ad | 2015-01-23 17:16:02 -0800 | [diff] [blame] | 89 | * Only to be used by generated reflected classes. |
| 90 | */ |
| 91 | protected InvokeID createInvokeID(int slot) { |
| 92 | InvokeID i = mIIDs.get(slot); |
| 93 | if (i != null) { |
| 94 | return i; |
| 95 | } |
| 96 | |
| 97 | long id = mRS.nScriptInvokeIDCreate(getID(mRS), slot); |
| 98 | if (id == 0) { |
| 99 | throw new RSDriverException("Failed to create KernelID"); |
| 100 | } |
| 101 | |
| 102 | i = new InvokeID(id, mRS, this, slot); |
| 103 | mIIDs.put(slot, i); |
| 104 | return i; |
| 105 | } |
| 106 | |
| 107 | /** |
Jason Sams | 08a8158 | 2012-09-18 12:32:10 -0700 | [diff] [blame] | 108 | * FieldID is an identifier for a Script + exported field pair. It is used |
| 109 | * as an identifier for ScriptGroup creation. |
| 110 | * |
| 111 | * This class should not be directly created. Instead use the method in the |
| 112 | * reflected or intrinsic code "getFieldID_funcname()". |
| 113 | * |
| 114 | */ |
| 115 | public static final class FieldID extends BaseObj { |
| 116 | Script mScript; |
| 117 | int mSlot; |
Tim Murray | 7a629fa | 2013-11-19 12:45:54 -0800 | [diff] [blame] | 118 | FieldID(long id, RenderScript rs, Script s, int slot) { |
Jason Sams | 08a8158 | 2012-09-18 12:32:10 -0700 | [diff] [blame] | 119 | super(id, rs); |
| 120 | mScript = s; |
| 121 | mSlot = slot; |
Yang Ni | 6484b6b | 2016-03-24 09:40:32 -0700 | [diff] [blame^] | 122 | guard.open("destroy"); |
Jason Sams | 08a8158 | 2012-09-18 12:32:10 -0700 | [diff] [blame] | 123 | } |
| 124 | } |
| 125 | |
| 126 | private final SparseArray<FieldID> mFIDs = new SparseArray(); |
| 127 | /** |
| 128 | * Only to be used by generated reflected classes. |
Jason Sams | 08a8158 | 2012-09-18 12:32:10 -0700 | [diff] [blame] | 129 | */ |
| 130 | protected FieldID createFieldID(int slot, Element e) { |
| 131 | FieldID f = mFIDs.get(slot); |
| 132 | if (f != null) { |
| 133 | return f; |
| 134 | } |
| 135 | |
Tim Murray | 7a629fa | 2013-11-19 12:45:54 -0800 | [diff] [blame] | 136 | long id = mRS.nScriptFieldIDCreate(getID(mRS), slot); |
Jason Sams | 08a8158 | 2012-09-18 12:32:10 -0700 | [diff] [blame] | 137 | if (id == 0) { |
| 138 | throw new RSDriverException("Failed to create FieldID"); |
| 139 | } |
| 140 | |
| 141 | f = new FieldID(id, mRS, this, slot); |
| 142 | mFIDs.put(slot, f); |
| 143 | return f; |
| 144 | } |
| 145 | |
| 146 | |
Stephen Hines | 9c9ad3f8c2 | 2012-05-07 15:34:29 -0700 | [diff] [blame] | 147 | /** |
Jason Sams | 67e3d20 | 2011-01-09 13:49:01 -0800 | [diff] [blame] | 148 | * Only intended for use by generated reflected code. |
| 149 | * |
Jason Sams | 67e3d20 | 2011-01-09 13:49:01 -0800 | [diff] [blame] | 150 | */ |
Jason Sams | 2d71bc7 | 2010-03-26 16:06:43 -0700 | [diff] [blame] | 151 | protected void invoke(int slot) { |
Jason Sams | e07694b | 2012-04-03 15:36:36 -0700 | [diff] [blame] | 152 | mRS.nScriptInvoke(getID(mRS), slot); |
Jason Sams | 2d71bc7 | 2010-03-26 16:06:43 -0700 | [diff] [blame] | 153 | } |
| 154 | |
Stephen Hines | 9c9ad3f8c2 | 2012-05-07 15:34:29 -0700 | [diff] [blame] | 155 | /** |
Jason Sams | 67e3d20 | 2011-01-09 13:49:01 -0800 | [diff] [blame] | 156 | * Only intended for use by generated reflected code. |
| 157 | * |
Jason Sams | 67e3d20 | 2011-01-09 13:49:01 -0800 | [diff] [blame] | 158 | */ |
Jason Sams | 96ed4cf | 2010-06-15 12:15:57 -0700 | [diff] [blame] | 159 | protected void invoke(int slot, FieldPacker v) { |
| 160 | if (v != null) { |
Jason Sams | e07694b | 2012-04-03 15:36:36 -0700 | [diff] [blame] | 161 | mRS.nScriptInvokeV(getID(mRS), slot, v.getData()); |
Jason Sams | 96ed4cf | 2010-06-15 12:15:57 -0700 | [diff] [blame] | 162 | } else { |
Jason Sams | e07694b | 2012-04-03 15:36:36 -0700 | [diff] [blame] | 163 | mRS.nScriptInvoke(getID(mRS), slot); |
Jason Sams | 96ed4cf | 2010-06-15 12:15:57 -0700 | [diff] [blame] | 164 | } |
Jason Sams | 4d33993 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 165 | } |
| 166 | |
Stephen Hines | 9c9ad3f8c2 | 2012-05-07 15:34:29 -0700 | [diff] [blame] | 167 | /** |
Jason Sams | 6e494d3 | 2011-04-27 16:33:11 -0700 | [diff] [blame] | 168 | * Only intended for use by generated reflected code. |
| 169 | * |
Jason Sams | 6e494d3 | 2011-04-27 16:33:11 -0700 | [diff] [blame] | 170 | */ |
Chris Wailes | be7b1de | 2014-07-15 10:56:14 -0700 | [diff] [blame] | 171 | protected void forEach(int slot, Allocation ain, Allocation aout, |
| 172 | FieldPacker v) { |
| 173 | forEach(slot, ain, aout, v, null); |
Jason Sams | 6e494d3 | 2011-04-27 16:33:11 -0700 | [diff] [blame] | 174 | } |
| 175 | |
Jason Sams | f64cca9 | 2013-04-19 12:56:37 -0700 | [diff] [blame] | 176 | /** |
| 177 | * Only intended for use by generated reflected code. |
| 178 | * |
Jason Sams | f64cca9 | 2013-04-19 12:56:37 -0700 | [diff] [blame] | 179 | */ |
Chris Wailes | be7b1de | 2014-07-15 10:56:14 -0700 | [diff] [blame] | 180 | protected void forEach(int slot, Allocation ain, Allocation aout, |
| 181 | FieldPacker v, LaunchOptions sc) { |
| 182 | // TODO: Is this necessary if nScriptForEach calls validate as well? |
Jason Sams | 678cc7f | 2014-03-05 16:09:02 -0800 | [diff] [blame] | 183 | mRS.validate(); |
| 184 | mRS.validateObject(ain); |
| 185 | mRS.validateObject(aout); |
Chris Wailes | be7b1de | 2014-07-15 10:56:14 -0700 | [diff] [blame] | 186 | |
Jason Sams | d1516df | 2015-05-05 18:00:34 -0700 | [diff] [blame] | 187 | if (ain == null && aout == null && sc == null) { |
Tim Murray | eb8c29c | 2013-02-07 12:16:41 -0800 | [diff] [blame] | 188 | throw new RSIllegalArgumentException( |
Jason Sams | d1516df | 2015-05-05 18:00:34 -0700 | [diff] [blame] | 189 | "At least one of input allocation, output allocation, or LaunchOptions is required to be non-null."); |
Tim Murray | eb8c29c | 2013-02-07 12:16:41 -0800 | [diff] [blame] | 190 | } |
Tim Murray | ba9dd06 | 2013-02-12 16:22:34 -0800 | [diff] [blame] | 191 | |
Chris Wailes | be7b1de | 2014-07-15 10:56:14 -0700 | [diff] [blame] | 192 | long[] in_ids = null; |
Stephen Hines | c9c7daf | 2014-08-13 17:32:19 +0000 | [diff] [blame] | 193 | if (ain != null) { |
Chris Wailes | be7b1de | 2014-07-15 10:56:14 -0700 | [diff] [blame] | 194 | in_ids = mInIdsBuffer; |
| 195 | in_ids[0] = ain.getID(mRS); |
Stephen Hines | c9c7daf | 2014-08-13 17:32:19 +0000 | [diff] [blame] | 196 | } |
Chris Wailes | be7b1de | 2014-07-15 10:56:14 -0700 | [diff] [blame] | 197 | |
Tim Murray | 7a629fa | 2013-11-19 12:45:54 -0800 | [diff] [blame] | 198 | long out_id = 0; |
Tim Murray | eb8c29c | 2013-02-07 12:16:41 -0800 | [diff] [blame] | 199 | if (aout != null) { |
| 200 | out_id = aout.getID(mRS); |
| 201 | } |
Chris Wailes | be7b1de | 2014-07-15 10:56:14 -0700 | [diff] [blame] | 202 | |
Tim Murray | eb8c29c | 2013-02-07 12:16:41 -0800 | [diff] [blame] | 203 | byte[] params = null; |
| 204 | if (v != null) { |
| 205 | params = v.getData(); |
| 206 | } |
Chris Wailes | be7b1de | 2014-07-15 10:56:14 -0700 | [diff] [blame] | 207 | |
| 208 | int[] limits = null; |
| 209 | if (sc != null) { |
| 210 | limits = new int[6]; |
| 211 | |
| 212 | limits[0] = sc.xstart; |
| 213 | limits[1] = sc.xend; |
| 214 | limits[2] = sc.ystart; |
| 215 | limits[3] = sc.yend; |
| 216 | limits[4] = sc.zstart; |
| 217 | limits[5] = sc.zend; |
| 218 | } |
| 219 | |
| 220 | mRS.nScriptForEach(getID(mRS), slot, in_ids, out_id, params, limits); |
Tim Murray | eb8c29c | 2013-02-07 12:16:41 -0800 | [diff] [blame] | 221 | } |
Jason Sams | 4d33993 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 222 | |
Chris Wailes | 9496106 | 2014-06-11 12:01:28 -0700 | [diff] [blame] | 223 | /** |
| 224 | * Only intended for use by generated reflected code. |
Chris Wailes | 9496106 | 2014-06-11 12:01:28 -0700 | [diff] [blame] | 225 | */ |
Chris Wailes | be7b1de | 2014-07-15 10:56:14 -0700 | [diff] [blame] | 226 | protected void forEach(int slot, Allocation[] ains, Allocation aout, |
| 227 | FieldPacker v) { |
Jason Sams | 6a420b5 | 2015-03-30 15:31:26 -0700 | [diff] [blame] | 228 | |
| 229 | // FieldPacker is kept here to support regular params in the future. |
Chris Wailes | be7b1de | 2014-07-15 10:56:14 -0700 | [diff] [blame] | 230 | forEach(slot, ains, aout, v, null); |
Chris Wailes | 9496106 | 2014-06-11 12:01:28 -0700 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | /** |
| 234 | * Only intended for use by generated reflected code. |
Chris Wailes | 9496106 | 2014-06-11 12:01:28 -0700 | [diff] [blame] | 235 | */ |
Chris Wailes | be7b1de | 2014-07-15 10:56:14 -0700 | [diff] [blame] | 236 | protected void forEach(int slot, Allocation[] ains, Allocation aout, |
| 237 | FieldPacker v, LaunchOptions sc) { |
| 238 | // TODO: Is this necessary if nScriptForEach calls validate as well? |
Jason Sams | 6a420b5 | 2015-03-30 15:31:26 -0700 | [diff] [blame] | 239 | // FieldPacker is kept here to support regular params in the future. |
Chris Wailes | 9496106 | 2014-06-11 12:01:28 -0700 | [diff] [blame] | 240 | mRS.validate(); |
Andreas Gampe | c8ddcdd | 2015-03-15 15:57:30 -0700 | [diff] [blame] | 241 | if (ains != null) { |
| 242 | for (Allocation ain : ains) { |
| 243 | mRS.validateObject(ain); |
| 244 | } |
Chris Wailes | 9496106 | 2014-06-11 12:01:28 -0700 | [diff] [blame] | 245 | } |
Stephen Hines | c9c7daf | 2014-08-13 17:32:19 +0000 | [diff] [blame] | 246 | mRS.validateObject(aout); |
Chris Wailes | be7b1de | 2014-07-15 10:56:14 -0700 | [diff] [blame] | 247 | |
Chris Wailes | 9496106 | 2014-06-11 12:01:28 -0700 | [diff] [blame] | 248 | if (ains == null && aout == null) { |
| 249 | throw new RSIllegalArgumentException( |
| 250 | "At least one of ain or aout is required to be non-null."); |
| 251 | } |
| 252 | |
Andreas Gampe | ad555f9 | 2015-03-17 20:05:46 -0700 | [diff] [blame] | 253 | long[] in_ids; |
| 254 | if (ains != null) { |
| 255 | in_ids = new long[ains.length]; |
| 256 | for (int index = 0; index < ains.length; ++index) { |
| 257 | in_ids[index] = ains[index].getID(mRS); |
| 258 | } |
| 259 | } else { |
| 260 | in_ids = null; |
Chris Wailes | 9496106 | 2014-06-11 12:01:28 -0700 | [diff] [blame] | 261 | } |
| 262 | |
| 263 | long out_id = 0; |
| 264 | if (aout != null) { |
| 265 | out_id = aout.getID(mRS); |
| 266 | } |
Chris Wailes | be7b1de | 2014-07-15 10:56:14 -0700 | [diff] [blame] | 267 | |
Chris Wailes | 9496106 | 2014-06-11 12:01:28 -0700 | [diff] [blame] | 268 | byte[] params = null; |
| 269 | if (v != null) { |
| 270 | params = v.getData(); |
| 271 | } |
Chris Wailes | be7b1de | 2014-07-15 10:56:14 -0700 | [diff] [blame] | 272 | |
| 273 | int[] limits = null; |
| 274 | if (sc != null) { |
| 275 | limits = new int[6]; |
| 276 | |
| 277 | limits[0] = sc.xstart; |
| 278 | limits[1] = sc.xend; |
| 279 | limits[2] = sc.ystart; |
| 280 | limits[3] = sc.yend; |
| 281 | limits[4] = sc.zstart; |
| 282 | limits[5] = sc.zend; |
| 283 | } |
| 284 | |
| 285 | mRS.nScriptForEach(getID(mRS), slot, in_ids, out_id, params, limits); |
Chris Wailes | 9496106 | 2014-06-11 12:01:28 -0700 | [diff] [blame] | 286 | } |
| 287 | |
Matt Wala | 36eb1f7 | 2015-07-20 15:35:27 -0700 | [diff] [blame] | 288 | /** |
David Gross | 26ef7a73 | 2016-01-12 12:19:15 -0800 | [diff] [blame] | 289 | * Only intended for use by generated reflected code. (Simple reduction) |
Matt Wala | 36eb1f7 | 2015-07-20 15:35:27 -0700 | [diff] [blame] | 290 | * |
| 291 | * @hide |
| 292 | */ |
| 293 | protected void reduce(int slot, Allocation ain, Allocation aout, LaunchOptions sc) { |
| 294 | mRS.validate(); |
| 295 | mRS.validateObject(ain); |
| 296 | mRS.validateObject(aout); |
| 297 | |
| 298 | if (ain == null || aout == null) { |
| 299 | throw new RSIllegalArgumentException( |
| 300 | "Both ain and aout are required to be non-null."); |
| 301 | } |
| 302 | |
| 303 | long in_id = ain.getID(mRS); |
| 304 | long out_id = aout.getID(mRS); |
| 305 | |
| 306 | int[] limits = null; |
| 307 | if (sc != null) { |
| 308 | limits = new int[2]; |
| 309 | |
| 310 | limits[0] = sc.xstart; |
| 311 | limits[1] = sc.xend; |
| 312 | } |
| 313 | |
| 314 | mRS.nScriptReduce(getID(mRS), slot, in_id, out_id, limits); |
| 315 | } |
| 316 | |
David Gross | 26ef7a73 | 2016-01-12 12:19:15 -0800 | [diff] [blame] | 317 | /** |
| 318 | * Only intended for use by generated reflected code. (General reduction) |
| 319 | * |
David Gross | 26ef7a73 | 2016-01-12 12:19:15 -0800 | [diff] [blame] | 320 | */ |
| 321 | protected void reduce(int slot, Allocation[] ains, Allocation aout, LaunchOptions sc) { |
| 322 | mRS.validate(); |
| 323 | if (ains == null || ains.length < 1) { |
| 324 | throw new RSIllegalArgumentException( |
| 325 | "At least one input is required."); |
| 326 | } |
| 327 | if (aout == null) { |
| 328 | throw new RSIllegalArgumentException( |
| 329 | "aout is required to be non-null."); |
| 330 | } |
| 331 | for (Allocation ain : ains) { |
| 332 | mRS.validateObject(ain); |
| 333 | } |
| 334 | |
| 335 | long[] in_ids = new long[ains.length]; |
| 336 | for (int index = 0; index < ains.length; ++index) { |
| 337 | in_ids[index] = ains[index].getID(mRS); |
| 338 | } |
| 339 | long out_id = aout.getID(mRS); |
| 340 | |
| 341 | int[] limits = null; |
| 342 | if (sc != null) { |
| 343 | limits = new int[6]; |
| 344 | |
| 345 | limits[0] = sc.xstart; |
| 346 | limits[1] = sc.xend; |
| 347 | limits[2] = sc.ystart; |
| 348 | limits[3] = sc.yend; |
| 349 | limits[4] = sc.zstart; |
| 350 | limits[5] = sc.zend; |
| 351 | } |
| 352 | |
| 353 | mRS.nScriptReduceNew(getID(mRS), slot, in_ids, out_id, limits); |
| 354 | } |
| 355 | |
Chris Wailes | be7b1de | 2014-07-15 10:56:14 -0700 | [diff] [blame] | 356 | long[] mInIdsBuffer; |
| 357 | |
Tim Murray | 7a629fa | 2013-11-19 12:45:54 -0800 | [diff] [blame] | 358 | Script(long id, RenderScript rs) { |
Alex Sakhartchouk | 0de9444 | 2010-08-11 14:41:28 -0700 | [diff] [blame] | 359 | super(id, rs); |
Chris Wailes | be7b1de | 2014-07-15 10:56:14 -0700 | [diff] [blame] | 360 | |
| 361 | mInIdsBuffer = new long[1]; |
Yang Ni | 6484b6b | 2016-03-24 09:40:32 -0700 | [diff] [blame^] | 362 | |
| 363 | /* The constructors for the derived classes (including ScriptIntrinsic |
| 364 | * derived classes and ScriptC derived classes generated by Slang |
| 365 | * reflection) seem to be simple enough, so we just put the guard.open() |
| 366 | * call here, rather than in the end of the constructor for the derived |
| 367 | * class. This, of course, assumes the derived constructor would not |
| 368 | * throw any exception after calling this constructor. |
| 369 | * |
| 370 | * If new derived classes are added with more complicated constructors |
| 371 | * that throw exceptions, this call has to be (duplicated and) moved |
| 372 | * to the end of each derived class constructor. |
| 373 | */ |
| 374 | guard.open("destroy"); |
Jason Sams | 69f0d31 | 2009-08-03 18:11:17 -0700 | [diff] [blame] | 375 | } |
| 376 | |
Stephen Hines | 9c9ad3f8c2 | 2012-05-07 15:34:29 -0700 | [diff] [blame] | 377 | /** |
Jason Sams | 67e3d20 | 2011-01-09 13:49:01 -0800 | [diff] [blame] | 378 | * Only intended for use by generated reflected code. |
| 379 | * |
Jason Sams | 67e3d20 | 2011-01-09 13:49:01 -0800 | [diff] [blame] | 380 | */ |
Jason Sams | 69f0d31 | 2009-08-03 18:11:17 -0700 | [diff] [blame] | 381 | public void bindAllocation(Allocation va, int slot) { |
Jason Sams | 771bebb | 2009-12-07 12:40:12 -0800 | [diff] [blame] | 382 | mRS.validate(); |
Jason Sams | 678cc7f | 2014-03-05 16:09:02 -0800 | [diff] [blame] | 383 | mRS.validateObject(va); |
Jason Sams | 4d33993 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 384 | if (va != null) { |
Chris Wailes | be7b1de | 2014-07-15 10:56:14 -0700 | [diff] [blame] | 385 | |
| 386 | android.content.Context context = mRS.getApplicationContext(); |
| 387 | |
| 388 | if (context.getApplicationInfo().targetSdkVersion >= 20) { |
Jason Sams | cf9c894 | 2014-01-14 16:18:14 -0800 | [diff] [blame] | 389 | final Type t = va.mType; |
Chris Wailes | be7b1de | 2014-07-15 10:56:14 -0700 | [diff] [blame] | 390 | if (t.hasMipmaps() || t.hasFaces() || (t.getY() != 0) || |
| 391 | (t.getZ() != 0)) { |
| 392 | |
Jason Sams | cf9c894 | 2014-01-14 16:18:14 -0800 | [diff] [blame] | 393 | throw new RSIllegalArgumentException( |
Chris Wailes | be7b1de | 2014-07-15 10:56:14 -0700 | [diff] [blame] | 394 | "API 20+ only allows simple 1D allocations to be " + |
| 395 | "used with bind."); |
Jason Sams | cf9c894 | 2014-01-14 16:18:14 -0800 | [diff] [blame] | 396 | } |
| 397 | } |
Jason Sams | e07694b | 2012-04-03 15:36:36 -0700 | [diff] [blame] | 398 | mRS.nScriptBindAllocation(getID(mRS), va.getID(mRS), slot); |
Jason Sams | 4d33993 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 399 | } else { |
Jason Sams | e07694b | 2012-04-03 15:36:36 -0700 | [diff] [blame] | 400 | mRS.nScriptBindAllocation(getID(mRS), 0, slot); |
Jason Sams | 4d33993 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 401 | } |
| 402 | } |
| 403 | |
Stephen Hines | 9c9ad3f8c2 | 2012-05-07 15:34:29 -0700 | [diff] [blame] | 404 | /** |
Jason Sams | 67e3d20 | 2011-01-09 13:49:01 -0800 | [diff] [blame] | 405 | * Only intended for use by generated reflected code. |
| 406 | * |
Jason Sams | 67e3d20 | 2011-01-09 13:49:01 -0800 | [diff] [blame] | 407 | */ |
Jason Sams | 4d33993 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 408 | public void setVar(int index, float v) { |
Jason Sams | e07694b | 2012-04-03 15:36:36 -0700 | [diff] [blame] | 409 | mRS.nScriptSetVarF(getID(mRS), index, v); |
Jason Sams | 4d33993 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 410 | } |
Tim Murray | 7c4caad | 2013-04-10 16:21:40 -0700 | [diff] [blame] | 411 | public float getVarF(int index) { |
| 412 | return mRS.nScriptGetVarF(getID(mRS), index); |
| 413 | } |
Jason Sams | 4d33993 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 414 | |
Stephen Hines | 9c9ad3f8c2 | 2012-05-07 15:34:29 -0700 | [diff] [blame] | 415 | /** |
Jason Sams | 67e3d20 | 2011-01-09 13:49:01 -0800 | [diff] [blame] | 416 | * Only intended for use by generated reflected code. |
| 417 | * |
Jason Sams | 67e3d20 | 2011-01-09 13:49:01 -0800 | [diff] [blame] | 418 | */ |
Stephen Hines | ca54ec3 | 2010-09-20 17:20:30 -0700 | [diff] [blame] | 419 | public void setVar(int index, double v) { |
Jason Sams | e07694b | 2012-04-03 15:36:36 -0700 | [diff] [blame] | 420 | mRS.nScriptSetVarD(getID(mRS), index, v); |
Stephen Hines | ca54ec3 | 2010-09-20 17:20:30 -0700 | [diff] [blame] | 421 | } |
Tim Murray | 7c4caad | 2013-04-10 16:21:40 -0700 | [diff] [blame] | 422 | public double getVarD(int index) { |
| 423 | return mRS.nScriptGetVarD(getID(mRS), index); |
| 424 | } |
Stephen Hines | ca54ec3 | 2010-09-20 17:20:30 -0700 | [diff] [blame] | 425 | |
Stephen Hines | 9c9ad3f8c2 | 2012-05-07 15:34:29 -0700 | [diff] [blame] | 426 | /** |
Jason Sams | 67e3d20 | 2011-01-09 13:49:01 -0800 | [diff] [blame] | 427 | * Only intended for use by generated reflected code. |
| 428 | * |
Jason Sams | 67e3d20 | 2011-01-09 13:49:01 -0800 | [diff] [blame] | 429 | */ |
Jason Sams | 4d33993 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 430 | public void setVar(int index, int v) { |
Jason Sams | e07694b | 2012-04-03 15:36:36 -0700 | [diff] [blame] | 431 | mRS.nScriptSetVarI(getID(mRS), index, v); |
Jason Sams | 4d33993 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 432 | } |
Tim Murray | 7c4caad | 2013-04-10 16:21:40 -0700 | [diff] [blame] | 433 | public int getVarI(int index) { |
| 434 | return mRS.nScriptGetVarI(getID(mRS), index); |
| 435 | } |
| 436 | |
Jason Sams | 4d33993 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 437 | |
Stephen Hines | 9c9ad3f8c2 | 2012-05-07 15:34:29 -0700 | [diff] [blame] | 438 | /** |
Jason Sams | 67e3d20 | 2011-01-09 13:49:01 -0800 | [diff] [blame] | 439 | * Only intended for use by generated reflected code. |
| 440 | * |
Jason Sams | 67e3d20 | 2011-01-09 13:49:01 -0800 | [diff] [blame] | 441 | */ |
Stephen Hines | 031ec58c | 2010-10-11 10:54:21 -0700 | [diff] [blame] | 442 | public void setVar(int index, long v) { |
Jason Sams | e07694b | 2012-04-03 15:36:36 -0700 | [diff] [blame] | 443 | mRS.nScriptSetVarJ(getID(mRS), index, v); |
Stephen Hines | 031ec58c | 2010-10-11 10:54:21 -0700 | [diff] [blame] | 444 | } |
Tim Murray | 7c4caad | 2013-04-10 16:21:40 -0700 | [diff] [blame] | 445 | public long getVarJ(int index) { |
| 446 | return mRS.nScriptGetVarJ(getID(mRS), index); |
| 447 | } |
| 448 | |
Stephen Hines | 031ec58c | 2010-10-11 10:54:21 -0700 | [diff] [blame] | 449 | |
Stephen Hines | 9c9ad3f8c2 | 2012-05-07 15:34:29 -0700 | [diff] [blame] | 450 | /** |
Jason Sams | 67e3d20 | 2011-01-09 13:49:01 -0800 | [diff] [blame] | 451 | * Only intended for use by generated reflected code. |
| 452 | * |
Jason Sams | 67e3d20 | 2011-01-09 13:49:01 -0800 | [diff] [blame] | 453 | */ |
Jason Sams | 0b9a22c | 2010-07-02 15:35:19 -0700 | [diff] [blame] | 454 | public void setVar(int index, boolean v) { |
Jason Sams | e07694b | 2012-04-03 15:36:36 -0700 | [diff] [blame] | 455 | mRS.nScriptSetVarI(getID(mRS), index, v ? 1 : 0); |
Jason Sams | 0b9a22c | 2010-07-02 15:35:19 -0700 | [diff] [blame] | 456 | } |
Tim Murray | 7c4caad | 2013-04-10 16:21:40 -0700 | [diff] [blame] | 457 | public boolean getVarB(int index) { |
| 458 | return mRS.nScriptGetVarI(getID(mRS), index) > 0 ? true : false; |
| 459 | } |
Jason Sams | 0b9a22c | 2010-07-02 15:35:19 -0700 | [diff] [blame] | 460 | |
Stephen Hines | 9c9ad3f8c2 | 2012-05-07 15:34:29 -0700 | [diff] [blame] | 461 | /** |
Jason Sams | 67e3d20 | 2011-01-09 13:49:01 -0800 | [diff] [blame] | 462 | * Only intended for use by generated reflected code. |
| 463 | * |
Jason Sams | 67e3d20 | 2011-01-09 13:49:01 -0800 | [diff] [blame] | 464 | */ |
Jason Sams | 6f4cf0b | 2010-11-16 17:37:02 -0800 | [diff] [blame] | 465 | public void setVar(int index, BaseObj o) { |
Jason Sams | 678cc7f | 2014-03-05 16:09:02 -0800 | [diff] [blame] | 466 | mRS.validate(); |
| 467 | mRS.validateObject(o); |
Jason Sams | e07694b | 2012-04-03 15:36:36 -0700 | [diff] [blame] | 468 | mRS.nScriptSetVarObj(getID(mRS), index, (o == null) ? 0 : o.getID(mRS)); |
Jason Sams | 6f4cf0b | 2010-11-16 17:37:02 -0800 | [diff] [blame] | 469 | } |
| 470 | |
Stephen Hines | 9c9ad3f8c2 | 2012-05-07 15:34:29 -0700 | [diff] [blame] | 471 | /** |
Jason Sams | 67e3d20 | 2011-01-09 13:49:01 -0800 | [diff] [blame] | 472 | * Only intended for use by generated reflected code. |
| 473 | * |
Jason Sams | 67e3d20 | 2011-01-09 13:49:01 -0800 | [diff] [blame] | 474 | */ |
Jason Sams | 4d33993 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 475 | public void setVar(int index, FieldPacker v) { |
Jason Sams | e07694b | 2012-04-03 15:36:36 -0700 | [diff] [blame] | 476 | mRS.nScriptSetVarV(getID(mRS), index, v.getData()); |
Jason Sams | 69f0d31 | 2009-08-03 18:11:17 -0700 | [diff] [blame] | 477 | } |
| 478 | |
Stephen Hines | 9c9ad3f8c2 | 2012-05-07 15:34:29 -0700 | [diff] [blame] | 479 | /** |
Stephen Hines | adeb809 | 2012-04-20 14:26:06 -0700 | [diff] [blame] | 480 | * Only intended for use by generated reflected code. |
| 481 | * |
Stephen Hines | adeb809 | 2012-04-20 14:26:06 -0700 | [diff] [blame] | 482 | */ |
| 483 | public void setVar(int index, FieldPacker v, Element e, int[] dims) { |
| 484 | mRS.nScriptSetVarVE(getID(mRS), index, v.getData(), e.getID(mRS), dims); |
| 485 | } |
| 486 | |
Jason Sams | f64cca9 | 2013-04-19 12:56:37 -0700 | [diff] [blame] | 487 | /** |
| 488 | * Only intended for use by generated reflected code. |
| 489 | * |
Jason Sams | f64cca9 | 2013-04-19 12:56:37 -0700 | [diff] [blame] | 490 | */ |
Tim Murray | 7c4caad | 2013-04-10 16:21:40 -0700 | [diff] [blame] | 491 | public void getVarV(int index, FieldPacker v) { |
| 492 | mRS.nScriptGetVarV(getID(mRS), index, v.getData()); |
| 493 | } |
| 494 | |
Jason Sams | 2253417 | 2009-08-04 16:58:20 -0700 | [diff] [blame] | 495 | public void setTimeZone(String timeZone) { |
Jason Sams | 771bebb | 2009-12-07 12:40:12 -0800 | [diff] [blame] | 496 | mRS.validate(); |
Jason Sams | 2253417 | 2009-08-04 16:58:20 -0700 | [diff] [blame] | 497 | try { |
Jason Sams | e07694b | 2012-04-03 15:36:36 -0700 | [diff] [blame] | 498 | mRS.nScriptSetTimeZone(getID(mRS), timeZone.getBytes("UTF-8")); |
Jason Sams | 2253417 | 2009-08-04 16:58:20 -0700 | [diff] [blame] | 499 | } catch (java.io.UnsupportedEncodingException e) { |
| 500 | throw new RuntimeException(e); |
| 501 | } |
| 502 | } |
Jason Sams | 69f0d31 | 2009-08-03 18:11:17 -0700 | [diff] [blame] | 503 | |
Tim Murray | c11e25c | 2013-04-09 11:01:01 -0700 | [diff] [blame] | 504 | /** |
| 505 | * Only intended for use by generated reflected code. |
| 506 | * |
| 507 | */ |
Jason Sams | 69f0d31 | 2009-08-03 18:11:17 -0700 | [diff] [blame] | 508 | public static class Builder { |
| 509 | RenderScript mRS; |
Jason Sams | 69f0d31 | 2009-08-03 18:11:17 -0700 | [diff] [blame] | 510 | |
| 511 | Builder(RenderScript rs) { |
| 512 | mRS = rs; |
| 513 | } |
Jason Sams | 69f0d31 | 2009-08-03 18:11:17 -0700 | [diff] [blame] | 514 | } |
| 515 | |
Jason Sams | 2d71bc7 | 2010-03-26 16:06:43 -0700 | [diff] [blame] | 516 | |
Jason Sams | f64cca9 | 2013-04-19 12:56:37 -0700 | [diff] [blame] | 517 | /** |
| 518 | * Only intended for use by generated reflected code. |
| 519 | * |
| 520 | */ |
Jason Sams | 2d71bc7 | 2010-03-26 16:06:43 -0700 | [diff] [blame] | 521 | public static class FieldBase { |
| 522 | protected Element mElement; |
Jason Sams | 2d71bc7 | 2010-03-26 16:06:43 -0700 | [diff] [blame] | 523 | protected Allocation mAllocation; |
| 524 | |
| 525 | protected void init(RenderScript rs, int dimx) { |
Chris Wailes | be7b1de | 2014-07-15 10:56:14 -0700 | [diff] [blame] | 526 | mAllocation = Allocation.createSized(rs, mElement, dimx, |
| 527 | Allocation.USAGE_SCRIPT); |
Jason Sams | 5476b45 | 2010-12-08 16:14:36 -0800 | [diff] [blame] | 528 | } |
| 529 | |
| 530 | protected void init(RenderScript rs, int dimx, int usages) { |
Chris Wailes | be7b1de | 2014-07-15 10:56:14 -0700 | [diff] [blame] | 531 | mAllocation = |
| 532 | Allocation.createSized(rs, mElement, dimx, |
| 533 | Allocation.USAGE_SCRIPT | usages); |
Jason Sams | 2d71bc7 | 2010-03-26 16:06:43 -0700 | [diff] [blame] | 534 | } |
| 535 | |
| 536 | protected FieldBase() { |
| 537 | } |
| 538 | |
| 539 | public Element getElement() { |
| 540 | return mElement; |
| 541 | } |
| 542 | |
| 543 | public Type getType() { |
Jason Sams | 31a7e42 | 2010-10-26 13:09:17 -0700 | [diff] [blame] | 544 | return mAllocation.getType(); |
Jason Sams | 2d71bc7 | 2010-03-26 16:06:43 -0700 | [diff] [blame] | 545 | } |
| 546 | |
| 547 | public Allocation getAllocation() { |
| 548 | return mAllocation; |
| 549 | } |
| 550 | |
| 551 | //@Override |
| 552 | public void updateAllocation() { |
| 553 | } |
Jason Sams | 2d71bc7 | 2010-03-26 16:06:43 -0700 | [diff] [blame] | 554 | } |
Tim Murray | fbfaa85 | 2012-12-14 16:01:58 -0800 | [diff] [blame] | 555 | |
Jason Sams | f64cca9 | 2013-04-19 12:56:37 -0700 | [diff] [blame] | 556 | |
| 557 | /** |
Jason Sams | 8610f83 | 2015-03-30 17:01:10 -0700 | [diff] [blame] | 558 | * Class for specifying the specifics about how a kernel will be |
| 559 | * launched |
| 560 | * |
| 561 | * This class can specify a potential range of cells on which to |
| 562 | * run a kernel. If no set is called for a dimension then this |
| 563 | * class will have no impact on that dimension when the kernel |
| 564 | * is executed. |
| 565 | * |
| 566 | * The forEach launch will operate over the intersection of the |
| 567 | * dimensions. |
| 568 | * |
| 569 | * Example: |
| 570 | * LaunchOptions with setX(5, 15) |
| 571 | * Allocation with dimension X=10, Y=10 |
| 572 | * The resulting forEach run would execute over x = 5 to 10 and |
| 573 | * y = 0 to 10. |
| 574 | * |
Jason Sams | f64cca9 | 2013-04-19 12:56:37 -0700 | [diff] [blame] | 575 | * |
| 576 | */ |
Tim Murray | fbfaa85 | 2012-12-14 16:01:58 -0800 | [diff] [blame] | 577 | public static final class LaunchOptions { |
Jason Sams | f64cca9 | 2013-04-19 12:56:37 -0700 | [diff] [blame] | 578 | private int xstart = 0; |
| 579 | private int ystart = 0; |
| 580 | private int xend = 0; |
| 581 | private int yend = 0; |
| 582 | private int zstart = 0; |
| 583 | private int zend = 0; |
| 584 | private int strategy; |
Tim Murray | fbfaa85 | 2012-12-14 16:01:58 -0800 | [diff] [blame] | 585 | |
Jason Sams | f64cca9 | 2013-04-19 12:56:37 -0700 | [diff] [blame] | 586 | /** |
| 587 | * Set the X range. If the end value is set to 0 the X dimension is not |
| 588 | * clipped. |
| 589 | * |
| 590 | * @param xstartArg Must be >= 0 |
| 591 | * @param xendArg Must be >= xstartArg |
| 592 | * |
| 593 | * @return LaunchOptions |
| 594 | */ |
Tim Murray | eb8c29c | 2013-02-07 12:16:41 -0800 | [diff] [blame] | 595 | public LaunchOptions setX(int xstartArg, int xendArg) { |
Tim Murray | fbfaa85 | 2012-12-14 16:01:58 -0800 | [diff] [blame] | 596 | if (xstartArg < 0 || xendArg <= xstartArg) { |
| 597 | throw new RSIllegalArgumentException("Invalid dimensions"); |
| 598 | } |
| 599 | xstart = xstartArg; |
| 600 | xend = xendArg; |
Tim Murray | eb8c29c | 2013-02-07 12:16:41 -0800 | [diff] [blame] | 601 | return this; |
Tim Murray | fbfaa85 | 2012-12-14 16:01:58 -0800 | [diff] [blame] | 602 | } |
| 603 | |
Jason Sams | f64cca9 | 2013-04-19 12:56:37 -0700 | [diff] [blame] | 604 | /** |
| 605 | * Set the Y range. If the end value is set to 0 the Y dimension is not |
| 606 | * clipped. |
| 607 | * |
| 608 | * @param ystartArg Must be >= 0 |
| 609 | * @param yendArg Must be >= ystartArg |
| 610 | * |
| 611 | * @return LaunchOptions |
| 612 | */ |
Tim Murray | eb8c29c | 2013-02-07 12:16:41 -0800 | [diff] [blame] | 613 | public LaunchOptions setY(int ystartArg, int yendArg) { |
Tim Murray | fbfaa85 | 2012-12-14 16:01:58 -0800 | [diff] [blame] | 614 | if (ystartArg < 0 || yendArg <= ystartArg) { |
| 615 | throw new RSIllegalArgumentException("Invalid dimensions"); |
| 616 | } |
| 617 | ystart = ystartArg; |
| 618 | yend = yendArg; |
Tim Murray | eb8c29c | 2013-02-07 12:16:41 -0800 | [diff] [blame] | 619 | return this; |
Tim Murray | fbfaa85 | 2012-12-14 16:01:58 -0800 | [diff] [blame] | 620 | } |
| 621 | |
Jason Sams | f64cca9 | 2013-04-19 12:56:37 -0700 | [diff] [blame] | 622 | /** |
| 623 | * Set the Z range. If the end value is set to 0 the Z dimension is not |
| 624 | * clipped. |
| 625 | * |
| 626 | * @param zstartArg Must be >= 0 |
| 627 | * @param zendArg Must be >= zstartArg |
| 628 | * |
| 629 | * @return LaunchOptions |
| 630 | */ |
Tim Murray | eb8c29c | 2013-02-07 12:16:41 -0800 | [diff] [blame] | 631 | public LaunchOptions setZ(int zstartArg, int zendArg) { |
| 632 | if (zstartArg < 0 || zendArg <= zstartArg) { |
| 633 | throw new RSIllegalArgumentException("Invalid dimensions"); |
| 634 | } |
| 635 | zstart = zstartArg; |
| 636 | zend = zendArg; |
| 637 | return this; |
| 638 | } |
| 639 | |
| 640 | |
Jason Sams | f64cca9 | 2013-04-19 12:56:37 -0700 | [diff] [blame] | 641 | /** |
| 642 | * Returns the current X start |
| 643 | * |
| 644 | * @return int current value |
| 645 | */ |
Tim Murray | fbfaa85 | 2012-12-14 16:01:58 -0800 | [diff] [blame] | 646 | public int getXStart() { |
| 647 | return xstart; |
| 648 | } |
Jason Sams | f64cca9 | 2013-04-19 12:56:37 -0700 | [diff] [blame] | 649 | /** |
| 650 | * Returns the current X end |
| 651 | * |
| 652 | * @return int current value |
| 653 | */ |
Tim Murray | fbfaa85 | 2012-12-14 16:01:58 -0800 | [diff] [blame] | 654 | public int getXEnd() { |
| 655 | return xend; |
| 656 | } |
Jason Sams | f64cca9 | 2013-04-19 12:56:37 -0700 | [diff] [blame] | 657 | /** |
| 658 | * Returns the current Y start |
| 659 | * |
| 660 | * @return int current value |
| 661 | */ |
Tim Murray | fbfaa85 | 2012-12-14 16:01:58 -0800 | [diff] [blame] | 662 | public int getYStart() { |
| 663 | return ystart; |
| 664 | } |
Jason Sams | f64cca9 | 2013-04-19 12:56:37 -0700 | [diff] [blame] | 665 | /** |
| 666 | * Returns the current Y end |
| 667 | * |
| 668 | * @return int current value |
| 669 | */ |
Tim Murray | fbfaa85 | 2012-12-14 16:01:58 -0800 | [diff] [blame] | 670 | public int getYEnd() { |
| 671 | return yend; |
| 672 | } |
Jason Sams | f64cca9 | 2013-04-19 12:56:37 -0700 | [diff] [blame] | 673 | /** |
| 674 | * Returns the current Z start |
| 675 | * |
| 676 | * @return int current value |
| 677 | */ |
Tim Murray | eb8c29c | 2013-02-07 12:16:41 -0800 | [diff] [blame] | 678 | public int getZStart() { |
| 679 | return zstart; |
| 680 | } |
Jason Sams | f64cca9 | 2013-04-19 12:56:37 -0700 | [diff] [blame] | 681 | /** |
| 682 | * Returns the current Z end |
| 683 | * |
| 684 | * @return int current value |
| 685 | */ |
Tim Murray | eb8c29c | 2013-02-07 12:16:41 -0800 | [diff] [blame] | 686 | public int getZEnd() { |
| 687 | return zend; |
| 688 | } |
Tim Murray | fbfaa85 | 2012-12-14 16:01:58 -0800 | [diff] [blame] | 689 | |
| 690 | } |
Jason Sams | 69f0d31 | 2009-08-03 18:11:17 -0700 | [diff] [blame] | 691 | } |