Merge "Making Program*.Builder classes' setters return 'this'"
This commit is contained in:
@@ -91,8 +91,9 @@ public class Program extends BaseObj {
|
||||
mTextureCount = 0;
|
||||
}
|
||||
|
||||
public void setShader(String s) {
|
||||
public BaseProgramBuilder setShader(String s) {
|
||||
mShader = s;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void addInput(Element e) throws IllegalStateException {
|
||||
@@ -120,12 +121,13 @@ public class Program extends BaseObj {
|
||||
return mConstantCount++;
|
||||
}
|
||||
|
||||
public void setTextureCount(int count) throws IllegalArgumentException {
|
||||
public BaseProgramBuilder setTextureCount(int count) throws IllegalArgumentException {
|
||||
// Should check for consistant and non-conflicting names...
|
||||
if(count >= MAX_CONSTANT) {
|
||||
throw new IllegalArgumentException("Max texture count exceeded.");
|
||||
}
|
||||
mTextureCount = count;
|
||||
return this;
|
||||
}
|
||||
|
||||
protected void initProgram(Program p) {
|
||||
|
||||
@@ -106,16 +106,18 @@ public class ProgramFragment extends Program {
|
||||
mPointSpriteEnable = false;
|
||||
}
|
||||
|
||||
public void setTexture(EnvMode env, Format fmt, int slot)
|
||||
public Builder setTexture(EnvMode env, Format fmt, int slot)
|
||||
throws IllegalArgumentException {
|
||||
if((slot < 0) || (slot >= MAX_TEXTURE)) {
|
||||
throw new IllegalArgumentException("MAX_TEXTURE exceeded.");
|
||||
}
|
||||
mSlots[slot] = new Slot(env, fmt);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setPointSpriteTexCoordinateReplacement(boolean enable) {
|
||||
public Builder setPointSpriteTexCoordinateReplacement(boolean enable) {
|
||||
mPointSpriteEnable = enable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ProgramFragment create() {
|
||||
|
||||
@@ -89,16 +89,19 @@ public class ProgramRaster extends BaseObj {
|
||||
mPointSprite = false;
|
||||
}
|
||||
|
||||
public void setPointSpriteEnable(boolean enable) {
|
||||
public Builder setPointSpriteEnable(boolean enable) {
|
||||
mPointSprite = enable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setPointSmoothEnable(boolean enable) {
|
||||
public Builder setPointSmoothEnable(boolean enable) {
|
||||
mPointSmooth = enable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setLineSmoothEnable(boolean enable) {
|
||||
public Builder setLineSmoothEnable(boolean enable) {
|
||||
mLineSmooth = enable;
|
||||
return this;
|
||||
}
|
||||
|
||||
static synchronized ProgramRaster internalCreate(RenderScript rs, Builder b) {
|
||||
|
||||
@@ -114,28 +114,33 @@ public class ProgramStore extends BaseObj {
|
||||
|
||||
}
|
||||
|
||||
public void setDepthFunc(DepthFunc func) {
|
||||
public Builder setDepthFunc(DepthFunc func) {
|
||||
mDepthFunc = func;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setDepthMask(boolean enable) {
|
||||
public Builder setDepthMask(boolean enable) {
|
||||
mDepthMask = enable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setColorMask(boolean r, boolean g, boolean b, boolean a) {
|
||||
public Builder setColorMask(boolean r, boolean g, boolean b, boolean a) {
|
||||
mColorMaskR = r;
|
||||
mColorMaskG = g;
|
||||
mColorMaskB = b;
|
||||
mColorMaskA = a;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setBlendFunc(BlendSrcFunc src, BlendDstFunc dst) {
|
||||
public Builder setBlendFunc(BlendSrcFunc src, BlendDstFunc dst) {
|
||||
mBlendSrc = src;
|
||||
mBlendDst = dst;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setDitherEnable(boolean enable) {
|
||||
public Builder setDitherEnable(boolean enable) {
|
||||
mDither = enable;
|
||||
return this;
|
||||
}
|
||||
|
||||
static synchronized ProgramStore internalCreate(RenderScript rs, Builder b) {
|
||||
|
||||
@@ -47,8 +47,9 @@ public class ProgramVertex extends Program {
|
||||
mRS = rs;
|
||||
}
|
||||
|
||||
public void setTextureMatrixEnable(boolean enable) {
|
||||
public Builder setTextureMatrixEnable(boolean enable) {
|
||||
mTextureMatrixEnable = enable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ProgramVertex create() {
|
||||
|
||||
Reference in New Issue
Block a user