Home | History | Annotate | Download | only in slang

Lines Matching refs:mOut

102   GeneratedFile *mOut;
466 mOut.indent() << "private static final String " RS_RESOURCE_NAME " = \""
471 mOut.indent() << "// Constructor\n";
480 mOut.indent() << "super(rs,\n";
481 mOut.indent() << " " << RS_RESOURCE_NAME ",\n";
482 mOut.indent() << " " << className << ".getBitCode32(),\n";
483 mOut.indent() << " " << className << ".getBitCode64());\n";
487 mOut.indent() << "this(rs,\n";
488 mOut.indent() << " rs.getApplicationContext().getResources(),\n";
489 mOut.indent() << " rs.getApplicationContext().getResources()."
491 mOut.indent() << " " RS_RESOURCE_NAME ", \"raw\",\n";
492 mOut.indent()
500 mOut.indent() << "super(rs, resources, id);\n";
513 mOut.indent() << RS_EXPORT_VAR_PREFIX << EV->getName() << " = new "
533 mOut.indent() << SAVED_RS_REFERENCE << " = rs;\n";
582 mOut.indent() << "private Element " RS_ELEM_PREFIX << *I << ";\n";
588 mOut.indent() << "private FieldPacker " RS_FP_PREFIX << *I << ";\n";
594 mOut.indent() << "private RenderScript " << SAVED_RS_REFERENCE << ";\n";
604 mOut.indent() << RS_EXPORT_VAR_PREFIX << VarName << " = ";
606 mOut << ((Val.getInt().getSExtValue() == 0) ? "false" : "true") << ";\n";
614 mOut.indent() << RS_EXPORT_VAR_PREFIX << VarName << " = ";
616 mOut << ";\n";
656 mOut.indent() << RS_EXPORT_VAR_PREFIX << VarName << " = new "
696 mOut.indent() << RS_EXPORT_VAR_PREFIX << VarName
725 mOut.indent() << "private final static int " << RS_EXPORT_VAR_INDEX_PREFIX
758 mOut.indent() << "private final static int " << RS_EXPORT_FUNC_INDEX_PREFIX
777 mOut.indent() << "return createInvokeID(" << RS_EXPORT_FUNC_INDEX_PREFIX
790 mOut.indent() << "invoke(" << RS_EXPORT_FUNC_INDEX_PREFIX << EF->getName()
799 mOut.indent() << "invoke(" << RS_EXPORT_FUNC_INDEX_PREFIX << EF->getName()
809 mOut.indent() << "// Verify dimensions\n";
810 mOut.indent() << "t0 = " << name0 << ".getType();\n";
811 mOut.indent() << "t1 = " << name1 << ".getType();\n";
812 mOut.indent() << "if ((t0.getCount() != t1.getCount()) ||\n";
813 mOut.indent() << " (t0.getX() != t1.getX()) ||\n";
814 mOut.indent() << " (t0.getY() != t1.getY()) ||\n";
815 mOut.indent() << " (t0.getZ() != t1.getZ()) ||\n";
816 mOut.indent() << " (t0.hasFaces() != t1.hasFaces()) ||\n";
817 mOut.indent() << " (t0.hasMipmaps() != t1.hasMipmaps())) {\n";
818 mOut.indent() << " throw new RSRuntimeException(\"Dimension mismatch "
821 mOut.indent() << "}\n\n";
825 mOut.indent() << "// Verify that \"" << ArrayName << "\" is non-null.\n";
826 mOut.indent() << "if (" << ArrayName << " == null) {\n";
827 mOut.indent() << " throw new RSIllegalArgumentException(\"Array \\\""
829 mOut.indent() << "}\n";
834 mOut.indent() << "// Verify that the array length is a multiple of the vector size.\n";
835 mOut.indent() << "if (" << ArrayName << ".length % " << std::to_string(VecSize)
837 mOut.indent() << " throw new RSIllegalArgumentException(\"Array \\\"" << ArrayName
840 mOut.indent() << "}\n";
847 mOut.indent() << "//private final static int "
853 mOut.indent() << "private final static int " << RS_EXPORT_FOREACH_INDEX_PREFIX
899 mOut.indent() << "return createKernelID(" << RS_EXPORT_FOREACH_INDEX_PREFIX
910 mOut.indent() << "forEach_" << EF->getName();
911 mOut << "(";
914 mOut << "ain, ";
920 mOut << "ain_" << (*BI)->getName().str() << ", ";
925 mOut << "aout, ";
929 mOut << Args.back().second << ", ";
933 mOut << "null);\n";
965 mOut.indent() << "Type t0, t1;";
969 mOut.indent() << "Type t0, t1;";
988 mOut.indent() << "forEach(" << RS_EXPORT_FOREACH_INDEX_PREFIX
992 mOut << ", ain";
994 mOut << ", new Allocation[]{ain_" << Ins[0]->getName().str();
997 mOut << ", ain_" << Ins[index]->getName().str();
1000 mOut << "}";
1003 mOut << ", (Allocation) null";
1007 mOut << ", aout";
1009 mOut << ", null";
1012 mOut << ", " << FieldPackerName;
1014 mOut << ", null";
1017 mOut << ", sc);\n";
1019 mOut << ");\n";
1083 mOut.indent() << "private final static int " << RS_EXPORT_REDUCE_INDEX_PREFIX
1191 mOut.indent() << "// " << InComment << "\n";
1211 mOut.indent() << "// Verify that input array lengths are the same.\n";
1212 mOut.indent() << "if (" << In1Length << " != " << InLength << ") {\n";
1213 mOut.indent() << " throw new RSRuntimeException(\"Array length mismatch "
1216 mOut.indent() << "}\n";
1220 mOut.indent() << "Allocation " << TempName << " = Allocation.createSized("
1224 mOut.indent() << TempName << ".setAutoPadding(true);\n";
1225 mOut.indent() << TempName << ".copyFrom(" << ArgName << ");\n";
1234 mOut << "\n";
1235 mOut.indent() << ResultTypeName << " result = " << MethodName << "(" << InputAllocationOutgoingArgumentList << ", null);\n";
1237 mOut.indent() << "result.mTempIns = new Allocation[]{";
1243 mOut << ", ";
1245 mOut << InputAllocationName;
1247 mOut << "};\n";
1249 mOut.indent() << "return result;\n";
1273 mOut.indent() << "// " << InComment << "\n";
1275 mOut.indent() << "return " << MethodName << "(";
1281 mOut << ", ";
1283 mOut << Arg.second;
1285 mOut << ", null);\n";
1293 mOut.indent() << "// " << InComment << "\n";
1298 mOut.indent() << "Type t0, t1;\n";
1311 mOut.indent() << "Allocation " << OutputAllocName << " = Allocation.createSized("
1315 mOut.indent() << OutputAllocName << ".setAutoPadding(true);\n";
1317 mOut.indent() << "reduce(" << RS_EXPORT_REDUCE_INDEX_PREFIX << ER->getNameReduce()
1320 mOut << ", " << Args[InIdx].second;
1321 mOut << "}, " << OutputAllocName << ", " << FormalOptionsName << ");\n";
1322 mOut.indent() << "return new " << ResultTypeName << "(" << OutputAllocName << ");\n";
1410 mOut.indent() << "// To obtain the result, invoke get(), which blocks\n";
1411 mOut.indent() << "// until the asynchronously-launched operation has completed.\n";
1412 mOut.indent() << "public static class " << ClassName;
1413 mOut.startBlock();
1436 mOut.indent() << "if (!mGotResult)";
1437 mOut.startBlock();
1441 // mOut.copyTo(outArray);
1442 mOut.indent() << ArrayElementTypeName << "[] outArray = new " << ArrayElementTypeName
1444 mOut.indent() << "mOut.copyTo(outArray);\n";
1448 genReduceResultRangeCheck(mOut, "outArray[0]");
1449 mOut.indent() << "mResult = "
1456 mOut.indent() << "mResult = outArray;\n";
1463 mOut.indent() << GetTypeName(ResultType) << " result = new "
1467 mOut.indent() << "for (int Idx = 0; Idx < " << TypeData.arraySize << "; ++Idx)";
1468 mOut.startBlock();
1470 genReduceResultRangeCheck(mOut, "outArray[Idx]");
1472 mOut.indent() << "result[Idx] = "
1477 mOut.endBlock();
1478 mOut.indent() << "mResult = " << (MFA == MapFromAllocationPositive ? "outArray" : "result") << ";\n";
1483 // mOut.copyTo(outArray);
1486 mOut.indent() << ArrayElementTypeName << "[] outArray = new " << ArrayElementTypeName
1488 mOut.indent() << "mOut.copyTo(outArray);\n";
1490 mOut.indent() << "for (int Idx = 0; Idx < " << OutArrayElementCount << "; ++Idx)";
1491 mOut.startBlock();
1492 genReduceResultRangeCheck(mOut, "outArray[Idx]");
1493 mOut.endBlock();
1497 mOut.indent() << "mResult = "
1509 mOut.indent() << GetTypeName(ResultType) << " result = new "
1512 mOut.indent() << "for (int Idx = 0; Idx < " << TypeData.arraySize << "; ++Idx)";
1513 mOut.startBlock();
1514 mOut.indent() << "result[Idx] = "
1520 mOut.endBlock();
1521 mOut.indent() << "mResult = result;\n";
1525 mOut.indent() << "mOut.destroy();\n";
1526 mOut.indent() << "mOut = null; // make Java object eligible for garbage collection\n";
1527 mOut.indent() << "if (mTempIns != null)";
1528 mOut.startBlock();
1529 mOut.indent() << "for (Allocation tempIn : mTempIns)";
1530 mOut.startBlock();
1531 mOut.indent() << "tempIn.destroy();\n";
1532 mOut.endBlock();
1533 mOut.indent() << "mTempIns = null; // make Java objects eligible for garbage collection\n";
1534 mOut.endBlock();
1535 mOut.indent() << "mGotResult = true;\n";
1536 mOut.endBlock();
1538 mOut.indent() << "return mResult;\n";
1545 mOut.indent() << "mTempIns = null;\n";
1546 mOut.indent() << "mOut = out;\n";
1547 mOut.indent() << "mGotResult = false;\n";
1549 mOut.indent() << "private Allocation[] mTempIns;\n";
1550 mOut.indent() << "private Allocation mOut;\n";
1554 mOut.indent() << "private boolean mGotResult;\n";
1555 mOut.indent() << "private " << GetMethodReturnTypeName << " mResult;\n";
1556 mOut.endBlock();
1580 mOut.indent() << RS_ELEM_PREFIX << TypeName << " = Element." << TypeName
1589 mOut.indent() << RS_ELEM_PREFIX << ClassName << " = " << ClassName
1618 mOut.indent() << "// check " << VarName << "\n";
1641 mOut.indent() << "if (!" << VarName
1644 mOut.indent() << " throw new RSRuntimeException(\"Type mismatch with "
1646 mOut.indent() << "}\n";
1663 mOut.indent() << "public final static " << TypeName
1667 mOut << ";\n";
1683 mOut.indent() << "if (" << FPName << "!= null) {\n";
1684 mOut.increaseIndent();
1685 mOut.indent() << FPName << ".reset();\n";
1686 mOut.decreaseIndent();
1687 mOut.indent() << "} else {\n";
1688 mOut.increaseIndent();
1689 mOut.indent() << FPName << " = new FieldPacker(" << EPT->getElementSizeInBytes()
1691 mOut.decreaseIndent();
1692 mOut.indent() << "}\n";
1695 mOut.indent() << "setVar(" << RS_EXPORT_VAR_INDEX_PREFIX << VarName
1698 mOut.indent() << "setVar(" << RS_EXPORT_VAR_INDEX_PREFIX << VarName
1704 mOut.indent() << RS_EXPORT_VAR_PREFIX << VarName << " = v;\n";
1718 mOut << ((api.getSExtValue() == 0) ? "false" : "true");
1721 mOut << api.getSExtValue();
1723 mOut << "L";
1733 mOut << s.c_str();
1736 mOut << ".f";
1738 mOut << "f";
1773 mOut.indent() << RS_EXPORT_VAR_PREFIX << VarName << " = v;\n";
1774 mOut.indent() << "if (v == null) bindAllocation(null, "
1778 mOut.indent() << "else bindAllocation(v.getAllocation(), "
1781 mOut.indent() << "else bindAllocation(v, " << RS_EXPORT_VAR_INDEX_PREFIX
1818 mOut.indent() << RS_EXPORT_VAR_PREFIX << VarName << " = v;\n";
1822 mOut.indent() << "setVar(" RS_EXPORT_VAR_INDEX_PREFIX << VarName << ", "
1863 mOut.indent() << "private " << TypeName << " " << RS_EXPORT_VAR_PREFIX
1877 mOut.indent() << RS_EXPORT_VAR_PREFIX << VarName << " = v;\n";
1884 mOut.indent() << "setVar(" << RS_EXPORT_VAR_INDEX_PREFIX << VarName
1889 mOut.indent() << "int []__dimArr = new int[1];\n";
1890 mOut.indent() << "__dimArr[0] = " << Dimension << ";\n";
1891 mOut.indent() << "setVar(" << RS_EXPORT_VAR_INDEX_PREFIX << VarName
1904 mOut.indent() << "return " << RS_EXPORT_VAR_PREFIX << VarName << ";\n";
1915 mOut.indent() << "return createFieldID(" << RS_EXPORT_VAR_INDEX_PREFIX
1928 mOut.indent() << "FieldPacker " << FieldPackerName << " = new FieldPacker("
1941 mOut.indent() << FieldPackerName << "."
1953 mOut.indent() << FieldPackerName << ".addI32(" << VarName
1956 mOut.indent() << FieldPackerName << ".addI32(" << VarName
1962 mOut.indent() << FieldPackerName << ".addMatrix(" << VarName << ");\n";
1985 mOut.indent() << "for (int " << IndexVarName << " = 0; " << IndexVarName
1987 mOut.startBlock();
1993 mOut.endBlock();
2017 mOut.indent() << FieldPackerName << ".skip(" << (FieldOffset - Pos)
2025 mOut.indent() << FieldPackerName << ".skip("
2034 mOut.indent() << FieldPackerName << ".skip(" << ERT->getAllocSize() - Pos
2051 // mOut.indent() << VarName << " = new " << GetTypeName(T) << "();\n";
2058 mOut.indent() << VarName << " = null;\n";
2066 mOut.indent() << VarName << " = new " << GetTypeName(ElementType) << "["
2071 mOut.indent() << "for (int $ct = 0; $ct < " << ECAT->getNumElement()
2073 mOut.startBlock();
2079 mOut.endBlock();
2086 mOut.indent() << VarName << " = new " << GetTypeName(T) << "();\n";
2093 mOut.indent() << "if (" << RS_TYPE_ITEM_BUFFER_NAME " == null) ";
2094 mOut << RS_TYPE_ITEM_BUFFER_NAME << " = new " << RS_TYPE_ITEM_CLASS_NAME
2097 mOut.indent() << "if (" << RS_TYPE_ITEM_BUFFER_NAME << "[" << Index
2099 mOut << RS_TYPE_ITEM_BUFFER_NAME << "[" << Index << "] = new "
2105 mOut.indent() << "if (" << RS_TYPE_ITEM_BUFFER_PACKER_NAME << " == null) ";
2106 mOut << RS_TYPE_ITEM_BUFFER_PACKER_NAME " = new FieldPacker("
2126 mOut.indent() << "private " << RS_TYPE_ITEM_CLASS_NAME << " "
2128 mOut.indent() << "private FieldPacker " << RS_TYPE_ITEM_BUFFER_PACKER_NAME
2130 mOut.indent() << "private static java.lang.ref.WeakReference<Element> "
2156 mOut.indent() << "static public class " RS_TYPE_ITEM_CLASS_NAME;
2157 mOut.startBlock();
2161 mOut.indent() << "public static final int sizeof = " << ERT->getAllocSize()
2166 mOut << "\n";
2170 mOut.indent() << GetTypeName((*FI)->getType()) << " " << (*FI)->getName()
2175 mOut << "\n";
2176 mOut.indent() << RS_TYPE_ITEM_CLASS_NAME << "()";
2177 mOut.startBlock();
2187 mOut.endBlock();
2190 mOut.endBlock();
2200 // mOut.indent() << "Element e = " << RS_TYPE_ELEMENT_REF_NAME
2202 // mOut.indent() << "if (e != null) return e;\n";
2203 RSReflectionJavaElementBuilder builder("eb", ERT, RenderScriptVar, &mOut,
2207 mOut.indent() << "return eb.create();\n";
2208 // mOut.indent() << "e = eb.create();\n";
2209 // mOut.indent() << RS_TYPE_ELEMENT_REF_NAME
2211 // mOut.indent() << "return e;\n";
2217 mOut.indent() << RS_TYPE_ITEM_BUFFER_NAME << " = null;\n";
2218 mOut.indent() << RS_TYPE_ITEM_BUFFER_PACKER_NAME << " = null;\n";
2219 mOut.indent() << "mElement = createElement(" << RenderScriptVar << ");\n";
2226 mOut.indent() << RS_TYPE_ITEM_BUFFER_NAME << " = null;\n";
2227 mOut.indent() << RS_TYPE_ITEM_BUFFER_PACKER_NAME << " = null;\n";
2228 mOut.indent() << "mElement = createElement(" << RenderScriptVar << ");\n";
2230 mOut.indent() << "init(" << RenderScriptVar << ", count);\n";
2237 mOut.indent() << RS_TYPE_ITEM_BUFFER_NAME << " = null;\n";
2238 mOut.indent() << RS_TYPE_ITEM_BUFFER_PACKER_NAME << " = null;\n";
2239 mOut.indent() << "mElement = createElement(" << RenderScriptVar << ");\n";
2241 mOut.indent() << "init(" << RenderScriptVar << ", count, usages);\n";
2248 mOut.indent() << getClassName() << " obj = new " << getClassName() << "("
2250 mOut.indent() << "obj.mAllocation = Allocation.createSized("
2252 mOut.indent() << "return obj;\n";
2258 mOut.indent() << "return create1D(" << RenderScriptVar
2265 mOut.indent() << "return create2D(" << RenderScriptVar
2274 mOut.indent() << getClassName() << " obj = new " << getClassName() << "("
2276 mOut.indent() << "Type.Builder b = new Type.Builder(rs, obj.mElement);\n";
2277 mOut.indent() << "b.setX(dimX);\n";
2278 mOut.indent() << "b.setY(dimY);\n";
2279 mOut.indent() << "Type t = b.create();\n";
2280 mOut.indent() << "obj.mAllocation = Allocation.createTyped(rs, t, usages);\n";
2281 mOut.indent() << "return obj;\n";
2287 mOut.indent() << "Element e = createElement(" << RenderScriptVar << ");\n";
2288 mOut.indent() << "return new Type.Builder(rs, e);\n";
2295 mOut.indent() << getClassName() << " obj = new " << getClassName() << "("
2297 mOut.indent() << "Type t = tb.create();\n";
2298 mOut.indent() << "if (t.getElement() != obj.mElement) {\n";
2299 mOut.indent() << " throw new RSIllegalArgumentException("
2301 mOut.indent() << "}\n";
2302 mOut.indent() << "obj.mAllocation = Allocation.createTyped(rs, t, usages);\n";
2303 mOut.indent() << "return obj;\n";
2312 mOut.indent() << RS_TYPE_ITEM_BUFFER_PACKER_NAME << ".reset(index * "
2315 mOut.indent() << "copyToArrayLocal(i, " RS_TYPE_ITEM_BUFFER_PACKER_NAME
2336 mOut.indent() << RS_TYPE_ITEM_BUFFER_NAME << "[index] = i;\n";
2338 mOut.indent() << "if (copyNow) ";
2339 mOut.startBlock();
2341 mOut.indent() << "copyToArray(i, index);\n";
2342 mOut.indent() << "FieldPacker fp = new FieldPacker(" << mItemSizeof << ");\n";
2343 mOut.indent() << "copyToArrayLocal(i, fp);\n";
2344 mOut.indent() << "mAllocation.setFromFieldPacker(index, fp);\n";
2347 mOut.endBlock();
2355 mOut.indent() << "if (" << RS_TYPE_ITEM_BUFFER_NAME
2357 mOut.indent() << "return " << RS_TYPE_ITEM_BUFFER_NAME << "[index];\n";
2376 mOut.indent() << RS_TYPE_ITEM_BUFFER_NAME << "[index]." << F->getName()
2379 mOut.indent() << "if (copyNow) ";
2380 mOut.startBlock();
2383 mOut.indent() << RS_TYPE_ITEM_BUFFER_PACKER_NAME << ".reset(index * "
2387 mOut.indent() << RS_TYPE_ITEM_BUFFER_PACKER_NAME << ".reset(index * "
2392 mOut.indent() << "FieldPacker fp = new FieldPacker(" << FieldStoreSize
2395 mOut.indent() << "mAllocation.setFromFieldPacker(index, " << FieldIndex
2399 mOut.endBlock();
2414 mOut.indent() << "if (" RS_TYPE_ITEM_BUFFER_NAME << " == null) return "
2416 mOut.indent() << "return " RS_TYPE_ITEM_BUFFER_NAME << "[index]."
2425 mOut.indent() << "for (int ct = 0; ct < " << RS_TYPE_ITEM_BUFFER_NAME
2429 mOut.indent() << "mAllocation.setFromFieldPacker(0, "
2439 mOut.indent() << "if (mItemArray != null) ";
2440 mOut.startBlock();
2441 mOut.indent() << "int oldSize = mItemArray.length;\n";
2442 mOut.indent() << "int copySize = Math.min(oldSize, newSize);\n";
2443 mOut.indent() << "if (newSize == oldSize) return;\n";
2444 mOut.indent() << "Item ni[] = new Item[newSize];\n";
2445 mOut.indent() << "System.arraycopy(mItemArray, 0, ni, 0, copySize);\n";
2446 mOut.indent() << "mItemArray = ni;\n";
2447 mOut.endBlock();
2448 mOut.indent() << "mAllocation.resize(newSize);\n";
2450 mOut.indent() << "if (" RS_TYPE_ITEM_BUFFER_PACKER_NAME
2466 mRenderScriptVar(RenderScriptVar), mOut(Out), mPaddingFieldIndex(1),
2476 mOut->indent() << "Element.Builder " << mElementBuilderName
2488 *mOut << ElementConstruct << "(" << mRenderScriptVar << ")";
2499 *mOut << "Element.createUser(" << mRenderScriptVar
2510 *mOut << "Element.createVector(" << mRenderScriptVar
2540 mRenderScriptVar, mOut, mRSContext, mReflection);
2545 *mOut << NewElementBuilderName << ".create()";
2588 mRenderScriptVar, mOut, mRSContext, mReflection);
2592 *mOut << NewElementBuilderName << ".create()";
2623 *mOut << "Element.U32(" << mRenderScriptVar << ")";
2626 *mOut << "Element.U16(" << mRenderScriptVar << ")";
2629 *mOut << "Element.U8(" << mRenderScriptVar << ")";
2637 mOut->indent() << mElementBuilderName << ".add(";
2643 *mOut << ", \"" << VarName << "\"";
2645 *mOut << ", " << ArraySize;
2647 *mOut << ");\n";
2714 if (!mOut.startFile(mOutputDirectory, FileName, mRSSourceFileName,
2722 mOut << "package " << mPackageName << ";\n";
2724 mOut << "\n";
2727 mOut << "import " << mRSPackageName << ".*;\n";
2729 mOut << "import " << mPackageName << "."
2733 mOut << "import android.content.res.Resources;\n";
2735 mOut << "\n";
2739 mOut << "/**\n";
2740 mOut << " * @hide\n";
2741 mOut << " */\n";
2743 mOut << AccessModifierStr(AM) << ((IsStatic) ? " static" : "") << " class "
2746 mOut << " extends " << SuperClassName;
2748 mOut.startBlock();
2756 mOut.endBlock();
2757 mOut.closeFile();
2762 mOut.indent() << "public static class " << ClassName;
2763 mOut.startBlock();
2766 void RSReflectionJava::endTypeClass() { mOut.endBlock(); }
2791 mOut.indent() << AccessModifierStr(AM) << ((IsStatic) ? " static " : " ")
2798 mOut << ", ";
2802 mOut << I->first << " " << I->second;
2805 mOut << ")";
2806 mOut.startBlock();
2809 void RSReflectionJava::endFunction() { mOut.endBlock(); }