diff options
author | Alex Sakhartchouk <alexst@google.com> | 2010-12-21 14:42:26 -0800 |
---|---|---|
committer | Alex Sakhartchouk <alexst@google.com> | 2010-12-21 14:57:04 -0800 |
commit | b4d7bb6872f523b4318144202e119766ed9054ed (patch) | |
tree | 2e7e18e9864c7c9398bbce8f0bc227f147b648f4 /graphics/java/android/renderscript/Program.java | |
parent | 1528d8f47cc6f0e0d5c9f905f82d15a35ce1bafb (diff) |
API cleanup for renderscript. This will be a multiproject commit.
Change-Id: Ida62d3a155285a20725be9daa62217faef1c3734
Diffstat (limited to 'graphics/java/android/renderscript/Program.java')
-rw-r--r-- | graphics/java/android/renderscript/Program.java | 44 |
1 files changed, 6 insertions, 38 deletions
diff --git a/graphics/java/android/renderscript/Program.java b/graphics/java/android/renderscript/Program.java index c3536c386875..a9eaec33385d 100644 --- a/graphics/java/android/renderscript/Program.java +++ b/graphics/java/android/renderscript/Program.java @@ -177,36 +177,15 @@ public class Program extends BaseObj { return this; } - public void addInput(Element e) throws IllegalStateException { - // Should check for consistant and non-conflicting names... - if(mInputCount >= MAX_INPUT) { - throw new RSIllegalArgumentException("Max input count exceeded."); - } - if (e.isComplex()) { - throw new RSIllegalArgumentException("Complex elements not allowed."); - } - mInputs[mInputCount++] = e; + public int getCurrentConstantIndex() { + return mConstantCount - 1; } - public void addOutput(Element e) throws IllegalStateException { - // Should check for consistant and non-conflicting names... - if(mOutputCount >= MAX_OUTPUT) { - throw new RSIllegalArgumentException("Max output count exceeded."); - } - if (e.isComplex()) { - throw new RSIllegalArgumentException("Complex elements not allowed."); - } - mOutputs[mOutputCount++] = e; + public int getCurrentTextureIndex() { + return mTextureCount - 1; } - void resetConstant() { - mConstantCount = 0; - for(int i = 0; i < MAX_CONSTANT; i ++) { - mConstants[i] = null; - } - } - - public int addConstant(Type t) throws IllegalStateException { + public BaseProgramBuilder addConstant(Type t) throws IllegalStateException { // Should check for consistant and non-conflicting names... if(mConstantCount >= MAX_CONSTANT) { throw new RSIllegalArgumentException("Max input count exceeded."); @@ -215,18 +194,7 @@ public class Program extends BaseObj { throw new RSIllegalArgumentException("Complex elements not allowed."); } mConstants[mConstantCount] = t; - return mConstantCount++; - } - - public BaseProgramBuilder setTextureCount(int count) throws IllegalArgumentException { - // Should check for consistant and non-conflicting names... - if(count >= MAX_TEXTURE) { - throw new IllegalArgumentException("Max texture count exceeded."); - } - mTextureCount = count; - for (int i = 0; i < mTextureCount; i ++) { - mTextureTypes[i] = TextureType.TEXTURE_2D; - } + mConstantCount++; return this; } |