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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user