summaryrefslogtreecommitdiffstats
path: root/graphics/java/android/renderscript/Sampler.java
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/java/android/renderscript/Sampler.java')
-rw-r--r--graphics/java/android/renderscript/Sampler.java76
1 files changed, 74 insertions, 2 deletions
diff --git a/graphics/java/android/renderscript/Sampler.java b/graphics/java/android/renderscript/Sampler.java
index 40ba722..ccd46bd 100644
--- a/graphics/java/android/renderscript/Sampler.java
+++ b/graphics/java/android/renderscript/Sampler.java
@@ -47,10 +47,82 @@ public class Sampler extends BaseObj {
}
Sampler(int id, RenderScript rs) {
- super(rs);
- mID = id;
+ super(id, rs);
}
+ public static Sampler CLAMP_NEAREST(RenderScript rs) {
+ if(rs.mSampler_CLAMP_NEAREST == null) {
+ Builder b = new Builder(rs);
+ b.setMin(Value.NEAREST);
+ b.setMag(Value.NEAREST);
+ b.setWrapS(Value.CLAMP);
+ b.setWrapT(Value.CLAMP);
+ rs.mSampler_CLAMP_NEAREST = b.create();
+ }
+ return rs.mSampler_CLAMP_NEAREST;
+ }
+
+ public static Sampler CLAMP_LINEAR(RenderScript rs) {
+ if(rs.mSampler_CLAMP_LINEAR == null) {
+ Builder b = new Builder(rs);
+ b.setMin(Value.LINEAR);
+ b.setMag(Value.LINEAR);
+ b.setWrapS(Value.CLAMP);
+ b.setWrapT(Value.CLAMP);
+ rs.mSampler_CLAMP_LINEAR = b.create();
+ }
+ return rs.mSampler_CLAMP_LINEAR;
+ }
+
+ public static Sampler CLAMP_LINEAR_MIP_LINEAR(RenderScript rs) {
+ if(rs.mSampler_CLAMP_LINEAR_MIP_LINEAR == null) {
+ Builder b = new Builder(rs);
+ b.setMin(Value.LINEAR_MIP_LINEAR);
+ b.setMag(Value.LINEAR_MIP_LINEAR);
+ b.setWrapS(Value.CLAMP);
+ b.setWrapT(Value.CLAMP);
+ rs.mSampler_CLAMP_LINEAR_MIP_LINEAR = b.create();
+ }
+ return rs.mSampler_CLAMP_LINEAR_MIP_LINEAR;
+ }
+
+ public static Sampler WRAP_NEAREST(RenderScript rs) {
+ if(rs.mSampler_WRAP_NEAREST == null) {
+ Builder b = new Builder(rs);
+ b.setMin(Value.NEAREST);
+ b.setMag(Value.NEAREST);
+ b.setWrapS(Value.WRAP);
+ b.setWrapT(Value.WRAP);
+ rs.mSampler_WRAP_NEAREST = b.create();
+ }
+ return rs.mSampler_WRAP_NEAREST;
+ }
+
+ public static Sampler WRAP_LINEAR(RenderScript rs) {
+ if(rs.mSampler_WRAP_LINEAR == null) {
+ Builder b = new Builder(rs);
+ b.setMin(Value.LINEAR);
+ b.setMag(Value.LINEAR);
+ b.setWrapS(Value.WRAP);
+ b.setWrapT(Value.WRAP);
+ rs.mSampler_WRAP_LINEAR = b.create();
+ }
+ return rs.mSampler_WRAP_LINEAR;
+ }
+
+ public static Sampler WRAP_LINEAR_MIP_LINEAR(RenderScript rs) {
+ if(rs.mSampler_WRAP_LINEAR_MIP_LINEAR == null) {
+ Builder b = new Builder(rs);
+ b.setMin(Value.LINEAR_MIP_LINEAR);
+ b.setMag(Value.LINEAR_MIP_LINEAR);
+ b.setWrapS(Value.WRAP);
+ b.setWrapT(Value.WRAP);
+ rs.mSampler_WRAP_LINEAR_MIP_LINEAR = b.create();
+ }
+ return rs.mSampler_WRAP_LINEAR_MIP_LINEAR;
+ }
+
+
public static class Builder {
RenderScript mRS;
Value mMin;