public static AllocationAdapter create1D(RenderScript rs, Allocation a) {
   rs.validate();
   AllocationAdapter aa = new AllocationAdapter(0, rs, a);
   aa.mConstrainedLOD = true;
   aa.mConstrainedFace = true;
   aa.mConstrainedY = true;
   aa.mConstrainedZ = true;
   aa.initLOD(0);
   return aa;
 }
 public static AllocationAdapter create2D(RenderScript rs, Allocation a) {
   android.util.Log.e("rs", "create2d " + a);
   rs.validate();
   AllocationAdapter aa = new AllocationAdapter(0, rs, a);
   aa.mConstrainedLOD = true;
   aa.mConstrainedFace = true;
   aa.mConstrainedY = false;
   aa.mConstrainedZ = true;
   aa.initLOD(0);
   return aa;
 }
  /**
   * Set the active LOD. The LOD must be within the range for the type being adapted. The base
   * allocation must have mipmaps.
   *
   * <p>Because this changes the dimensions of the adapter the current Y and Z will be reset.
   *
   * @param lod The LOD to make active.
   */
  public void setLOD(int lod) {
    if (!mAdaptedAllocation.getType().hasMipmaps()) {
      throw new RSInvalidStateException(
          "Cannot set LOD when the allocation type does not include mipmaps.");
    }
    if (!mConstrainedLOD) {
      throw new RSInvalidStateException("Cannot set LOD when the adapter includes mipmaps.");
    }

    initLOD(lod);
  }