Add MIRRORED_REPEAT.
Change-Id: I7565da24912a3c33d8f824da9ea0899a423d3c40
diff --git a/api/current.txt b/api/current.txt
index ee4732d..cd0e51d 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -20070,6 +20070,9 @@
method public static android.renderscript.Sampler CLAMP_LINEAR(android.renderscript.RenderScript);
method public static android.renderscript.Sampler CLAMP_LINEAR_MIP_LINEAR(android.renderscript.RenderScript);
method public static android.renderscript.Sampler CLAMP_NEAREST(android.renderscript.RenderScript);
+ method public static android.renderscript.Sampler MIRRORED_REPEAT_LINEAR(android.renderscript.RenderScript);
+ method public static android.renderscript.Sampler MIRRORED_REPEAT_LINEAR_MIP_LINEAR(android.renderscript.RenderScript);
+ method public static android.renderscript.Sampler MIRRORED_REPEAT_NEAREST(android.renderscript.RenderScript);
method public static android.renderscript.Sampler WRAP_LINEAR(android.renderscript.RenderScript);
method public static android.renderscript.Sampler WRAP_LINEAR_MIP_LINEAR(android.renderscript.RenderScript);
method public static android.renderscript.Sampler WRAP_NEAREST(android.renderscript.RenderScript);
@@ -20097,6 +20100,7 @@
enum_constant public static final android.renderscript.Sampler.Value LINEAR;
enum_constant public static final android.renderscript.Sampler.Value LINEAR_MIP_LINEAR;
enum_constant public static final android.renderscript.Sampler.Value LINEAR_MIP_NEAREST;
+ enum_constant public static final android.renderscript.Sampler.Value MIRRORED_REPEAT;
enum_constant public static final android.renderscript.Sampler.Value NEAREST;
enum_constant public static final android.renderscript.Sampler.Value WRAP;
}
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java
index 50d888f..a7a2dc8 100644
--- a/graphics/java/android/renderscript/RenderScript.java
+++ b/graphics/java/android/renderscript/RenderScript.java
@@ -795,6 +795,9 @@
Sampler mSampler_WRAP_NEAREST;
Sampler mSampler_WRAP_LINEAR;
Sampler mSampler_WRAP_LINEAR_MIP_LINEAR;
+ Sampler mSampler_MIRRORED_REPEAT_NEAREST;
+ Sampler mSampler_MIRRORED_REPEAT_LINEAR;
+ Sampler mSampler_MIRRORED_REPEAT_LINEAR_MIP_LINEAR;
ProgramStore mProgramStore_BLEND_NONE_DEPTH_TEST;
ProgramStore mProgramStore_BLEND_NONE_DEPTH_NO_DEPTH;
diff --git a/graphics/java/android/renderscript/Sampler.java b/graphics/java/android/renderscript/Sampler.java
index 0df1012..057e9b5 100644
--- a/graphics/java/android/renderscript/Sampler.java
+++ b/graphics/java/android/renderscript/Sampler.java
@@ -39,7 +39,8 @@
LINEAR_MIP_LINEAR (2),
LINEAR_MIP_NEAREST (5),
WRAP (3),
- CLAMP (4);
+ CLAMP (4),
+ MIRRORED_REPEAT (6);
int mID;
Value(int id) {
@@ -134,8 +135,8 @@
}
/**
- * Retrieve a sampler with ag set to linear, min linear mipmap linear, and
- * to and wrap modes set to clamp.
+ * Retrieve a sampler with mag set to linear, min linear mipmap linear, and
+ * wrap modes set to clamp.
*
* @param rs Context to which the sampler will belong.
*
@@ -174,7 +175,7 @@
}
/**
- * Retrieve a sampler with min and mag set to nearest and wrap modes set to
+ * Retrieve a sampler with min and mag set to linear and wrap modes set to
* wrap.
*
* @param rs Context to which the sampler will belong.
@@ -194,8 +195,8 @@
}
/**
- * Retrieve a sampler with ag set to linear, min linear mipmap linear, and
- * to and wrap modes set to wrap.
+ * Retrieve a sampler with mag set to linear, min linear mipmap linear, and
+ * wrap modes set to wrap.
*
* @param rs Context to which the sampler will belong.
*
@@ -213,6 +214,65 @@
return rs.mSampler_WRAP_LINEAR_MIP_LINEAR;
}
+ /**
+ * Retrieve a sampler with min and mag set to nearest and wrap modes set to
+ * mirrored repeat.
+ *
+ * @param rs Context to which the sampler will belong.
+ *
+ * @return Sampler
+ */
+ public static Sampler MIRRORED_REPEAT_NEAREST(RenderScript rs) {
+ if(rs.mSampler_MIRRORED_REPEAT_NEAREST == null) {
+ Builder b = new Builder(rs);
+ b.setMinification(Value.NEAREST);
+ b.setMagnification(Value.NEAREST);
+ b.setWrapS(Value.MIRRORED_REPEAT);
+ b.setWrapT(Value.MIRRORED_REPEAT);
+ rs.mSampler_MIRRORED_REPEAT_NEAREST = b.create();
+ }
+ return rs.mSampler_MIRRORED_REPEAT_NEAREST;
+ }
+
+ /**
+ * Retrieve a sampler with min and mag set to linear and wrap modes set to
+ * mirrored repeat.
+ *
+ * @param rs Context to which the sampler will belong.
+ *
+ * @return Sampler
+ */
+ public static Sampler MIRRORED_REPEAT_LINEAR(RenderScript rs) {
+ if(rs.mSampler_MIRRORED_REPEAT_LINEAR == null) {
+ Builder b = new Builder(rs);
+ b.setMinification(Value.LINEAR);
+ b.setMagnification(Value.LINEAR);
+ b.setWrapS(Value.MIRRORED_REPEAT);
+ b.setWrapT(Value.MIRRORED_REPEAT);
+ rs.mSampler_MIRRORED_REPEAT_LINEAR = b.create();
+ }
+ return rs.mSampler_MIRRORED_REPEAT_LINEAR;
+ }
+
+ /**
+ * Retrieve a sampler with min and mag set to linear and wrap modes set to
+ * mirrored repeat.
+ *
+ * @param rs Context to which the sampler will belong.
+ *
+ * @return Sampler
+ */
+ public static Sampler MIRRORED_REPEAT_LINEAR_MIP_LINEAR(RenderScript rs) {
+ if(rs.mSampler_MIRRORED_REPEAT_LINEAR_MIP_LINEAR == null) {
+ Builder b = new Builder(rs);
+ b.setMinification(Value.LINEAR_MIP_LINEAR);
+ b.setMagnification(Value.LINEAR);
+ b.setWrapS(Value.MIRRORED_REPEAT);
+ b.setWrapT(Value.MIRRORED_REPEAT);
+ rs.mSampler_MIRRORED_REPEAT_LINEAR_MIP_LINEAR = b.create();
+ }
+ return rs.mSampler_MIRRORED_REPEAT_LINEAR_MIP_LINEAR;
+ }
/**
* Builder for creating non-standard samplers. Usefull if mix and match of
@@ -258,7 +318,7 @@
}
public void setWrapS(Value v) {
- if (v == Value.WRAP || v == Value.CLAMP) {
+ if (v == Value.WRAP || v == Value.CLAMP || v == Value.MIRRORED_REPEAT) {
mWrapS = v;
} else {
throw new IllegalArgumentException("Invalid value");
@@ -266,7 +326,7 @@
}
public void setWrapT(Value v) {
- if (v == Value.WRAP || v == Value.CLAMP) {
+ if (v == Value.WRAP || v == Value.CLAMP || v == Value.MIRRORED_REPEAT) {
mWrapT = v;
} else {
throw new IllegalArgumentException("Invalid value");