1/* 2 * Copyright (C) 2011-2014 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/* 18 * This file is auto-generated. DO NOT MODIFY! 19 * The source Renderscript file: reflection3264_multifile_1.rs 20 */ 21 22package foo; 23 24import android.os.Build; 25import android.os.Process; 26import java.lang.reflect.Field; 27import android.renderscript.*; 28import foo.reflection3264_multifile_1BitCode; 29 30/** 31 * @hide 32 */ 33public class ScriptC_reflection3264_multifile_1 extends ScriptC { 34 private static final String __rs_resource_name = "reflection3264_multifile_1"; 35 // Constructor 36 public ScriptC_reflection3264_multifile_1(RenderScript rs) { 37 super(rs, 38 __rs_resource_name, 39 reflection3264_multifile_1BitCode.getBitCode32(), 40 reflection3264_multifile_1BitCode.getBitCode64()); 41 __I32 = Element.I32(rs); 42 __ALLOCATION = Element.ALLOCATION(rs); 43 } 44 45 private Element __ALLOCATION; 46 private Element __I32; 47 private FieldPacker __rs_fp_ALLOCATION; 48 private FieldPacker __rs_fp_I32; 49 private final static int mExportVarIdx_a = 0; 50 private int[] mExportVar_a; 51 public synchronized void set_a(int[] v) { 52 mExportVar_a = v; 53 FieldPacker fp = new FieldPacker(40); 54 for (int ct1 = 0; ct1 < 10; ct1++) { 55 fp.addI32(v[ct1]); 56 } 57 58 int []__dimArr = new int[1]; 59 __dimArr[0] = 10; 60 setVar(mExportVarIdx_a, fp, __I32, __dimArr); 61 } 62 63 public int[] get_a() { 64 return mExportVar_a; 65 } 66 67 public Script.FieldID getFieldID_a() { 68 return createFieldID(mExportVarIdx_a, null); 69 } 70 71 private final static int mExportVarIdx_b = 1; 72 private Allocation[] mExportVar_b; 73 public synchronized void set_b(Allocation[] v) { 74 mExportVar_b = v; 75 FieldPacker fp = new FieldPacker(sIs64Bit ? 320 : 40); 76 for (int ct1 = 0; ct1 < 10; ct1++) { 77 fp.addObj(v[ct1]); 78 } 79 80 int []__dimArr = new int[1]; 81 __dimArr[0] = 10; 82 setVar(mExportVarIdx_b, fp, __ALLOCATION, __dimArr); 83 } 84 85 public Allocation[] get_b() { 86 return mExportVar_b; 87 } 88 89 public Script.FieldID getFieldID_b() { 90 return createFieldID(mExportVarIdx_b, null); 91 } 92 93 private final static int mExportFuncIdx_f = 0; 94 public Script.InvokeID getInvokeID_f() { 95 return createInvokeID(mExportFuncIdx_f); 96 } 97 98 public void invoke_f(int c, Allocation d, int e) { 99 FieldPacker f_fp = new FieldPacker(sIs64Bit ? 48 : 12); 100 f_fp.addI32(c); 101 f_fp.skip(sIs64Bit ? 4 : 0); 102 f_fp.addObj(d); 103 f_fp.addI32(e); 104 f_fp.skip(sIs64Bit ? 4 : 0); 105 invoke(mExportFuncIdx_f, f_fp); 106 } 107 108 private static boolean sIs64Bit; 109 110 static { 111 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 112 sIs64Bit = Process.is64Bit(); 113 } 114 115 else { 116 try { 117 Field f = RenderScript.class.getDeclaredField("sPointerSize"); 118 f.setAccessible(true); 119 sIs64Bit = (f.getInt(null) == 8); 120 } 121 122 catch (Throwable e) { 123 sIs64Bit = false; 124 } 125 126 } 127 128 } 129 130} 131 132