Making Program*.Builder classes' setters return 'this'
This is for better correspondence with the Builder pattern. See also: Effective Java, 2nd edition. Change-Id: Iecccd42be49dea2ed8e4b8cc38ce96379cf3c11c
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user