diff options
Diffstat (limited to 'graphics/java/android/renderscript/ProgramFragmentFixedFunction.java')
-rw-r--r-- | graphics/java/android/renderscript/ProgramFragmentFixedFunction.java | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java b/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java index 0ab73c1b222b..19fca5873b51 100644 --- a/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java +++ b/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java @@ -20,7 +20,7 @@ package android.renderscript; import android.util.Log; -/** +/** @deprecated renderscript is deprecated in J * <p>ProgramFragmentFixedFunction is a helper class that provides * a way to make a simple fragment shader without writing any * GLSL code. This class allows for display of constant color, interpolated @@ -38,7 +38,7 @@ public class ProgramFragmentFixedFunction extends ProgramFragment { super(rs); } - /** + /** @deprecated renderscript is deprecated in J * Creates ProgramFragmentFixedFunction from the current state * of the builder * @@ -47,26 +47,28 @@ public class ProgramFragmentFixedFunction extends ProgramFragment { public ProgramFragmentFixedFunction create() { mRS.validate(); int[] tmp = new int[(mInputCount + mOutputCount + mConstantCount + mTextureCount) * 2]; + String[] texNames = new String[mTextureCount]; int idx = 0; for (int i=0; i < mInputCount; i++) { tmp[idx++] = ProgramParam.INPUT.mID; - tmp[idx++] = mInputs[i].getID(); + tmp[idx++] = mInputs[i].getID(mRS); } for (int i=0; i < mOutputCount; i++) { tmp[idx++] = ProgramParam.OUTPUT.mID; - tmp[idx++] = mOutputs[i].getID(); + tmp[idx++] = mOutputs[i].getID(mRS); } for (int i=0; i < mConstantCount; i++) { tmp[idx++] = ProgramParam.CONSTANT.mID; - tmp[idx++] = mConstants[i].getID(); + tmp[idx++] = mConstants[i].getID(mRS); } for (int i=0; i < mTextureCount; i++) { tmp[idx++] = ProgramParam.TEXTURE_TYPE.mID; tmp[idx++] = mTextureTypes[i].mID; + texNames[i] = mTextureNames[i]; } - int id = mRS.nProgramFragmentCreate(mShader, tmp); + int id = mRS.nProgramFragmentCreate(mShader, texNames, tmp); ProgramFragmentFixedFunction pf = new ProgramFragmentFixedFunction(id, mRS); initProgram(pf); return pf; @@ -74,6 +76,8 @@ public class ProgramFragmentFixedFunction extends ProgramFragment { } public static class Builder { + /** @deprecated renderscript is deprecated in J + */ public static final int MAX_TEXTURE = 2; int mNumTextures; boolean mPointSpriteEnable; @@ -81,14 +85,20 @@ public class ProgramFragmentFixedFunction extends ProgramFragment { String mShader; RenderScript mRS; - /** + /** @deprecated renderscript is deprecated in J * EnvMode describes how textures are combined with the existing * color in the fixed function fragment shader * **/ public enum EnvMode { + /** @deprecated renderscript is deprecated in J + */ REPLACE (1), + /** @deprecated renderscript is deprecated in J + */ MODULATE (2), + /** @deprecated renderscript is deprecated in J + */ DECAL (3); int mID; @@ -97,15 +107,23 @@ public class ProgramFragmentFixedFunction extends ProgramFragment { } } - /** + /** @deprecated renderscript is deprecated in J * Format describes the pixel format of textures in the fixed * function fragment shader and how they are sampled * **/ public enum Format { + /** @deprecated renderscript is deprecated in J + */ ALPHA (1), + /** @deprecated renderscript is deprecated in J + */ LUMINANCE_ALPHA (2), + /** @deprecated renderscript is deprecated in J + */ RGB (3), + /** @deprecated renderscript is deprecated in J + */ RGBA (4); int mID; @@ -188,7 +206,7 @@ public class ProgramFragmentFixedFunction extends ProgramFragment { mShader += "}\n"; } - /** + /** @deprecated renderscript is deprecated in J * Creates a builder for fixed function fragment program * * @param rs Context to which the program will belong. @@ -199,7 +217,7 @@ public class ProgramFragmentFixedFunction extends ProgramFragment { mPointSpriteEnable = false; } - /** + /** @deprecated renderscript is deprecated in J * Adds a texture to be fetched as part of the fixed function * fragment program * @@ -221,7 +239,7 @@ public class ProgramFragmentFixedFunction extends ProgramFragment { return this; } - /** + /** @deprecated renderscript is deprecated in J * Specifies whether the texture coordinate passed from the * vertex program is replaced with an openGL internal point * sprite texture coordinate @@ -232,7 +250,7 @@ public class ProgramFragmentFixedFunction extends ProgramFragment { return this; } - /** + /** @deprecated renderscript is deprecated in J * Specifies whether the varying color passed from the vertex * program or the constant color set on the fragment program is * used in the final color calculation in the fixed function @@ -244,7 +262,7 @@ public class ProgramFragmentFixedFunction extends ProgramFragment { return this; } - /** + /** @deprecated renderscript is deprecated in J * Creates the fixed function fragment program from the current * state of the builder. * |