Rewrite the support lib to switch compat lib over to dispatch table.

  - Thunker classes are no longer needed.

Change-Id: If6f418828183ce18e307903e77ef1a5a5960a23a
diff --git a/v8/renderscript/Android.mk b/v8/renderscript/Android.mk
index c7e9268..58f7219 100644
--- a/v8/renderscript/Android.mk
+++ b/v8/renderscript/Android.mk
@@ -24,7 +24,7 @@
 LOCAL_CFLAGS += -std=c++11
 
 LOCAL_MODULE := android-support-v8-renderscript
-LOCAL_SDK_VERSION := 18
+LOCAL_SDK_VERSION := 19
 LOCAL_SRC_FILES := $(call all-java-files-under, java/src)
 
 include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/Allocation.java b/v8/renderscript/java/src/android/support/v8/renderscript/Allocation.java
index eec493c..fb28eb0 100644
--- a/v8/renderscript/java/src/android/support/v8/renderscript/Allocation.java
+++ b/v8/renderscript/java/src/android/support/v8/renderscript/Allocation.java
@@ -1207,10 +1207,6 @@
      *              utilized
      */
     static public Allocation createTyped(RenderScript rs, Type type, MipmapControl mips, int usage) {
-        if (rs.isNative) {
-            RenderScriptThunker rst = (RenderScriptThunker)rs;
-            return AllocationThunker.createTyped(rst, type, mips, usage);
-        }
         rs.validate();
         if (type.getID(rs) == 0) {
             throw new RSInvalidStateException("Bad Type");
@@ -1263,10 +1259,6 @@
      */
     static public Allocation createSized(RenderScript rs, Element e,
                                          int count, int usage) {
-        if (rs.isNative) {
-            RenderScriptThunker rst = (RenderScriptThunker)rs;
-            return AllocationThunker.createSized(rs, e, count, usage);
-        }
         rs.validate();
         Type.Builder b = new Type.Builder(rs, e);
         b.setX(count);
@@ -1335,10 +1327,6 @@
     static public Allocation createFromBitmap(RenderScript rs, Bitmap b,
                                               MipmapControl mips,
                                               int usage) {
-        if (rs.isNative) {
-            RenderScriptThunker rst = (RenderScriptThunker)rs;
-            return AllocationThunker.createFromBitmap(rst, b, mips, usage);
-        }
         rs.validate();
 
         // WAR undocumented color formats
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/AllocationThunker.java b/v8/renderscript/java/src/android/support/v8/renderscript/AllocationThunker.java
deleted file mode 100644
index 2ae7edf..0000000
--- a/v8/renderscript/java/src/android/support/v8/renderscript/AllocationThunker.java
+++ /dev/null
@@ -1,512 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.support.v8.renderscript;
-
-import java.io.IOException;
-import java.io.InputStream;
-import android.content.res.Resources;
-import android.content.res.AssetManager;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.view.Surface;
-import android.util.Log;
-import android.util.TypedValue;
-
-class AllocationThunker extends Allocation {
-    android.renderscript.Allocation mN;
-    //Allocation mAdaptedAllocation;
-
-    android.renderscript.Allocation getNObj() {
-        return mN;
-    }
-
-    static android.renderscript.Allocation.MipmapControl
-        convertMipmapControl(MipmapControl mc) {
-
-        switch(mc) {
-        case MIPMAP_NONE:
-            return android.renderscript.Allocation.MipmapControl.MIPMAP_NONE;
-        case MIPMAP_FULL:
-            return android.renderscript.Allocation.MipmapControl.MIPMAP_FULL;
-        case MIPMAP_ON_SYNC_TO_TEXTURE:
-            return android.renderscript.Allocation.MipmapControl.MIPMAP_ON_SYNC_TO_TEXTURE;
-        }
-        return null;
-    }
-
-    public Type getType() {
-        return TypeThunker.find(mN.getType());
-    }
-
-    public Element getElement() {
-        return getType().getElement();
-    }
-
-    public int getUsage() {
-        try {
-            return mN.getUsage();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public int getBytesSize() {
-        try {
-            return mN.getBytesSize();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    AllocationThunker(RenderScript rs, Type t, int usage, android.renderscript.Allocation na) {
-        super(0, rs, t, usage);
-
-        mType = t;
-        mUsage = usage;
-        mN = na;
-    }
-
-    public void syncAll(int srcLocation) {
-        try {
-            mN.syncAll(srcLocation);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void ioSend() {
-        try {
-            mN.ioSend();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void ioReceive() {
-        try {
-            mN.ioReceive();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void copyFrom(BaseObj[] d) {
-        if (d == null) {
-            return;
-        }
-        android.renderscript.BaseObj[] dN = new android.renderscript.BaseObj[d.length];
-        for (int i = 0; i < d.length; i++) {
-            dN[i] = d[i].getNObj();
-        }
-        try {
-            mN.copyFrom(dN);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void copyFromUnchecked(int[] d) {
-        try {
-            mN.copyFromUnchecked(d);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    public void copyFromUnchecked(short[] d) {
-        try {
-            mN.copyFromUnchecked(d);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    public void copyFromUnchecked(byte[] d) {
-        try {
-            mN.copyFromUnchecked(d);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    public void copyFromUnchecked(float[] d) {
-        try {
-            mN.copyFromUnchecked(d);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void copyFrom(int[] d) {
-        try {
-            mN.copyFrom(d);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    public void copyFrom(short[] d) {
-        try {
-            mN.copyFrom(d);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    public void copyFrom(byte[] d) {
-        try {
-            mN.copyFrom(d);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    public void copyFrom(float[] d) {
-        try {
-            mN.copyFrom(d);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    public void copyFrom(Bitmap b) {
-        try {
-            mN.copyFrom(b);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    public void copyFrom(Allocation a) {
-        AllocationThunker at = (AllocationThunker)a;
-        try {
-            mN.copyFrom(at.mN);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-
-    public void setFromFieldPacker(int xoff, FieldPacker fp) {
-        try {
-            // Must construct actual FieldPacker from scratch, since we don't
-            // know how many bytes were actually used.
-            byte[] data = fp.getData();
-            int fp_length = fp.getPos();
-            android.renderscript.FieldPacker nfp =
-                new android.renderscript.FieldPacker(fp_length);
-            for (int i = 0; i < fp_length; i++) {
-                nfp.addI8(data[i]);
-            }
-            mN.setFromFieldPacker(xoff, nfp);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    public void setFromFieldPacker(int xoff, int component_number, FieldPacker fp) {
-        try {
-            // Must construct actual FieldPacker from scratch, since we don't
-            // know how many bytes were actually used.
-            byte[] data = fp.getData();
-            int fp_length = fp.getPos();
-            android.renderscript.FieldPacker nfp =
-                new android.renderscript.FieldPacker(fp_length);
-            for (int i = 0; i < fp_length; i++) {
-                nfp.addI8(data[i]);
-            }
-            mN.setFromFieldPacker(xoff, component_number, nfp);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void generateMipmaps() {
-        try {
-            mN.generateMipmaps();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void copy1DRangeFromUnchecked(int off, int count, int[] d) {
-        try {
-            mN.copy1DRangeFromUnchecked(off, count, d);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    public void copy1DRangeFromUnchecked(int off, int count, short[] d) {
-        try {
-            mN.copy1DRangeFromUnchecked(off, count, d);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    public void copy1DRangeFromUnchecked(int off, int count, byte[] d) {
-        try {
-            mN.copy1DRangeFromUnchecked(off, count, d);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    public void copy1DRangeFromUnchecked(int off, int count, float[] d) {
-        try {
-            mN.copy1DRangeFromUnchecked(off, count, d);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void copy1DRangeFrom(int off, int count, int[] d) {
-        try {
-            mN.copy1DRangeFrom(off, count, d);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    public void copy1DRangeFrom(int off, int count, short[] d) {
-        try {
-            mN.copy1DRangeFrom(off, count, d);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    public void copy1DRangeFrom(int off, int count, byte[] d) {
-        try {
-            mN.copy1DRangeFrom(off, count, d);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    public void copy1DRangeFrom(int off, int count, float[] d) {
-        try {
-            mN.copy1DRangeFrom(off, count, d);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void copy1DRangeFrom(int off, int count, Allocation data, int dataOff) {
-        try {
-            AllocationThunker at = (AllocationThunker)data;
-            mN.copy1DRangeFrom(off, count, at.mN, dataOff);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void copy2DRangeFrom(int xoff, int yoff, int w, int h, byte[] data) {
-        try {
-            mN.copy2DRangeFrom(xoff, yoff, w, h, data);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    public void copy2DRangeFrom(int xoff, int yoff, int w, int h, short[] data) {
-        try {
-            mN.copy2DRangeFrom(xoff, yoff, w, h, data);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    public void copy2DRangeFrom(int xoff, int yoff, int w, int h, int[] data) {
-        try {
-            mN.copy2DRangeFrom(xoff, yoff, w, h, data);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    public void copy2DRangeFrom(int xoff, int yoff, int w, int h, float[] data) {
-        try {
-            mN.copy2DRangeFrom(xoff, yoff, w, h, data);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void copy2DRangeFrom(int xoff, int yoff, int w, int h,
-                                Allocation data, int dataXoff, int dataYoff) {
-        try {
-            AllocationThunker at = (AllocationThunker)data;
-            mN.copy2DRangeFrom(xoff, yoff, w, h, at.mN, dataXoff, dataYoff);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    public void copy2DRangeFrom(int xoff, int yoff, Bitmap data) {
-        try {
-            mN.copy2DRangeFrom(xoff, yoff, data);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-
-    public void copyTo(Bitmap b) {
-        try {
-            mN.copyTo(b);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    public void copyTo(byte[] d) {
-        try {
-            mN.copyTo(d);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    public void copyTo(short[] d) {
-        try {
-            mN.copyTo(d);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    public void copyTo(int[] d) {
-        try {
-            mN.copyTo(d);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    public void copyTo(float[] d) {
-        try {
-            mN.copyTo(d);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    // creation
-
-    static BitmapFactory.Options mBitmapOptions = new BitmapFactory.Options();
-    static {
-        mBitmapOptions.inScaled = false;
-    }
-
-    static public Allocation createTyped(RenderScript rs, Type type, MipmapControl mips, int usage) {
-        RenderScriptThunker rst = (RenderScriptThunker)rs;
-        TypeThunker tt = (TypeThunker)type;
-
-        try {
-            android.renderscript.Allocation a =
-                android.renderscript.Allocation.createTyped(rst.mN, tt.mN,
-                                                            convertMipmapControl(mips),
-                                                            usage);
-            return new AllocationThunker(rs, type, usage, a);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    static public Allocation createFromBitmap(RenderScript rs, Bitmap b,
-                                              MipmapControl mips,
-                                              int usage) {
-
-        RenderScriptThunker rst = (RenderScriptThunker)rs;
-        try {
-            android.renderscript.Allocation a =
-                android.renderscript.Allocation.createFromBitmap(rst.mN, b,
-                                                                 convertMipmapControl(mips),
-                                                                 usage);
-            TypeThunker tt = new TypeThunker(rs, a.getType());
-            return new AllocationThunker(rs, tt, usage, a);
-
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    static public Allocation createCubemapFromBitmap(RenderScript rs, Bitmap b,
-                                                     MipmapControl mips,
-                                                     int usage) {
-        RenderScriptThunker rst = (RenderScriptThunker)rs;
-        try {
-            android.renderscript.Allocation a =
-                    android.renderscript.Allocation.createCubemapFromBitmap(
-                    rst.mN, b, convertMipmapControl(mips), usage);
-            TypeThunker tt = new TypeThunker(rs, a.getType());
-            return new AllocationThunker(rs, tt, usage, a);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    static public Allocation createCubemapFromCubeFaces(RenderScript rs,
-                                                        Bitmap xpos,
-                                                        Bitmap xneg,
-                                                        Bitmap ypos,
-                                                        Bitmap yneg,
-                                                        Bitmap zpos,
-                                                        Bitmap zneg,
-                                                        MipmapControl mips,
-                                                        int usage) {
-        RenderScriptThunker rst = (RenderScriptThunker)rs;
-        try {
-            android.renderscript.Allocation a =
-                    android.renderscript.Allocation.createCubemapFromCubeFaces(
-                    rst.mN, xpos, xneg, ypos, yneg, zpos, zneg,
-                    convertMipmapControl(mips), usage);
-            TypeThunker tt = new TypeThunker(rs, a.getType());
-            return new AllocationThunker(rs, tt, usage, a);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    static public Allocation createFromBitmapResource(RenderScript rs,
-                                                      Resources res,
-                                                      int id,
-                                                      MipmapControl mips,
-                                                      int usage) {
-
-        RenderScriptThunker rst = (RenderScriptThunker)rs;
-        try {
-            android.renderscript.Allocation a =
-                    android.renderscript.Allocation.createFromBitmapResource(
-                    rst.mN, res, id, convertMipmapControl(mips), usage);
-            TypeThunker tt = new TypeThunker(rs, a.getType());
-            return new AllocationThunker(rs, tt, usage, a);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    static public Allocation createFromString(RenderScript rs,
-                                              String str,
-                                              int usage) {
-        RenderScriptThunker rst = (RenderScriptThunker)rs;
-        try {
-            android.renderscript.Allocation a =
-                    android.renderscript.Allocation.createFromString(
-                    rst.mN, str, usage);
-            TypeThunker tt = new TypeThunker(rs, a.getType());
-            return new AllocationThunker(rs, tt, usage, a);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    static public Allocation createSized(RenderScript rs, Element e,
-                                         int count, int usage) {
-        RenderScriptThunker rst = (RenderScriptThunker)rs;
-        ElementThunker et = (ElementThunker) e;
-        try {
-            android.renderscript.Allocation a =
-                android.renderscript.Allocation.createSized
-                (rst.mN, (android.renderscript.Element)e.getNObj(), count, usage);
-            TypeThunker tt = new TypeThunker(rs, a.getType());
-            return new AllocationThunker(rs, tt, usage, a);
-        } catch (android.renderscript.RSRuntimeException exc) {
-            throw ExceptionThunker.convertException(exc);
-        }
-    }
-
-}
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/BaseObj.java b/v8/renderscript/java/src/android/support/v8/renderscript/BaseObj.java
index b9d3ef4..e99a49c 100644
--- a/v8/renderscript/java/src/android/support/v8/renderscript/BaseObj.java
+++ b/v8/renderscript/java/src/android/support/v8/renderscript/BaseObj.java
@@ -148,10 +148,6 @@
             return false;
         }
 
-        if (mRS.isNative) {
-            return ((RenderScriptThunker)mRS).equals((Object)this, obj);
-        }
-
         BaseObj b = (BaseObj) obj;
         return mID == b.mID;
     }
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/Element.java b/v8/renderscript/java/src/android/support/v8/renderscript/Element.java
index 6189773..397f746 100644
--- a/v8/renderscript/java/src/android/support/v8/renderscript/Element.java
+++ b/v8/renderscript/java/src/android/support/v8/renderscript/Element.java
@@ -755,10 +755,6 @@
      * @return Element
      */
     static Element createUser(RenderScript rs, DataType dt) {
-        if (rs.isNative) {
-            RenderScriptThunker rst = (RenderScriptThunker)rs;
-            return ElementThunker.create(rst, dt);
-        }
         DataKind dk = DataKind.USER;
         boolean norm = false;
         int vecSize = 1;
@@ -780,10 +776,6 @@
      * @return Element
      */
     public static Element createVector(RenderScript rs, DataType dt, int size) {
-        if (rs.isNative) {
-            RenderScriptThunker rst = (RenderScriptThunker)rs;
-            return ElementThunker.createVector(rst, dt, size);
-        }
         if (size < 2 || size > 4) {
             throw new RSIllegalArgumentException("Vector size out of range 2-4.");
         }
@@ -827,11 +819,6 @@
      * @return Element
      */
     public static Element createPixel(RenderScript rs, DataType dt, DataKind dk) {
-        if (rs.isNative) {
-            RenderScriptThunker rst = (RenderScriptThunker)rs;
-            return ElementThunker.createPixel(rst, dt, dk);
-        }
-
         if (!(dk == DataKind.PIXEL_L ||
               dk == DataKind.PIXEL_A ||
               dk == DataKind.PIXEL_LA ||
@@ -914,7 +901,6 @@
      *
      */
     public static class Builder {
-        ElementThunker.BuilderThunker mT;
 
         RenderScript mRS;
         Element[] mElements;
@@ -929,10 +915,6 @@
          * @param rs
          */
         public Builder(RenderScript rs) {
-            if (rs.isNative) {
-                RenderScriptThunker rst = (RenderScriptThunker)rs;
-                mT = new ElementThunker.BuilderThunker(rs);
-            }
             mRS = rs;
             mCount = 0;
             mElements = new Element[8];
@@ -948,11 +930,6 @@
          * @param arraySize
          */
         public Builder add(Element element, String name, int arraySize) {
-            if (mT != null) {
-                mT.add(element, name, arraySize);
-                return this;
-            }
-
             if (arraySize < 1) {
                 throw new RSIllegalArgumentException("Array size cannot be less than 1.");
             }
@@ -1007,10 +984,6 @@
          * @return Element
          */
         public Element create() {
-            if (mT != null) {
-                return mT.create(mRS);
-            }
-
             mRS.validate();
             Element[] ein = new Element[mCount];
             String[] sin = new String[mCount];
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/ElementThunker.java b/v8/renderscript/java/src/android/support/v8/renderscript/ElementThunker.java
deleted file mode 100644
index 9b820e2..0000000
--- a/v8/renderscript/java/src/android/support/v8/renderscript/ElementThunker.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.support.v8.renderscript;
-
-import java.lang.reflect.Field;
-
-import android.util.Log;
-
-class ElementThunker extends Element {
-    android.renderscript.Element mN;
-
-    android.renderscript.Element getNObj() {
-        return mN;
-    }
-
-    public int getBytesSize() {
-        try {
-            return mN.getBytesSize();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public int getVectorSize() {
-        try {
-            return mN.getVectorSize();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    static android.renderscript.Element.DataKind convertKind(DataKind cdk) {
-        switch(cdk) {
-        case USER:
-            return android.renderscript.Element.DataKind.USER;
-        case PIXEL_L:
-            return android.renderscript.Element.DataKind.PIXEL_L;
-        case PIXEL_A:
-            return android.renderscript.Element.DataKind.PIXEL_A;
-        case PIXEL_LA:
-            return android.renderscript.Element.DataKind.PIXEL_LA;
-        case PIXEL_RGB:
-            return android.renderscript.Element.DataKind.PIXEL_RGB;
-        case PIXEL_RGBA:
-            return android.renderscript.Element.DataKind.PIXEL_RGBA;
-        }
-        return null;
-    }
-
-    static android.renderscript.Element.DataType convertType(DataType cdt) {
-        switch(cdt) {
-        case NONE:
-            return android.renderscript.Element.DataType.NONE;
-            //case DataType.FLOAT_16:
-        case FLOAT_32:
-            return android.renderscript.Element.DataType.FLOAT_32;
-        case FLOAT_64:
-            return android.renderscript.Element.DataType.FLOAT_64;
-        case SIGNED_8:
-            return android.renderscript.Element.DataType.SIGNED_8;
-        case SIGNED_16:
-            return android.renderscript.Element.DataType.SIGNED_16;
-        case SIGNED_32:
-            return android.renderscript.Element.DataType.SIGNED_32;
-        case SIGNED_64:
-            return android.renderscript.Element.DataType.SIGNED_64;
-        case UNSIGNED_8:
-            return android.renderscript.Element.DataType.UNSIGNED_8;
-        case UNSIGNED_16:
-            return android.renderscript.Element.DataType.UNSIGNED_16;
-        case UNSIGNED_32:
-            return android.renderscript.Element.DataType.UNSIGNED_32;
-        case UNSIGNED_64:
-            return android.renderscript.Element.DataType.UNSIGNED_64;
-
-        case BOOLEAN:
-            return android.renderscript.Element.DataType.BOOLEAN;
-
-        case MATRIX_4X4:
-            return android.renderscript.Element.DataType.MATRIX_4X4;
-        case MATRIX_3X3:
-            return android.renderscript.Element.DataType.MATRIX_3X3;
-        case MATRIX_2X2:
-            return android.renderscript.Element.DataType.MATRIX_2X2;
-
-        case RS_ELEMENT:
-            return android.renderscript.Element.DataType.RS_ELEMENT;
-        case RS_TYPE:
-            return android.renderscript.Element.DataType.RS_TYPE;
-        case RS_ALLOCATION:
-            return android.renderscript.Element.DataType.RS_ALLOCATION;
-        case RS_SAMPLER:
-            return android.renderscript.Element.DataType.RS_SAMPLER;
-        case RS_SCRIPT:
-            return android.renderscript.Element.DataType.RS_SCRIPT;
-        }
-        return null;
-    }
-
-    public boolean isComplex() {
-        try {
-            return mN.isComplex();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public int getSubElementCount() {
-        try {
-            return mN.getSubElementCount();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public Element getSubElement(int index) {
-        try {
-            return new ElementThunker(mRS, mN.getSubElement(index));
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public String getSubElementName(int index) {
-        try {
-            return mN.getSubElementName(index);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public int getSubElementArraySize(int index) {
-        try {
-            return mN.getSubElementArraySize(index);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public int getSubElementOffsetBytes(int index) {
-        try {
-            return mN.getSubElementOffsetBytes(index);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public DataType getDataType() {
-        return mType;
-    }
-
-    public DataKind getDataKind() {
-        return mKind;
-    }
-
-
-    ElementThunker(RenderScript rs, android.renderscript.Element e) {
-        super(0, rs);
-        mN = e;
-    }
-
-
-    static Element create(RenderScript rs, DataType dt) {
-        RenderScriptThunker rst = (RenderScriptThunker)rs;
-        try {
-            android.renderscript.Element e = null;
-            switch(dt) {
-            case FLOAT_32:
-                e = android.renderscript.Element.F32(rst.mN);
-                break;
-            case FLOAT_64:
-                e = android.renderscript.Element.F64(rst.mN);
-                break;
-            case SIGNED_8:
-                e = android.renderscript.Element.I8(rst.mN);
-                break;
-            case SIGNED_16:
-                e = android.renderscript.Element.I16(rst.mN);
-                break;
-            case SIGNED_32:
-                e = android.renderscript.Element.I32(rst.mN);
-                break;
-            case SIGNED_64:
-                e = android.renderscript.Element.I64(rst.mN);
-                break;
-            case UNSIGNED_8:
-                e = android.renderscript.Element.U8(rst.mN);
-                break;
-            case UNSIGNED_16:
-                e = android.renderscript.Element.U16(rst.mN);
-                break;
-            case UNSIGNED_32:
-                e = android.renderscript.Element.U32(rst.mN);
-                break;
-            case UNSIGNED_64:
-                e = android.renderscript.Element.U64(rst.mN);
-                break;
-
-            case BOOLEAN:
-                e = android.renderscript.Element.BOOLEAN(rst.mN);
-                break;
-
-            case MATRIX_4X4:
-                e = android.renderscript.Element.MATRIX_4X4(rst.mN);
-                break;
-            case MATRIX_3X3:
-                e = android.renderscript.Element.MATRIX_3X3(rst.mN);
-                break;
-            case MATRIX_2X2:
-                e = android.renderscript.Element.MATRIX_2X2(rst.mN);
-                break;
-
-            case RS_ELEMENT:
-                e = android.renderscript.Element.ELEMENT(rst.mN);
-                break;
-            case RS_TYPE:
-                e = android.renderscript.Element.TYPE(rst.mN);
-                break;
-            case RS_ALLOCATION:
-                e = android.renderscript.Element.ALLOCATION(rst.mN);
-                break;
-            case RS_SAMPLER:
-                e = android.renderscript.Element.SAMPLER(rst.mN);
-                break;
-            case RS_SCRIPT:
-                e = android.renderscript.Element.SCRIPT(rst.mN);
-                break;
-            }
-
-            return new ElementThunker(rs, e);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public static Element createVector(RenderScript rs, DataType dt, int size) {
-        RenderScriptThunker rst = (RenderScriptThunker)rs;
-        android.renderscript.Element e;
-        try {
-            e = android.renderscript.Element.createVector(rst.mN, convertType(dt), size);
-            return new ElementThunker(rs, e);
-        } catch (android.renderscript.RSRuntimeException exc) {
-            throw ExceptionThunker.convertException(exc);
-        }
-    }
-
-    public static Element createPixel(RenderScript rs, DataType dt, DataKind dk) {
-        RenderScriptThunker rst = (RenderScriptThunker)rs;
-        android.renderscript.Element e;
-        try {
-            e = android.renderscript.Element.createPixel(rst.mN, convertType(dt), convertKind(dk));
-        return new ElementThunker(rs, e);
-        } catch (android.renderscript.RSRuntimeException exc) {
-            throw ExceptionThunker.convertException(exc);
-        }
-    }
-
-    public boolean isCompatible(Element e) {
-        ElementThunker et = (ElementThunker)e;
-        try {
-            return et.mN.isCompatible(mN);
-        } catch (android.renderscript.RSRuntimeException exc) {
-            throw ExceptionThunker.convertException(exc);
-        }
-    }
-
-    static class BuilderThunker {
-        android.renderscript.Element.Builder mN;
-
-        public BuilderThunker(RenderScript rs) {
-            RenderScriptThunker rst = (RenderScriptThunker)rs;
-            try {
-                mN = new android.renderscript.Element.Builder(rst.mN);
-            } catch (android.renderscript.RSRuntimeException e) {
-                throw ExceptionThunker.convertException(e);
-            }
-        }
-
-        public void add(Element e, String name, int arraySize) {
-            ElementThunker et = (ElementThunker)e;
-            try {
-                mN.add(et.mN, name, arraySize);
-            } catch (android.renderscript.RSRuntimeException exc) {
-                throw ExceptionThunker.convertException(exc);
-            }
-        }
-
-        public Element create(RenderScript rs) {
-            try {
-                android.renderscript.Element e = mN.create();
-                return new ElementThunker(rs, e);
-            } catch (android.renderscript.RSRuntimeException exc) {
-                throw ExceptionThunker.convertException(exc);
-            }
-        }
-    }
-}
-
-
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/ExceptionThunker.java b/v8/renderscript/java/src/android/support/v8/renderscript/ExceptionThunker.java
deleted file mode 100644
index 3e553b7..0000000
--- a/v8/renderscript/java/src/android/support/v8/renderscript/ExceptionThunker.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.support.v8.renderscript;
-
-import java.lang.Exception;
-
-class ExceptionThunker {
-    static RuntimeException convertException (RuntimeException e) {
-        if (e instanceof android.renderscript.RSIllegalArgumentException) {
-            return new android.support.v8.renderscript.RSIllegalArgumentException(e.getMessage());
-        } else if (e instanceof android.renderscript.RSInvalidStateException) {
-            return new android.support.v8.renderscript.RSInvalidStateException(e.getMessage());
-        } else if (e instanceof android.renderscript.RSDriverException) {
-            return new android.support.v8.renderscript.RSDriverException(e.getMessage());
-        } else if (e instanceof android.renderscript.RSRuntimeException) {
-            return new android.support.v8.renderscript.RSRuntimeException(e.getMessage());
-        }
-        return e;
-    }
-
-}
\ No newline at end of file
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/FieldPacker.java b/v8/renderscript/java/src/android/support/v8/renderscript/FieldPacker.java
index a5b5b41..0973937 100644
--- a/v8/renderscript/java/src/android/support/v8/renderscript/FieldPacker.java
+++ b/v8/renderscript/java/src/android/support/v8/renderscript/FieldPacker.java
@@ -28,22 +28,13 @@
  *
  **/
 public class FieldPacker {
-    private FieldPackerThunker mN;
-
     public FieldPacker(int len) {
         mPos = 0;
         mLen = len;
         mData = new byte[len];
-        if (RenderScript.shouldThunk()) {
-            mN = new FieldPackerThunker(len);
-        }
     }
 
     public void align(int v) {
-        if (RenderScript.shouldThunk()) {
-            mN.align(v);
-            return;
-        }
         if ((v <= 0) || ((v & (v - 1)) != 0)) {
             throw new RSIllegalArgumentException("argument must be a non-negative non-zero power of 2: " + v);
         }
@@ -54,17 +45,9 @@
     }
 
     public void reset() {
-        if (RenderScript.shouldThunk()) {
-            mN.reset();
-            return;
-        }
         mPos = 0;
     }
     public void reset(int i) {
-        if (RenderScript.shouldThunk()) {
-            mN.reset(i);
-            return;
-        }
         if ((i < 0) || (i >= mLen)) {
             throw new RSIllegalArgumentException("out of range argument: " + i);
         }
@@ -72,10 +55,6 @@
     }
 
     public void skip(int i) {
-        if (RenderScript.shouldThunk()) {
-            mN.skip(i);
-            return;
-        }
         int res = mPos + i;
         if ((res < 0) || (res > mLen)) {
             throw new RSIllegalArgumentException("out of range argument: " + i);
@@ -84,28 +63,16 @@
     }
 
     public void addI8(byte v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addI8(v);
-            return;
-        }
         mData[mPos++] = v;
     }
 
     public void addI16(short v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addI16(v);
-            return;
-        }
         align(2);
         mData[mPos++] = (byte)(v & 0xff);
         mData[mPos++] = (byte)(v >> 8);
     }
 
     public void addI32(int v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addI32(v);
-            return;
-        }
         align(4);
         mData[mPos++] = (byte)(v & 0xff);
         mData[mPos++] = (byte)((v >> 8) & 0xff);
@@ -114,10 +81,6 @@
     }
 
     public void addI64(long v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addI64(v);
-            return;
-        }
         align(8);
         mData[mPos++] = (byte)(v & 0xff);
         mData[mPos++] = (byte)((v >> 8) & 0xff);
@@ -130,10 +93,6 @@
     }
 
     public void addU8(short v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addU8(v);
-            return;
-        }
         if ((v < 0) || (v > 0xff)) {
             throw new IllegalArgumentException("Saving value out of range for type");
         }
@@ -141,10 +100,6 @@
     }
 
     public void addU16(int v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addU16(v);
-            return;
-        }
         if ((v < 0) || (v > 0xffff)) {
             android.util.Log.e("rs", "FieldPacker.addU16( " + v + " )");
             throw new IllegalArgumentException("Saving value out of range for type");
@@ -155,10 +110,6 @@
     }
 
     public void addU32(long v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addU32(v);
-            return;
-        }
         if ((v < 0) || (v > 0xffffffffL)) {
             android.util.Log.e("rs", "FieldPacker.addU32( " + v + " )");
             throw new IllegalArgumentException("Saving value out of range for type");
@@ -171,10 +122,6 @@
     }
 
     public void addU64(long v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addU64(v);
-            return;
-        }
         if (v < 0) {
             android.util.Log.e("rs", "FieldPacker.addU64( " + v + " )");
             throw new IllegalArgumentException("Saving value out of range for type");
@@ -191,26 +138,14 @@
     }
 
     public void addF32(float v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addF32(v);
-            return;
-        }
         addI32(Float.floatToRawIntBits(v));
     }
 
     public void addF64(double v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addF64(v);
-            return;
-        }
         addI64(Double.doubleToRawLongBits(v));
     }
 
     public void addObj(BaseObj obj) {
-        if (RenderScript.shouldThunk()) {
-            mN.addObj(obj);
-            return;
-        }
         if (obj != null) {
             addI32(obj.getID(null));
         } else {
@@ -219,27 +154,15 @@
     }
 
     public void addF32(Float2 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addF32(v);
-            return;
-        }
         addF32(v.x);
         addF32(v.y);
     }
     public void addF32(Float3 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addF32(v);
-            return;
-        }
         addF32(v.x);
         addF32(v.y);
         addF32(v.z);
     }
     public void addF32(Float4 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addF32(v);
-            return;
-        }
         addF32(v.x);
         addF32(v.y);
         addF32(v.z);
@@ -247,27 +170,15 @@
     }
 
     public void addF64(Double2 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addF64(v);
-            return;
-        }
         addF64(v.x);
         addF64(v.y);
     }
     public void addF64(Double3 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addF64(v);
-            return;
-        }
         addF64(v.x);
         addF64(v.y);
         addF64(v.z);
     }
     public void addF64(Double4 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addF64(v);
-            return;
-        }
         addF64(v.x);
         addF64(v.y);
         addF64(v.z);
@@ -275,27 +186,15 @@
     }
 
     public void addI8(Byte2 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addI8(v);
-            return;
-        }
         addI8(v.x);
         addI8(v.y);
     }
     public void addI8(Byte3 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addI8(v);
-            return;
-        }
         addI8(v.x);
         addI8(v.y);
         addI8(v.z);
     }
     public void addI8(Byte4 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addI8(v);
-            return;
-        }
         addI8(v.x);
         addI8(v.y);
         addI8(v.z);
@@ -303,27 +202,15 @@
     }
 
     public void addU8(Short2 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addU8(v);
-            return;
-        }
         addU8(v.x);
         addU8(v.y);
     }
     public void addU8(Short3 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addU8(v);
-            return;
-        }
         addU8(v.x);
         addU8(v.y);
         addU8(v.z);
     }
     public void addU8(Short4 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addU8(v);
-            return;
-        }
         addU8(v.x);
         addU8(v.y);
         addU8(v.z);
@@ -331,27 +218,15 @@
     }
 
     public void addI16(Short2 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addI16(v);
-            return;
-        }
         addI16(v.x);
         addI16(v.y);
     }
     public void addI16(Short3 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addI16(v);
-            return;
-        }
         addI16(v.x);
         addI16(v.y);
         addI16(v.z);
     }
     public void addI16(Short4 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addI16(v);
-            return;
-        }
         addI16(v.x);
         addI16(v.y);
         addI16(v.z);
@@ -359,27 +234,15 @@
     }
 
     public void addU16(Int2 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addU16(v);
-            return;
-        }
         addU16(v.x);
         addU16(v.y);
     }
     public void addU16(Int3 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addU16(v);
-            return;
-        }
         addU16(v.x);
         addU16(v.y);
         addU16(v.z);
     }
     public void addU16(Int4 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addU16(v);
-            return;
-        }
         addU16(v.x);
         addU16(v.y);
         addU16(v.z);
@@ -387,27 +250,15 @@
     }
 
     public void addI32(Int2 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addI32(v);
-            return;
-        }
         addI32(v.x);
         addI32(v.y);
     }
     public void addI32(Int3 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addI32(v);
-            return;
-        }
         addI32(v.x);
         addI32(v.y);
         addI32(v.z);
     }
     public void addI32(Int4 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addI32(v);
-            return;
-        }
         addI32(v.x);
         addI32(v.y);
         addI32(v.z);
@@ -415,27 +266,15 @@
     }
 
     public void addU32(Long2 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addU32(v);
-            return;
-        }
         addU32(v.x);
         addU32(v.y);
     }
     public void addU32(Long3 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addU32(v);
-            return;
-        }
         addU32(v.x);
         addU32(v.y);
         addU32(v.z);
     }
     public void addU32(Long4 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addU32(v);
-            return;
-        }
         addU32(v.x);
         addU32(v.y);
         addU32(v.z);
@@ -443,27 +282,15 @@
     }
 
     public void addI64(Long2 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addI64(v);
-            return;
-        }
         addI64(v.x);
         addI64(v.y);
     }
     public void addI64(Long3 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addI64(v);
-            return;
-        }
         addI64(v.x);
         addI64(v.y);
         addI64(v.z);
     }
     public void addI64(Long4 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addI64(v);
-            return;
-        }
         addI64(v.x);
         addI64(v.y);
         addI64(v.z);
@@ -471,27 +298,15 @@
     }
 
     public void addU64(Long2 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addU64(v);
-            return;
-        }
         addU64(v.x);
         addU64(v.y);
     }
     public void addU64(Long3 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addU64(v);
-            return;
-        }
         addU64(v.x);
         addU64(v.y);
         addU64(v.z);
     }
     public void addU64(Long4 v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addU64(v);
-            return;
-        }
         addU64(v.x);
         addU64(v.y);
         addU64(v.z);
@@ -499,54 +314,32 @@
     }
 
     public void addMatrix(Matrix4f v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addMatrix(v);
-            return;
-        }
         for (int i=0; i < v.mMat.length; i++) {
             addF32(v.mMat[i]);
         }
     }
 
     public void addMatrix(Matrix3f v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addMatrix(v);
-            return;
-        }
         for (int i=0; i < v.mMat.length; i++) {
             addF32(v.mMat[i]);
         }
     }
 
     public void addMatrix(Matrix2f v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addMatrix(v);
-            return;
-        }
         for (int i=0; i < v.mMat.length; i++) {
             addF32(v.mMat[i]);
         }
     }
 
     public void addBoolean(boolean v) {
-        if (RenderScript.shouldThunk()) {
-            mN.addBoolean(v);
-            return;
-        }
         addI8((byte)(v ? 1 : 0));
     }
 
     public final byte[] getData() {
-        if (RenderScript.shouldThunk()) {
-            return mN.getData();
-        }
         return mData;
     }
 
     public int getPos() {
-        if (RenderScript.shouldThunk()) {
-            return mN.getPos();
-        }
         return mPos;
     }
 
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/FieldPackerThunker.java b/v8/renderscript/java/src/android/support/v8/renderscript/FieldPackerThunker.java
deleted file mode 100644
index b61e482..0000000
--- a/v8/renderscript/java/src/android/support/v8/renderscript/FieldPackerThunker.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.support.v8.renderscript;
-
-import android.support.v8.renderscript.RenderScript;
-
-/**
- * Utility class for packing arguments and structures from Android system objects to
- * RenderScript objects.
- *
- * This class is only intended to be used to support the
- * reflected code generated by the RS tool chain.  It should not
- * be called directly.
- *
- **/
-public class FieldPackerThunker {
-    private android.renderscript.FieldPacker mN;
-    private int mPos;
-
-    public FieldPackerThunker(int len) {
-        mN = new android.renderscript.FieldPacker(len);
-        mPos = 0;
-    }
-
-    void align(int v) {
-        mN.align(v);
-        while ((mPos & (v - 1)) != 0) {
-            mPos++;
-        }
-    }
-
-    void reset() {
-        mN.reset();
-        mPos = 0;
-    }
-
-    void reset(int i) {
-        mN.reset(i);
-        mPos = i;
-    }
-
-    public void skip(int i) {
-        mN.skip(i);
-        mPos += i;
-    }
-
-    public void addI8(byte v) {
-        mN.addI8(v);
-        mPos++;
-    }
-
-    public void addI16(short v) {
-        mN.addI16(v);
-        mPos += 2;
-    }
-
-    public void addI32(int v) {
-        mN.addI32(v);
-        mPos += 4;
-    }
-
-    public void addI64(long v) {
-        mN.addI64(v);
-        mPos += 8;
-    }
-
-    public void addU8(short v) {
-        mN.addU8(v);
-        mPos++;
-    }
-
-    public void addU16(int v) {
-        mN.addU16(v);
-        mPos += 2;
-    }
-
-    public void addU32(long v) {
-        mN.addU32(v);
-        mPos += 4;
-    }
-
-    public void addU64(long v) {
-        mN.addU64(v);
-        mPos += 8;
-    }
-
-    public void addF32(float v) {
-        mN.addF32(v);
-        mPos += 4;
-    }
-
-    public void addF64(double v) {
-        mN.addF64(v);
-        mPos += 8;
-    }
-
-    public void addObj(BaseObj obj) {
-        if (obj != null) {
-            mN.addObj(obj.getNObj());
-        } else {
-            mN.addObj(null);
-        }
-        mPos += 4;  // Compat lib only works in 32-bit mode, so objects are 4 bytes.
-    }
-
-    public void addF32(Float2 v) {
-        mN.addF32(new android.renderscript.Float2(v.x, v.y));
-        mPos += 8;
-    }
-    public void addF32(Float3 v) {
-        mN.addF32(new android.renderscript.Float3(v.x, v.y, v.z));
-        mPos += 12;
-    }
-    public void addF32(Float4 v) {
-        mN.addF32(new android.renderscript.Float4(v.x, v.y, v.z, v.w));
-        mPos += 16;
-    }
-
-    public void addF64(Double2 v) {
-        mN.addF64(new android.renderscript.Double2(v.x, v.y));
-        mPos += 16;
-    }
-    public void addF64(Double3 v) {
-        mN.addF64(new android.renderscript.Double3(v.x, v.y, v.z));
-        mPos += 24;
-    }
-    public void addF64(Double4 v) {
-        mN.addF64(new android.renderscript.Double4(v.x, v.y, v.z, v.w));
-        mPos += 32;
-    }
-
-    public void addI8(Byte2 v) {
-        mN.addI8(new android.renderscript.Byte2(v.x, v.y));
-        mPos += 2;
-    }
-    public void addI8(Byte3 v) {
-        mN.addI8(new android.renderscript.Byte3(v.x, v.y, v.z));
-        mPos += 3;
-    }
-    public void addI8(Byte4 v) {
-        mN.addI8(new android.renderscript.Byte4(v.x, v.y, v.z, v.w));
-        mPos += 4;
-    }
-
-    public void addU8(Short2 v) {
-        mN.addU8(new android.renderscript.Short2(v.x, v.y));
-        mPos += 2;
-    }
-    public void addU8(Short3 v) {
-        mN.addU8(new android.renderscript.Short3(v.x, v.y, v.z));
-        mPos += 3;
-    }
-    public void addU8(Short4 v) {
-        mN.addU8(new android.renderscript.Short4(v.x, v.y, v.z, v.w));
-        mPos += 4;
-    }
-
-    public void addI16(Short2 v) {
-        mN.addI16(new android.renderscript.Short2(v.x, v.y));
-        mPos += 4;
-    }
-    public void addI16(Short3 v) {
-        mN.addI16(new android.renderscript.Short3(v.x, v.y, v.z));
-        mPos += 6;
-    }
-    public void addI16(Short4 v) {
-        mN.addI16(new android.renderscript.Short4(v.x, v.y, v.z, v.w));
-        mPos += 8;
-    }
-
-    public void addU16(Int2 v) {
-        mN.addU16(new android.renderscript.Int2(v.x, v.y));
-        mPos += 4;
-    }
-    public void addU16(Int3 v) {
-        mN.addU16(new android.renderscript.Int3(v.x, v.y, v.z));
-        mPos += 6;
-    }
-    public void addU16(Int4 v) {
-        mN.addU16(new android.renderscript.Int4(v.x, v.y, v.z, v.w));
-        mPos += 8;
-    }
-
-    public void addI32(Int2 v) {
-        mN.addI32(new android.renderscript.Int2(v.x, v.y));
-        mPos += 8;
-    }
-    public void addI32(Int3 v) {
-        mN.addI32(new android.renderscript.Int3(v.x, v.y, v.z));
-        mPos += 12;
-    }
-    public void addI32(Int4 v) {
-        mN.addI32(new android.renderscript.Int4(v.x, v.y, v.z, v.w));
-        mPos += 16;
-    }
-
-    public void addU32(Long2 v) {
-        mN.addU32(new android.renderscript.Long2(v.x, v.y));
-        mPos += 8;
-    }
-    public void addU32(Long3 v) {
-        mN.addU32(new android.renderscript.Long3(v.x, v.y, v.z));
-        mPos += 12;
-    }
-    public void addU32(Long4 v) {
-        mN.addU32(new android.renderscript.Long4(v.x, v.y, v.z, v.w));
-        mPos += 16;
-    }
-
-    public void addI64(Long2 v) {
-        mN.addI64(new android.renderscript.Long2(v.x, v.y));
-        mPos += 16;
-    }
-    public void addI64(Long3 v) {
-        mN.addI64(new android.renderscript.Long3(v.x, v.y, v.z));
-        mPos += 24;
-    }
-    public void addI64(Long4 v) {
-        mN.addI64(new android.renderscript.Long4(v.x, v.y, v.z, v.w));
-        mPos += 32;
-    }
-
-    public void addU64(Long2 v) {
-        mN.addU64(new android.renderscript.Long2(v.x, v.y));
-        mPos += 16;
-    }
-    public void addU64(Long3 v) {
-        mN.addU64(new android.renderscript.Long3(v.x, v.y, v.z));
-        mPos += 24;
-    }
-    public void addU64(Long4 v) {
-        mN.addU64(new android.renderscript.Long4(v.x, v.y, v.z, v.w));
-        mPos += 32;
-    }
-
-    public void addMatrix(Matrix4f v) {
-        mN.addMatrix(new android.renderscript.Matrix4f(v.getArray()));
-        mPos += (4 * 4 * 4);
-    }
-
-    public void addMatrix(Matrix3f v) {
-        mN.addMatrix(new android.renderscript.Matrix3f(v.getArray()));
-        mPos += (3 * 3 * 4);
-    }
-
-    public void addMatrix(Matrix2f v) {
-        mN.addMatrix(new android.renderscript.Matrix2f(v.getArray()));
-        mPos += (2 * 2 * 4);
-    }
-
-    public void addBoolean(boolean v) {
-        mN.addBoolean(v);
-        mPos++;
-    }
-
-    public final byte[] getData() {
-        return mN.getData();
-    }
-
-    // We must compute our own mPos, since this API is not available in older target APIs.
-    public int getPos() {
-        return mPos;
-    }
-}
-
-
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/RenderScript.java b/v8/renderscript/java/src/android/support/v8/renderscript/RenderScript.java
index 762c715..3ba5014 100644
--- a/v8/renderscript/java/src/android/support/v8/renderscript/RenderScript.java
+++ b/v8/renderscript/java/src/android/support/v8/renderscript/RenderScript.java
@@ -64,6 +64,7 @@
     static Object lock = new Object();
 
     // Non-threadsafe functions.
+    native boolean nLoadSO(boolean useNative);
     native int  nDeviceCreate();
     native void nDeviceDestroy(int dev);
     native void nDeviceSetConfig(int dev, int param, int value);
@@ -73,26 +74,15 @@
     native void nContextInitToClient(int con);
     native void nContextDeinitToClient(int con);
 
-    static boolean isNative = false;
-
-    static private int sThunk = -1;
+    static private int sNative = -1;
     static private int sSdkVersion = -1;
 
-    static boolean shouldThunk() {
-        if (sThunk == -1) {
-            throw new RSRuntimeException("Can't use RS classes before setting up a RenderScript context");
-        } else if (sThunk == 1) {
-            return true;
-        }
-        return false;
-    }
-
     /**
      * Determines whether or not we should be thunking into the native
      * RenderScript layer or actually using the compatibility library.
      */
-    static private boolean setupThunk(int sdkVersion, Context ctx) {
-        if (sThunk == -1) {
+    static private boolean setupNative(int sdkVersion, Context ctx) {
+        if (sNative == -1) {
 
             // get the value of the debug.rs.forcecompat property
             int forcecompat = 0;
@@ -106,19 +96,15 @@
 
             }
 
-            // use compat on Jelly Bean MR2 if we're requesting SDK 19+
-            if (android.os.Build.VERSION.SDK_INT == 18 && sdkVersion >= 19) {
-                sThunk = 0;
-            }
-            else if ((android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR2)
+            if ((android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT)
                      && forcecompat == 0) {
-                sThunk = 1;
+                sNative = 1;
             } else {
-                sThunk = 0;
+                sNative = 0;
             }
 
 
-            if (sThunk == 1) {
+            if (sNative == 1) {
                 // Workarounds that may disable thunking go here
                 ApplicationInfo info;
                 try {
@@ -143,7 +129,7 @@
                     // asynchronous teardown: minor version 1+
                     if (info.metaData.getBoolean("com.android.support.v8.renderscript.EnableAsyncTeardown") == true) {
                         if (minorVersion == 0) {
-                            sThunk = 0;
+                            sNative = 0;
                         }
                     }
 
@@ -151,7 +137,7 @@
                     if (info.metaData.getBoolean("com.android.support.v8.renderscript.EnableBlurWorkaround") == true) {
                         if (android.os.Build.VERSION.SDK_INT <= 19) {
                             //android.util.Log.e("rs", "war on");
-                            sThunk = 0;
+                            sNative = 0;
                         }
                     }
                 }
@@ -159,7 +145,7 @@
             }
         }
 
-        if (sThunk == 1) {
+        if (sNative == 1) {
             return true;
         }
         return false;
@@ -217,6 +203,7 @@
 
     // Methods below are wrapped to protect the non-threadsafe
     // lockless fifo.
+
     native int  rsnContextCreate(int dev, int ver, int sdkVer, int contextType);
     synchronized int nContextCreate(int dev, int ver, int sdkVer, int contextType) {
         return rsnContextCreate(dev, ver, sdkVer, contextType);
@@ -784,10 +771,6 @@
 
     public void setMessageHandler(RSMessageHandler msg) {
         mMessageCallback = msg;
-        if (isNative) {
-            RenderScriptThunker rst = (RenderScriptThunker) this;
-            rst.setMessageHandler(msg);
-        }
     }
     public RSMessageHandler getMessageHandler() {
         return mMessageCallback;
@@ -830,10 +813,6 @@
 
     public void setErrorHandler(RSErrorHandler msg) {
         mErrorCallback = msg;
-        if (isNative) {
-            RenderScriptThunker rst = (RenderScriptThunker) this;
-            rst.setErrorHandler(msg);
-        }
     }
     public RSErrorHandler getErrorHandler() {
         return mErrorCallback;
@@ -991,11 +970,7 @@
         } else if (sSdkVersion != sdkVersion) {
             throw new RSRuntimeException("Can't have two contexts with different SDK versions in support lib");
         }
-
-        if (setupThunk(sSdkVersion, ctx)) {
-            android.util.Log.v(LOG_TAG, "RS native mode");
-            return RenderScriptThunker.create(ctx, sSdkVersion);
-        }
+        boolean useNative = setupNative(sSdkVersion, ctx);
         synchronized(lock) {
             if (sInitialized == false) {
                 try {
@@ -1010,7 +985,6 @@
                     sUseGCHooks = false;
                 }
                 try {
-                    System.loadLibrary("RSSupport");
                     System.loadLibrary("rsjni");
                     sInitialized = true;
                 } catch (UnsatisfiedLinkError e) {
@@ -1019,8 +993,20 @@
                 }
             }
         }
+        if (useNative) {
+            android.util.Log.v(LOG_TAG, "RS native mode");
+        } else {
+            android.util.Log.v(LOG_TAG, "RS compat mode");
+        }
+        if (!rs.nLoadSO(useNative)) {
+            if (useNative) {
+                android.util.Log.v(LOG_TAG, "Unable to load libRS.so, falling back to compat mode");
+            }
+            if (!useNative || !rs.nLoadSO(false)) {
+                throw new RSRuntimeException("Error loading libRSSupport library");
+            }
+        }
 
-        android.util.Log.v(LOG_TAG, "RS compat mode");
         rs.mDev = rs.nDeviceCreate();
         rs.mContext = rs.nContextCreate(rs.mDev, 0, sdkVersion, ct.mID);
         if (rs.mContext == 0) {
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/RenderScriptThunker.java b/v8/renderscript/java/src/android/support/v8/renderscript/RenderScriptThunker.java
deleted file mode 100644
index bb6bf73..0000000
--- a/v8/renderscript/java/src/android/support/v8/renderscript/RenderScriptThunker.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.support.v8.renderscript;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import android.content.Context;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.content.res.AssetManager;
-import android.os.Process;
-import android.util.Log;
-import android.view.Surface;
-
-
-
-class RenderScriptThunker extends RenderScript {
-    android.renderscript.RenderScript mN;
-
-    void validate() {
-        if (mN == null) {
-            throw new RSInvalidStateException("Calling RS with no Context active.");
-        }
-    }
-
-    public void setPriority(Priority p) {
-        try {
-            if (p == Priority.LOW) mN.setPriority(android.renderscript.RenderScript.Priority.LOW);
-            if (p == Priority.NORMAL) mN.setPriority(android.renderscript.RenderScript.Priority.NORMAL);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    RenderScriptThunker(Context ctx) {
-        super(ctx);
-        isNative = true;
-    }
-
-    public static RenderScript create(Context ctx, int sdkVersion) {
-        try {
-            RenderScriptThunker rs = new RenderScriptThunker(ctx);
-            Class<?> javaRS = Class.forName("android.renderscript.RenderScript");
-            Class[] signature = {Context.class, Integer.TYPE};
-            Object[] args = {ctx, new Integer(sdkVersion)};
-            Method create = javaRS.getDeclaredMethod("create", signature);
-            rs.mN = (android.renderscript.RenderScript)create.invoke(null, args);
-            return rs;
-        }
-        catch(android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        } catch (Exception e) {
-            throw new RSRuntimeException("Failure to create platform RenderScript context");
-        }
-    }
-
-    public void contextDump() {
-        try {
-            mN.contextDump();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void finish() {
-        try {
-            mN.finish();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void destroy() {
-        try {
-            mN.destroy();
-            mN = null;
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-
-    }
-
-    public void setMessageHandler(RSMessageHandler msg) {
-        mMessageCallback = msg;
-        try {
-            android.renderscript.RenderScript.RSMessageHandler handler =
-                new android.renderscript.RenderScript.RSMessageHandler() {
-                    public void run() {
-                        mMessageCallback.mData = mData;
-                        mMessageCallback.mID = mID;
-                        mMessageCallback.mLength = mLength;
-                        mMessageCallback.run();
-                    }
-                };
-            mN.setMessageHandler(handler);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void setErrorHandler(RSErrorHandler msg) {
-        mErrorCallback = msg;
-        try {
-            android.renderscript.RenderScript.RSErrorHandler handler =
-                new android.renderscript.RenderScript.RSErrorHandler() {
-                    public void run() {
-                        mErrorCallback.mErrorMessage = mErrorMessage;
-                        mErrorCallback.mErrorNum = mErrorNum;
-                        mErrorCallback.run();
-                    }
-                };
-            mN.setErrorHandler(handler);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-
-    boolean equals(Object obj1, Object obj2) {
-        if (obj2 instanceof android.support.v8.renderscript.BaseObj) {
-            return ((android.renderscript.BaseObj)obj1).equals(((android.support.v8.renderscript.BaseObj)obj2).getNObj());
-        }
-        return false;
-    }
-}
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/Sampler.java b/v8/renderscript/java/src/android/support/v8/renderscript/Sampler.java
index 7234c12..dae7a79 100644
--- a/v8/renderscript/java/src/android/support/v8/renderscript/Sampler.java
+++ b/v8/renderscript/java/src/android/support/v8/renderscript/Sampler.java
@@ -328,16 +328,6 @@
         }
 
         public Sampler create() {
-            if (mRS.isNative) {
-                RenderScriptThunker rst = (RenderScriptThunker)mRS;
-                SamplerThunker.Builder b = new SamplerThunker.Builder(rst);
-                b.setMinification(mMin);
-                b.setMagnification(mMag);
-                b.setWrapS(mWrapS);
-                b.setWrapT(mWrapT);
-                b.setAnisotropy(mAniso);
-                return b.create();
-            }
             mRS.validate();
             int id = mRS.nSamplerCreate(mMag.mID, mMin.mID,
                                         mWrapS.mID, mWrapT.mID, mWrapR.mID, mAniso);
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/SamplerThunker.java b/v8/renderscript/java/src/android/support/v8/renderscript/SamplerThunker.java
deleted file mode 100644
index eb14c7f..0000000
--- a/v8/renderscript/java/src/android/support/v8/renderscript/SamplerThunker.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.support.v8.renderscript;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.util.Log;
-import android.os.Bundle;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-
-/**
- *
- **/
-class SamplerThunker extends Sampler {
-    android.renderscript.Sampler mN;
-
-    protected SamplerThunker(int id, RenderScript rs) {
-        super(id, rs);
-    }
-
-    android.renderscript.BaseObj getNObj() {
-        return mN;
-    }
-
-    static android.renderscript.Sampler.Value convertValue (Value v) {
-        switch (v) {
-        case NEAREST:
-            return android.renderscript.Sampler.Value.NEAREST;
-        case LINEAR:
-            return android.renderscript.Sampler.Value.LINEAR;
-        case LINEAR_MIP_LINEAR:
-            return android.renderscript.Sampler.Value.LINEAR_MIP_LINEAR;
-        case LINEAR_MIP_NEAREST:
-            return android.renderscript.Sampler.Value.LINEAR_MIP_NEAREST;
-        case WRAP:
-            return android.renderscript.Sampler.Value.WRAP;
-        case CLAMP:
-            return android.renderscript.Sampler.Value.CLAMP;
-        case MIRRORED_REPEAT:
-            return android.renderscript.Sampler.Value.MIRRORED_REPEAT;
-        }
-        return null;
-    }
-
-    /**
-     * Builder for creating non-standard samplers.  Useful if mix and match of
-     * wrap modes is necesary or if anisotropic filtering is desired.
-     *
-     */
-    public static class Builder {
-        RenderScriptThunker mRS;
-        Value mMin;
-        Value mMag;
-        Value mWrapS;
-        Value mWrapT;
-        Value mWrapR;
-        float mAniso;
-
-        public Builder(RenderScriptThunker rs) {
-            mRS = rs;
-            mMin = Value.NEAREST;
-            mMag = Value.NEAREST;
-            mWrapS = Value.WRAP;
-            mWrapT = Value.WRAP;
-            mWrapR = Value.WRAP;
-        }
-
-        public void setMinification(Value v) {
-            if (v == Value.NEAREST ||
-                v == Value.LINEAR ||
-                v == Value.LINEAR_MIP_LINEAR ||
-                v == Value.LINEAR_MIP_NEAREST) {
-                mMin = v;
-            } else {
-                throw new IllegalArgumentException("Invalid value");
-            }
-        }
-
-        public void setMagnification(Value v) {
-            if (v == Value.NEAREST || v == Value.LINEAR) {
-                mMag = v;
-            } else {
-                throw new IllegalArgumentException("Invalid value");
-            }
-        }
-
-        public void setWrapS(Value v) {
-            if (v == Value.WRAP || v == Value.CLAMP || v == Value.MIRRORED_REPEAT) {
-                mWrapS = v;
-            } else {
-                throw new IllegalArgumentException("Invalid value");
-            }
-        }
-
-        public void setWrapT(Value v) {
-            if (v == Value.WRAP || v == Value.CLAMP || v == Value.MIRRORED_REPEAT) {
-                mWrapT = v;
-            } else {
-                throw new IllegalArgumentException("Invalid value");
-            }
-        }
-
-        public void setAnisotropy(float v) {
-            if(v >= 0.0f) {
-                mAniso = v;
-            } else {
-                throw new IllegalArgumentException("Invalid value");
-            }
-        }
-
-        public Sampler create() {
-            mRS.validate();
-            try {
-                android.renderscript.Sampler.Builder b = new android.renderscript.Sampler.Builder(mRS.mN);
-                b.setMinification(convertValue(mMin));
-                b.setMagnification(convertValue(mMag));
-                b.setWrapS(convertValue(mWrapS));
-                b.setWrapT(convertValue(mWrapT));
-                b.setAnisotropy(mAniso);
-                android.renderscript.Sampler s = b.create();
-
-                SamplerThunker sampler = new SamplerThunker(0, mRS);
-                sampler.mMin = mMin;
-                sampler.mMag = mMag;
-                sampler.mWrapS = mWrapS;
-                sampler.mWrapT = mWrapT;
-                sampler.mWrapR = mWrapR;
-                sampler.mAniso = mAniso;
-                sampler.mN = s;
-
-                return sampler;
-            } catch (android.renderscript.RSRuntimeException e) {
-                throw ExceptionThunker.convertException(e);
-            }
-        }
-    }
-
-
-}
\ No newline at end of file
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/Script.java b/v8/renderscript/java/src/android/support/v8/renderscript/Script.java
index 8ac9171..93e6ef6 100644
--- a/v8/renderscript/java/src/android/support/v8/renderscript/Script.java
+++ b/v8/renderscript/java/src/android/support/v8/renderscript/Script.java
@@ -23,13 +23,6 @@
  * applications.
  **/
 public class Script extends BaseObj {
-    ScriptCThunker mT;
-
-    android.renderscript.Script getNObj() {
-        return mT;
-    }
-
-
     /**
      * KernelID is an identifier for a Script + root function pair. It is used
      * as an identifier for ScriptGroup creation.
@@ -68,19 +61,6 @@
         if (k != null) {
             return k;
         }
-
-        // Any native callers to createKernelID must initialize their own native IDs
-        // excpet ScriptCThunker
-        if (mRS.isNative == true) {
-            k = new KernelID(0, mRS, this, slot, sig);
-            if (mT != null) {
-                k.mN = mT.thunkCreateKernelID(slot, sig, ein, eout);
-            }
-            mKIDs.put(slot, k);
-            return k;
-        }
-
-
         int id = mRS.nScriptKernelIDCreate(getID(mRS), slot, sig);
         if (id == 0) {
             throw new RSDriverException("Failed to create KernelID");
@@ -121,17 +101,6 @@
      * @return FieldID
      */
     protected FieldID createFieldID(int slot, Element e) {
-
-        // Any thunking caller to createFieldID must create its own native IDs
-        // except ScriptC
-        if (mRS.isNative == true) {
-            FieldID f = new FieldID(0, mRS, this, slot);
-            if (mT != null) {
-                f.mN = mT.thunkCreateFieldID(slot, e);
-            }
-            mFIDs.put(slot, f);
-            return f;
-        }
         FieldID f = mFIDs.get(slot);
         if (f != null) {
             return f;
@@ -154,11 +123,6 @@
      * @param slot
      */
     protected void invoke(int slot) {
-        if (mT != null) {
-            mT.thunkInvoke(slot);
-            return;
-        }
-
         mRS.nScriptInvoke(getID(mRS), slot);
     }
 
@@ -169,11 +133,6 @@
      * @param v
      */
     protected void invoke(int slot, FieldPacker v) {
-        if (mT != null) {
-            mT.thunkInvoke(slot, v);
-            return;
-        }
-
         if (v != null) {
             mRS.nScriptInvokeV(getID(mRS), slot, v.getData());
         } else {
@@ -188,11 +147,6 @@
      * @param slot
      */
     public void bindAllocation(Allocation va, int slot) {
-        if (mT != null) {
-            mT.thunkBindAllocation(va, slot);
-            return;
-        }
-
         mRS.validate();
         if (va != null) {
             mRS.nScriptBindAllocation(getID(mRS), va.getID(mRS), slot);
@@ -202,11 +156,6 @@
     }
 
     public void setTimeZone(String timeZone) {
-        if (mT != null) {
-            mT.thunkSetTimeZone(timeZone);
-            return;
-        }
-
         mRS.validate();
         try {
             mRS.nScriptSetTimeZone(getID(mRS), timeZone.getBytes("UTF-8"));
@@ -225,11 +174,6 @@
      * @param v
      */
     protected void forEach(int slot, Allocation ain, Allocation aout, FieldPacker v) {
-        if (mT != null) {
-            mT.thunkForEach(slot, ain, aout, v);
-            return;
-        }
-
         if (ain == null && aout == null) {
             throw new RSIllegalArgumentException(
                 "At least one of ain or aout is required to be non-null.");
@@ -259,11 +203,6 @@
      * @param sc
      */
     protected void forEach(int slot, Allocation ain, Allocation aout, FieldPacker v, LaunchOptions sc) {
-        if (mT != null) {
-            mT.thunkForEach(slot, ain, aout, v, sc);
-            return;
-        }
-
         if (ain == null && aout == null) {
             throw new RSIllegalArgumentException(
                 "At least one of ain or aout is required to be non-null.");
@@ -299,11 +238,6 @@
      * @param v
      */
     public void setVar(int index, float v) {
-        if (mT != null) {
-            mT.thunkSetVar(index, v);
-            return;
-        }
-
         mRS.nScriptSetVarF(getID(mRS), index, v);
     }
 
@@ -314,11 +248,6 @@
      * @param v
      */
     public void setVar(int index, double v) {
-        if (mT != null) {
-            mT.thunkSetVar(index, v);
-            return;
-        }
-
         mRS.nScriptSetVarD(getID(mRS), index, v);
     }
 
@@ -329,11 +258,6 @@
      * @param v
      */
     public void setVar(int index, int v) {
-        if (mT != null) {
-            mT.thunkSetVar(index, v);
-            return;
-        }
-
         mRS.nScriptSetVarI(getID(mRS), index, v);
     }
 
@@ -344,11 +268,6 @@
      * @param v
      */
     public void setVar(int index, long v) {
-        if (mT != null) {
-            mT.thunkSetVar(index, v);
-            return;
-        }
-
         mRS.nScriptSetVarJ(getID(mRS), index, v);
     }
 
@@ -359,11 +278,6 @@
      * @param v
      */
     public void setVar(int index, boolean v) {
-        if (mT != null) {
-            mT.thunkSetVar(index, v);
-            return;
-        }
-
         mRS.nScriptSetVarI(getID(mRS), index, v ? 1 : 0);
     }
 
@@ -374,11 +288,6 @@
      * @param o
      */
     public void setVar(int index, BaseObj o) {
-        if (mT != null) {
-            mT.thunkSetVar(index, o);
-            return;
-        }
-
         mRS.nScriptSetVarObj(getID(mRS), index, (o == null) ? 0 : o.getID(mRS));
     }
 
@@ -389,11 +298,6 @@
      * @param v
      */
     public void setVar(int index, FieldPacker v) {
-        if (mT != null) {
-            mT.thunkSetVar(index, v);
-            return;
-        }
-
         mRS.nScriptSetVarV(getID(mRS), index, v.getData());
     }
 
@@ -406,11 +310,6 @@
      * @param dims
      */
     public void setVar(int index, FieldPacker v, Element e, int[] dims) {
-        if (mT != null) {
-            mT.thunkSetVar(index, v, e, dims);
-            return;
-        }
-
         mRS.nScriptSetVarVE(getID(mRS), index, v.getData(), e.getID(mRS), dims);
     }
 
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptC.java b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptC.java
index 7b01154..1000860 100644
--- a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptC.java
+++ b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptC.java
@@ -56,14 +56,6 @@
      */
     protected ScriptC(RenderScript rs, Resources resources, int resourceID) {
         super(0, rs);
-
-        if (rs.isNative) {
-            RenderScriptThunker rst = (RenderScriptThunker)rs;
-            ScriptCThunker s = new ScriptCThunker(rst, resources, resourceID);
-            mT = s;
-            return;
-        }
-
         int id = internalCreate(rs, resources, resourceID);
         if (id == 0) {
             throw new RSRuntimeException("Loading of ScriptC script failed.");
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptCThunker.java b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptCThunker.java
deleted file mode 100644
index 2dd9ae9..0000000
--- a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptCThunker.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.support.v8.renderscript;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.util.Log;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Map.Entry;
-import java.util.HashMap;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-
-/**
- *
- **/
-class ScriptCThunker extends android.renderscript.ScriptC {
-    private static final String TAG = "ScriptC";
-
-    protected ScriptCThunker(RenderScriptThunker rs, Resources resources, int resourceID) {
-        super(rs.mN, resources, resourceID);
-    }
-
-    android.renderscript.Script.KernelID thunkCreateKernelID(
-            int slot, int sig, Element ein, Element eout) {
-
-        android.renderscript.Element nein = null;
-        android.renderscript.Element neout = null;
-        if (ein != null) {
-            nein = ((ElementThunker)ein).mN;
-        }
-        if (eout != null) {
-            neout = ((ElementThunker)eout).mN;
-        }
-        try {
-            android.renderscript.Script.KernelID kid = createKernelID(slot, sig, nein, neout);
-            return kid;
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-
-    void thunkInvoke(int slot) {
-        try {
-            invoke(slot);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    void thunkBindAllocation(Allocation va, int slot) {
-        android.renderscript.Allocation nva = null;
-        if (va != null) {
-            nva = ((AllocationThunker)va).mN;
-        }
-        try {
-            bindAllocation(nva, slot);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    void thunkSetTimeZone(String timeZone) {
-        try {
-            setTimeZone(timeZone);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    void thunkInvoke(int slot, FieldPacker v) {
-        try {
-            android.renderscript.FieldPacker nfp =
-                new android.renderscript.FieldPacker(v.getData());
-            invoke(slot, nfp);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    void thunkForEach(int slot, Allocation ain, Allocation aout, FieldPacker v) {
-        android.renderscript.Allocation nin = null;
-        android.renderscript.Allocation nout = null;
-        android.renderscript.FieldPacker nfp = null;
-        if (ain != null) {
-            nin = ((AllocationThunker)ain).mN;
-        }
-        if (aout != null) {
-            nout = ((AllocationThunker)aout).mN;
-        }
-        try {
-            if (v != null) {
-                nfp = new android.renderscript.FieldPacker(v.getData());
-            }
-            forEach(slot, nin, nout, nfp);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    void thunkForEach(int slot, Allocation ain, Allocation aout, FieldPacker v,
-                      android.support.v8.renderscript.Script.LaunchOptions sc) {
-        try {
-            android.renderscript.Script.LaunchOptions lo = null;
-            if (sc != null) {
-                lo = new android.renderscript.Script.LaunchOptions();
-                if (sc.getXEnd() > 0) lo.setX(sc.getXStart(), sc.getXEnd());
-                if (sc.getYEnd() > 0) lo.setY(sc.getYStart(), sc.getYEnd());
-                if (sc.getZEnd() > 0) lo.setZ(sc.getZStart(), sc.getZEnd());
-            }
-
-            android.renderscript.Allocation nin = null;
-            android.renderscript.Allocation nout = null;
-            android.renderscript.FieldPacker nfp = null;
-            if (ain != null) {
-                nin = ((AllocationThunker)ain).mN;
-            }
-            if (aout != null) {
-                nout = ((AllocationThunker)aout).mN;
-            }
-            if (v != null) {
-                nfp = new android.renderscript.FieldPacker(v.getData());
-            }
-            forEach(slot, nin, nout, nfp, lo);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    void thunkSetVar(int index, float v) {
-        try {
-            setVar(index, v);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    void thunkSetVar(int index, double v) {
-        try {
-            setVar(index, v);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    void thunkSetVar(int index, int v) {
-        try {
-            setVar(index, v);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    void thunkSetVar(int index, long v) {
-        try {
-            setVar(index, v);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    void thunkSetVar(int index, boolean v) {
-        try {
-            setVar(index, v);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    void thunkSetVar(int index, BaseObj o) {
-        if (o == null) {
-            try {
-                setVar(index, 0);
-            } catch (android.renderscript.RSRuntimeException e) {
-                throw ExceptionThunker.convertException(e);
-            }
-            return;
-        }
-        try {
-            setVar(index, o.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-    void thunkSetVar(int index, FieldPacker v) {
-        try {
-            android.renderscript.FieldPacker nfp =
-                new android.renderscript.FieldPacker(v.getData());
-            setVar(index, nfp);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    void thunkSetVar(int index, FieldPacker v, Element e, int[] dims) {
-        try {
-            android.renderscript.FieldPacker nfp =
-                new android.renderscript.FieldPacker(v.getData());
-            ElementThunker et = (ElementThunker)e;
-            setVar(index, nfp, et.mN, dims);
-        } catch (android.renderscript.RSRuntimeException exc) {
-            throw ExceptionThunker.convertException(exc);
-        }
-    }
-
-    android.renderscript.Script.FieldID thunkCreateFieldID(int slot, Element e) {
-        try {
-            ElementThunker et = (ElementThunker) e;
-            return createFieldID(slot, et.getNObj());
-        } catch (android.renderscript.RSRuntimeException exc) {
-            throw ExceptionThunker.convertException(exc);
-        }
-    }
-
-}
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptGroup.java b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptGroup.java
index 473d67d..c630630 100644
--- a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptGroup.java
+++ b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptGroup.java
@@ -173,8 +173,6 @@
         private ArrayList<ConnectLine> mLines = new ArrayList<ConnectLine>();
         private int mKernelCount;
 
-        private ScriptGroupThunker.Builder mT;
-
         /**
          * Create a Builder for generating a ScriptGroup.
          *
@@ -182,9 +180,6 @@
          * @param rs The RenderScript context.
          */
         public Builder(RenderScript rs) {
-            if (rs.isNative) {
-                mT = new ScriptGroupThunker.Builder(rs);
-            }
             mRS = rs;
         }
 
@@ -286,11 +281,6 @@
          * @return Builder Returns this.
          */
         public Builder addKernel(Script.KernelID k) {
-            if (mT != null) {
-                mT.addKernel(k);
-                return this;
-            }
-
             if (mLines.size() != 0) {
                 throw new RSInvalidStateException(
                     "Kernels may not be added once connections exist.");
@@ -326,12 +316,6 @@
          */
         public Builder addConnection(Type t, Script.KernelID from, Script.FieldID to) {
             //android.util.Log.v("RSR", "addConnection " + t +", " + from + ", " + to);
-
-            if (mT != null) {
-                mT.addConnection(t, from, to);
-                return this;
-            }
-
             Node nf = findNode(from);
             if (nf == null) {
                 throw new RSInvalidStateException("From script not found.");
@@ -366,12 +350,6 @@
          */
         public Builder addConnection(Type t, Script.KernelID from, Script.KernelID to) {
             //android.util.Log.v("RSR", "addConnection " + t +", " + from + ", " + to);
-
-            if (mT != null) {
-                mT.addConnection(t, from, to);
-                return this;
-            }
-
             Node nf = findNode(from);
             if (nf == null) {
                 throw new RSInvalidStateException("From script not found.");
@@ -401,11 +379,6 @@
          * @return ScriptGroup The new ScriptGroup
          */
         public ScriptGroup create() {
-
-            if (mT != null) {
-                return mT.create();
-            }
-
             if (mNodes.size() == 0) {
                 throw new RSInvalidStateException("Empty script groups are not allowed");
             }
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptGroupThunker.java b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptGroupThunker.java
deleted file mode 100644
index 588d674..0000000
--- a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptGroupThunker.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.support.v8.renderscript;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-
-class ScriptGroupThunker extends ScriptGroup {
-    android.renderscript.ScriptGroup mN;
-
-    android.renderscript.ScriptGroup getNObj() {
-        return mN;
-    }
-
-    ScriptGroupThunker(int id, RenderScript rs) {
-        super(id, rs);
-    }
-
-    public void setInput(Script.KernelID s, Allocation a) {
-        AllocationThunker at = (AllocationThunker) a;
-        try {
-            mN.setInput(s.mN, at.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void setOutput(Script.KernelID s, Allocation a) {
-        AllocationThunker at = (AllocationThunker) a;
-        try {
-            mN.setOutput(s.mN, at.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void execute() {
-        try {
-            mN.execute();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-
-    public static final class Builder {
-
-        android.renderscript.ScriptGroup.Builder bN;
-        RenderScript mRS;
-
-        Builder(RenderScript rs) {
-            RenderScriptThunker rst = (RenderScriptThunker) rs;
-            mRS = rs;
-            try {
-                bN = new android.renderscript.ScriptGroup.Builder(rst.mN);
-            } catch (android.renderscript.RSRuntimeException e) {
-                throw ExceptionThunker.convertException(e);
-            }
-        }
-
-        public Builder addKernel(Script.KernelID k) {
-            try {
-                bN.addKernel(k.mN);
-            } catch (android.renderscript.RSRuntimeException e) {
-                throw ExceptionThunker.convertException(e);
-            }
-            return this;
-        }
-
-        public Builder addConnection(Type t, Script.KernelID from, Script.FieldID to) {
-            TypeThunker tt = (TypeThunker) t;
-            try {
-                bN.addConnection(tt.getNObj(), from.mN, to.mN);
-            } catch (android.renderscript.RSRuntimeException e) {
-                throw ExceptionThunker.convertException(e);
-            }
-            return this;
-        }
-
-        public Builder addConnection(Type t, Script.KernelID from, Script.KernelID to) {
-            TypeThunker tt = (TypeThunker) t;
-            try {
-                bN.addConnection(tt.getNObj(), from.mN, to.mN);
-            } catch (android.renderscript.RSRuntimeException e) {
-                throw ExceptionThunker.convertException(e);
-            }
-            return this;
-        }
-
-
-
-        public ScriptGroupThunker create() {
-            ScriptGroupThunker sg = new ScriptGroupThunker(0, mRS);
-            try {
-                sg.mN = bN.create();
-            } catch (android.renderscript.RSRuntimeException e) {
-                throw ExceptionThunker.convertException(e);
-            }
-            return sg;
-        }
-    }
-
-
-}
-
-
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsic3DLUT.java b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsic3DLUT.java
index 94727de..1076f51 100644
--- a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsic3DLUT.java
+++ b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsic3DLUT.java
@@ -47,10 +47,6 @@
      * @return ScriptIntrinsic3DLUT
      */
     public static ScriptIntrinsic3DLUT create(RenderScript rs, Element e) {
-        if (rs.isNative) {
-            RenderScriptThunker rst = (RenderScriptThunker) rs;
-            return ScriptIntrinsic3DLUTThunker.create(rs, e);
-        }
         int id = rs.nScriptIntrinsicCreate(8, e.getID(rs));
 
         if (!e.isCompatible(Element.U8_4(rs))) {
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsic3DLUTThunker.java b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsic3DLUTThunker.java
deleted file mode 100644
index a1c6ada..0000000
--- a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsic3DLUTThunker.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.support.v8.renderscript;
-
-import android.util.Log;
-
-/**
- *
- * @hide
- **/
-class ScriptIntrinsic3DLUTThunker extends ScriptIntrinsic3DLUT {
-    android.renderscript.ScriptIntrinsic3DLUT mN;
-
-    android.renderscript.ScriptIntrinsic3DLUT getNObj() {
-        return mN;
-    }
-
-    private ScriptIntrinsic3DLUTThunker(int id, RenderScript rs, Element e) {
-        super(id, rs, e);
-    }
-
-    public static ScriptIntrinsic3DLUTThunker create(RenderScript rs, Element e) {
-        RenderScriptThunker rst = (RenderScriptThunker) rs;
-        ElementThunker et = (ElementThunker) e;
-
-        ScriptIntrinsic3DLUTThunker lut = new ScriptIntrinsic3DLUTThunker(0, rs, e);
-        try {
-            lut.mN = android.renderscript.ScriptIntrinsic3DLUT.create(rst.mN, et.getNObj());
-        } catch (android.renderscript.RSRuntimeException exc) {
-            throw ExceptionThunker.convertException(exc);
-        }
-        return lut;
-    }
-
-    public void setLUT(Allocation lut) {
-        AllocationThunker lutt = (AllocationThunker) lut;
-        try {
-            mN.setLUT(lutt.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-
-    /**
-     * Invoke the kernel and apply the lookup to each cell of ain
-     * and copy to aout.
-     *
-     * @param ain Input allocation
-     * @param aout Output allocation
-     */
-    public void forEach(Allocation ain, Allocation aout) {
-        AllocationThunker aint = (AllocationThunker)ain;
-        AllocationThunker aoutt = (AllocationThunker)aout;
-        try {
-            mN.forEach(aint.getNObj(), aoutt.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    /**
-     * Get a KernelID for this intrinsic kernel.
-     *
-     * @return Script.KernelID The KernelID object.
-     */
-    public Script.KernelID getKernelID() {
-        Script.KernelID k = createKernelID(0, 3, null, null);
-        try {
-            k.mN = mN.getKernelID();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return k;
-    }
-}
-
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicBlend.java b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicBlend.java
index c48fd45..86bdcdb 100644
--- a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicBlend.java
+++ b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicBlend.java
@@ -35,10 +35,6 @@
      * @return ScriptIntrinsicBlend
      */
     public static ScriptIntrinsicBlend create(RenderScript rs, Element e) {
-        if (rs.isNative) {
-            RenderScriptThunker rst = (RenderScriptThunker) rs;
-            return ScriptIntrinsicBlendThunker.create(rs, e);
-        }
         // 7 comes from RS_SCRIPT_INTRINSIC_ID_BLEND in rsDefines.h
         int id = rs.nScriptIntrinsicCreate(7, e.getID(rs));
         return new ScriptIntrinsicBlend(id, rs);
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicBlendThunker.java b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicBlendThunker.java
deleted file mode 100644
index 7c70934..0000000
--- a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicBlendThunker.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.support.v8.renderscript;
-
-class ScriptIntrinsicBlendThunker extends ScriptIntrinsicBlend {
-    android.renderscript.ScriptIntrinsicBlend mN;
-
-    android.renderscript.ScriptIntrinsicBlend getNObj() {
-        return mN;
-    }
-
-    ScriptIntrinsicBlendThunker(int id, RenderScript rs) {
-        super(id, rs);
-    }
-
-    public static ScriptIntrinsicBlendThunker create(RenderScript rs, Element e) {
-        RenderScriptThunker rst = (RenderScriptThunker) rs;
-        ElementThunker et = (ElementThunker)e;
-
-        ScriptIntrinsicBlendThunker blend = new ScriptIntrinsicBlendThunker(0, rs);
-        try {
-            blend.mN = android.renderscript.ScriptIntrinsicBlend.create(rst.mN, et.getNObj());
-        } catch (android.renderscript.RSRuntimeException exc) {
-            throw ExceptionThunker.convertException(exc);
-        }
-        return blend;
-    }
-
-    public void forEachClear(Allocation ain, Allocation aout) {
-        AllocationThunker aint = (AllocationThunker)ain;
-        AllocationThunker aoutt = (AllocationThunker)aout;
-
-        try {
-            mN.forEachClear(aint.getNObj(), aoutt.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public Script.KernelID getKernelIDClear() {
-        Script.KernelID k = createKernelID(0, 3, null, null);
-        try {
-            k.mN = mN.getKernelIDClear();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return k;
-    }
-
-    public void forEachSrc(Allocation ain, Allocation aout) {
-        AllocationThunker aint = (AllocationThunker)ain;
-        AllocationThunker aoutt = (AllocationThunker)aout;
-
-        try {
-            mN.forEachSrc(aint.getNObj(), aoutt.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public Script.KernelID getKernelIDSrc() {
-        Script.KernelID k = createKernelID(1, 3, null, null);
-        try {
-            k.mN = mN.getKernelIDSrc();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return k;
-    }
-
-    public void forEachDst(Allocation ain, Allocation aout) {
-        AllocationThunker aint = (AllocationThunker)ain;
-        AllocationThunker aoutt = (AllocationThunker)aout;
-
-        try {
-            mN.forEachDst(aint.getNObj(), aoutt.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public Script.KernelID getKernelIDDst() {
-        Script.KernelID k = createKernelID(2, 3, null, null);
-        try {
-            k.mN = mN.getKernelIDDst();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return k;
-    }
-
-    public void forEachSrcOver(Allocation ain, Allocation aout) {
-        AllocationThunker aint = (AllocationThunker)ain;
-        AllocationThunker aoutt = (AllocationThunker)aout;
-
-        try {
-            mN.forEachSrcOver(aint.getNObj(), aoutt.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public Script.KernelID getKernelIDSrcOver() {
-        Script.KernelID k = createKernelID(3, 3, null, null);
-        try {
-            k.mN = mN.getKernelIDSrcOver();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return k;
-    }
-
-    public void forEachDstOver(Allocation ain, Allocation aout) {
-        AllocationThunker aint = (AllocationThunker)ain;
-        AllocationThunker aoutt = (AllocationThunker)aout;
-
-        try {
-            mN.forEachDstOver(aint.getNObj(), aoutt.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public Script.KernelID getKernelIDDstOver() {
-        Script.KernelID k = createKernelID(4, 3, null, null);
-        try {
-            k.mN = mN.getKernelIDDstOver();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return k;
-    }
-
-    public void forEachSrcIn(Allocation ain, Allocation aout) {
-        AllocationThunker aint = (AllocationThunker)ain;
-        AllocationThunker aoutt = (AllocationThunker)aout;
-
-        try {
-            mN.forEachSrcIn(aint.getNObj(), aoutt.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public Script.KernelID getKernelIDSrcIn() {
-        Script.KernelID k = createKernelID(5, 3, null, null);
-        try {
-            k.mN = mN.getKernelIDSrcIn();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return k;
-    }
-
-    public void forEachDstIn(Allocation ain, Allocation aout) {
-        AllocationThunker aint = (AllocationThunker)ain;
-        AllocationThunker aoutt = (AllocationThunker)aout;
-
-        try {
-            mN.forEachDstIn(aint.getNObj(), aoutt.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public Script.KernelID getKernelIDDstIn() {
-        Script.KernelID k = createKernelID(6, 3, null, null);
-        try {
-            k.mN = mN.getKernelIDDstIn();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return k;
-    }
-
-    public void forEachSrcOut(Allocation ain, Allocation aout) {
-        AllocationThunker aint = (AllocationThunker)ain;
-        AllocationThunker aoutt = (AllocationThunker)aout;
-
-        try {
-            mN.forEachSrcOut(aint.getNObj(), aoutt.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public Script.KernelID getKernelIDSrcOut() {
-        Script.KernelID k = createKernelID(7, 3, null, null);
-        try {
-            k.mN = mN.getKernelIDSrcOut();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return k;
-    }
-
-    public void forEachDstOut(Allocation ain, Allocation aout) {
-        AllocationThunker aint = (AllocationThunker)ain;
-        AllocationThunker aoutt = (AllocationThunker)aout;
-
-        try {
-            mN.forEachDstOut(aint.getNObj(), aoutt.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public Script.KernelID getKernelIDDstOut() {
-        Script.KernelID k = createKernelID(8, 3, null, null);
-        try {
-            k.mN = mN.getKernelIDDstOut();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return k;
-    }
-
-    public void forEachSrcAtop(Allocation ain, Allocation aout) {
-        AllocationThunker aint = (AllocationThunker)ain;
-        AllocationThunker aoutt = (AllocationThunker)aout;
-
-        try {
-            mN.forEachSrcAtop(aint.getNObj(), aoutt.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public Script.KernelID getKernelIDSrcAtop() {
-        Script.KernelID k = createKernelID(9, 3, null, null);
-        try {
-            k.mN = mN.getKernelIDSrcAtop();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return k;
-    }
-
-    public void forEachDstAtop(Allocation ain, Allocation aout) {
-        AllocationThunker aint = (AllocationThunker)ain;
-        AllocationThunker aoutt = (AllocationThunker)aout;
-
-        try {
-            mN.forEachDstAtop(aint.getNObj(), aoutt.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public Script.KernelID getKernelIDDstAtop() {
-        Script.KernelID k = createKernelID(10, 3, null, null);
-        try {
-            k.mN = mN.getKernelIDDstAtop();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return k;
-    }
-
-    public void forEachXor(Allocation ain, Allocation aout) {
-        AllocationThunker aint = (AllocationThunker)ain;
-        AllocationThunker aoutt = (AllocationThunker)aout;
-
-        try {
-            mN.forEachXor(aint.getNObj(), aoutt.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public Script.KernelID getKernelIDXor() {
-        Script.KernelID k = createKernelID(11, 3, null, null);
-        try {
-            k.mN = mN.getKernelIDXor();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return k;
-    }
-
-    public void forEachMultiply(Allocation ain, Allocation aout) {
-        AllocationThunker aint = (AllocationThunker)ain;
-        AllocationThunker aoutt = (AllocationThunker)aout;
-
-        try {
-            mN.forEachMultiply(aint.getNObj(), aoutt.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public Script.KernelID getKernelIDMultiply() {
-        Script.KernelID k = createKernelID(14, 3, null, null);
-        try {
-            k.mN = mN.getKernelIDMultiply();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return k;
-    }
-
-    public void forEachAdd(Allocation ain, Allocation aout) {
-        AllocationThunker aint = (AllocationThunker)ain;
-        AllocationThunker aoutt = (AllocationThunker)aout;
-
-        try {
-            mN.forEachAdd(aint.getNObj(), aoutt.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public Script.KernelID getKernelIDAdd() {
-        Script.KernelID k = createKernelID(34, 3, null, null);
-        try {
-            k.mN = mN.getKernelIDAdd();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return k;
-    }
-
-    public void forEachSubtract(Allocation ain, Allocation aout) {
-        AllocationThunker aint = (AllocationThunker)ain;
-        AllocationThunker aoutt = (AllocationThunker)aout;
-
-        try {
-            mN.forEachSubtract(aint.getNObj(), aoutt.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public Script.KernelID getKernelIDSubtract() {
-        Script.KernelID k = createKernelID(35, 3, null, null);
-        try {
-            k.mN = mN.getKernelIDSubtract();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return k;
-    }
-
-}
-
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicBlur.java b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicBlur.java
index b2b74cb..d6137c5 100644
--- a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicBlur.java
+++ b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicBlur.java
@@ -46,10 +46,6 @@
      * @return ScriptIntrinsicBlur
      */
     public static ScriptIntrinsicBlur create(RenderScript rs, Element e) {
-        if (rs.isNative) {
-            RenderScriptThunker rst = (RenderScriptThunker) rs;
-            return ScriptIntrinsicBlurThunker.create(rs, e);
-        }
         if ((!e.isCompatible(Element.U8_4(rs))) && (!e.isCompatible(Element.U8(rs)))) {
             throw new RSIllegalArgumentException("Unsuported element type.");
         }
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicBlurThunker.java b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicBlurThunker.java
deleted file mode 100644
index 31e22bb..0000000
--- a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicBlurThunker.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.support.v8.renderscript;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.util.Log;
-
-class ScriptIntrinsicBlurThunker extends ScriptIntrinsicBlur {
-
-    android.renderscript.ScriptIntrinsicBlur mN;
-
-    android.renderscript.ScriptIntrinsicBlur getNObj() {
-        return mN;
-    }
-
-    protected ScriptIntrinsicBlurThunker(int id, RenderScript rs) {
-        super(id, rs);
-    }
-
-    public static ScriptIntrinsicBlurThunker create(RenderScript rs, Element e) {
-        RenderScriptThunker rst = (RenderScriptThunker) rs;
-        ElementThunker et = (ElementThunker) e;
-
-        ScriptIntrinsicBlurThunker blur = new ScriptIntrinsicBlurThunker(0, rs);
-        try {
-            blur.mN = android.renderscript.ScriptIntrinsicBlur.create(rst.mN, et.getNObj());
-        } catch (android.renderscript.RSRuntimeException exc) {
-            throw ExceptionThunker.convertException(exc);
-        }
-        return blur;
-    }
-
-    public void setInput(Allocation ain) {
-        AllocationThunker aint = (AllocationThunker) ain;
-        try {
-            mN.setInput(aint.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void setRadius(float radius) {
-        try {
-            mN.setRadius(radius);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void forEach(Allocation aout) {
-        AllocationThunker aoutt = (AllocationThunker) aout;
-        if (aoutt != null) {
-            try {
-                mN.forEach(aoutt.getNObj());
-            } catch (android.renderscript.RSRuntimeException e) {
-                throw ExceptionThunker.convertException(e);
-            }
-        }
-    }
-
-    public Script.KernelID getKernelID() {
-        Script.KernelID k = createKernelID(0, 2, null, null);
-        try {
-            k.mN = mN.getKernelID();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return k;
-    }
-
-    public Script.FieldID getFieldID_Input() {
-        Script.FieldID f = createFieldID(1, null);
-        try {
-            f.mN = mN.getFieldID_Input();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return f;
-    }
-}
-
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicColorMatrix.java b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicColorMatrix.java
index f80d4ac..6125539 100644
--- a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicColorMatrix.java
+++ b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicColorMatrix.java
@@ -47,11 +47,6 @@
      * @return ScriptIntrinsicColorMatrix
      */
     public static ScriptIntrinsicColorMatrix create(RenderScript rs, Element e) {
-        if (rs.isNative) {
-            RenderScriptThunker rst = (RenderScriptThunker) rs;
-            return ScriptIntrinsicColorMatrixThunker.create(rs, e);
-        }
-
         if (!e.isCompatible(Element.U8_4(rs))) {
             throw new RSIllegalArgumentException("Unsuported element type.");
         }
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicColorMatrixThunker.java b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicColorMatrixThunker.java
deleted file mode 100644
index 797c0e7..0000000
--- a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicColorMatrixThunker.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.support.v8.renderscript;
-
-import android.util.Log;
-
-class ScriptIntrinsicColorMatrixThunker extends ScriptIntrinsicColorMatrix {
-    android.renderscript.ScriptIntrinsicColorMatrix mN;
-
-    android.renderscript.ScriptIntrinsicColorMatrix getNObj() {
-        return mN;
-    }
-
-    private ScriptIntrinsicColorMatrixThunker(int id, RenderScript rs) {
-        super(id, rs);
-    }
-
-    public static ScriptIntrinsicColorMatrixThunker create(RenderScript rs, Element e) {
-        RenderScriptThunker rst = (RenderScriptThunker) rs;
-        ElementThunker et = (ElementThunker)e;
-
-        ScriptIntrinsicColorMatrixThunker cm =  new ScriptIntrinsicColorMatrixThunker(0, rs);
-        try {
-            cm.mN = android.renderscript.ScriptIntrinsicColorMatrix.create(rst.mN, et.getNObj());
-        } catch (android.renderscript.RSRuntimeException exc) {
-            throw ExceptionThunker.convertException(exc);
-        }
-        return cm;
-
-    }
-
-    public void setColorMatrix(Matrix4f m) {
-        try {
-            mN.setColorMatrix(new android.renderscript.Matrix4f(m.getArray()));
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void setColorMatrix(Matrix3f m) {
-        try {
-            mN.setColorMatrix(new android.renderscript.Matrix3f(m.getArray()));
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void setGreyscale() {
-        try {
-            mN.setGreyscale();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void setYUVtoRGB() {
-        try {
-            mN.setYUVtoRGB();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void setRGBtoYUV() {
-        try {
-            mN.setRGBtoYUV();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-
-    public void forEach(Allocation ain, Allocation aout) {
-        AllocationThunker aint = (AllocationThunker)ain;
-        AllocationThunker aoutt = (AllocationThunker)aout;
-        try {
-            mN.forEach(aint.getNObj(), aoutt.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public Script.KernelID getKernelID() {
-        Script.KernelID k = createKernelID(0, 3, null, null);
-        try {
-            k.mN = mN.getKernelID();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return k;
-    }
-
-}
-
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicConvolve3x3.java b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicConvolve3x3.java
index c902917..1446986 100644
--- a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicConvolve3x3.java
+++ b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicConvolve3x3.java
@@ -47,11 +47,6 @@
      * @return ScriptIntrinsicConvolve3x3
      */
     public static ScriptIntrinsicConvolve3x3 create(RenderScript rs, Element e) {
-        if (rs.isNative) {
-            RenderScriptThunker rst = (RenderScriptThunker) rs;
-            return ScriptIntrinsicConvolve3x3Thunker.create(rs, e);
-        }
-
         float f[] = { 0, 0, 0, 0, 1, 0, 0, 0, 0};
         if (!e.isCompatible(Element.U8_4(rs))) {
             throw new RSIllegalArgumentException("Unsuported element type.");
@@ -60,7 +55,6 @@
         ScriptIntrinsicConvolve3x3 si = new ScriptIntrinsicConvolve3x3(id, rs);
         si.setCoefficients(f);
         return si;
-
     }
 
     /**
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicConvolve3x3Thunker.java b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicConvolve3x3Thunker.java
deleted file mode 100644
index fa997c1..0000000
--- a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicConvolve3x3Thunker.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.support.v8.renderscript;
-
-import android.util.Log;
-
-class ScriptIntrinsicConvolve3x3Thunker extends ScriptIntrinsicConvolve3x3 {
-    android.renderscript.ScriptIntrinsicConvolve3x3 mN;
-
-    android.renderscript.ScriptIntrinsicConvolve3x3 getNObj() {
-        return mN;
-    }
-
-
-    ScriptIntrinsicConvolve3x3Thunker(int id, RenderScript rs) {
-        super(id, rs);
-    }
-
-    public static ScriptIntrinsicConvolve3x3Thunker create(RenderScript rs, Element e) {
-        RenderScriptThunker rst = (RenderScriptThunker) rs;
-        ElementThunker et = (ElementThunker) e;
-
-        ScriptIntrinsicConvolve3x3Thunker si = new ScriptIntrinsicConvolve3x3Thunker(0, rs);
-        try {
-            si.mN = android.renderscript.ScriptIntrinsicConvolve3x3.create(rst.mN, et.getNObj());
-        } catch (android.renderscript.RSRuntimeException exc) {
-            throw ExceptionThunker.convertException(exc);
-        }
-        return si;
-    }
-
-    public void setInput(Allocation ain) {
-        AllocationThunker aint = (AllocationThunker)ain;
-        try {
-            mN.setInput(aint.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void setCoefficients(float v[]) {
-        try {
-            mN.setCoefficients(v);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void forEach(Allocation aout) {
-        AllocationThunker aoutt = (AllocationThunker)aout;
-        try {
-            mN.forEach(aoutt.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-
-    }
-
-    public Script.KernelID getKernelID() {
-        Script.KernelID k = createKernelID(0, 2, null, null);
-        try {
-            k.mN = mN.getKernelID();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return k;
-    }
-
-    public Script.FieldID getFieldID_Input() {
-        Script.FieldID f = createFieldID(1, null);
-        try {
-            f.mN = mN.getFieldID_Input();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return f;
-    }
-
-}
-
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicConvolve5x5.java b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicConvolve5x5.java
index a651c0f..b41e494 100644
--- a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicConvolve5x5.java
+++ b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicConvolve5x5.java
@@ -48,10 +48,6 @@
      * @return ScriptIntrinsicConvolve5x5
      */
     public static ScriptIntrinsicConvolve5x5 create(RenderScript rs, Element e) {
-        if (rs.isNative) {
-            RenderScriptThunker rst = (RenderScriptThunker) rs;
-            return ScriptIntrinsicConvolve5x5Thunker.create(rs, e);
-        }
         int id = rs.nScriptIntrinsicCreate(4, e.getID(rs));
         return new ScriptIntrinsicConvolve5x5(id, rs);
 
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicConvolve5x5Thunker.java b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicConvolve5x5Thunker.java
deleted file mode 100644
index 2071ddd..0000000
--- a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicConvolve5x5Thunker.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.support.v8.renderscript;
-
-import android.util.Log;
-
-class ScriptIntrinsicConvolve5x5Thunker extends ScriptIntrinsicConvolve5x5 {
-    android.renderscript.ScriptIntrinsicConvolve5x5 mN;
-
-    android.renderscript.ScriptIntrinsicConvolve5x5 getNObj() {
-        return mN;
-    }
-
-
-    ScriptIntrinsicConvolve5x5Thunker(int id, RenderScript rs) {
-        super(id, rs);
-    }
-
-    public static ScriptIntrinsicConvolve5x5Thunker create(RenderScript rs, Element e) {
-        RenderScriptThunker rst = (RenderScriptThunker) rs;
-        ElementThunker et = (ElementThunker) e;
-
-        ScriptIntrinsicConvolve5x5Thunker si = new ScriptIntrinsicConvolve5x5Thunker(0, rs);
-        try {
-            si.mN = android.renderscript.ScriptIntrinsicConvolve5x5.create(rst.mN, et.getNObj());
-        } catch (android.renderscript.RSRuntimeException exc) {
-            throw ExceptionThunker.convertException(exc);
-        }
-        return si;
-    }
-
-    public void setInput(Allocation ain) {
-        AllocationThunker aint = (AllocationThunker)ain;
-        try {
-            mN.setInput(aint.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void setCoefficients(float v[]) {
-        try {
-            mN.setCoefficients(v);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void forEach(Allocation aout) {
-        AllocationThunker aoutt = (AllocationThunker)aout;
-        try {
-            mN.forEach(aoutt.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-
-    }
-
-    public Script.KernelID getKernelID() {
-        Script.KernelID k = createKernelID(0, 2, null, null);
-        try {
-            k.mN = mN.getKernelID();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return k;
-    }
-
-    public Script.FieldID getFieldID_Input() {
-        Script.FieldID f = createFieldID(1, null);
-        try {
-            f.mN = mN.getFieldID_Input();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return f;
-    }
-
-}
-
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicLUT.java b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicLUT.java
index 1c0c819..eb89fb5 100644
--- a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicLUT.java
+++ b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicLUT.java
@@ -45,11 +45,6 @@
      * @return ScriptIntrinsicLUT
      */
     public static ScriptIntrinsicLUT create(RenderScript rs, Element e) {
-        if (rs.isNative) {
-            RenderScriptThunker rst = (RenderScriptThunker) rs;
-            return ScriptIntrinsicLUTThunker.create(rs, e);
-        }
-
         int id = rs.nScriptIntrinsicCreate(3, e.getID(rs));
 
         ScriptIntrinsicLUT si = new ScriptIntrinsicLUT(id, rs);
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicLUTThunker.java b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicLUTThunker.java
deleted file mode 100644
index ecd17f2..0000000
--- a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicLUTThunker.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.support.v8.renderscript;
-
-import android.util.Log;
-
-class ScriptIntrinsicLUTThunker extends ScriptIntrinsicLUT {
-    android.renderscript.ScriptIntrinsicLUT mN;
-
-    android.renderscript.ScriptIntrinsicLUT getNObj() {
-        return mN;
-    }
-
-    private ScriptIntrinsicLUTThunker(int id, RenderScript rs) {
-        super(id, rs);
-    }
-
-    public static ScriptIntrinsicLUTThunker create(RenderScript rs, Element e) {
-        RenderScriptThunker rst = (RenderScriptThunker) rs;
-        ElementThunker et = (ElementThunker) e;
-
-        ScriptIntrinsicLUTThunker si = new ScriptIntrinsicLUTThunker(0, rs);
-        try {
-            si.mN = android.renderscript.ScriptIntrinsicLUT.create(rst.mN, et.getNObj());
-        } catch (android.renderscript.RSRuntimeException exc) {
-            throw ExceptionThunker.convertException(exc);
-        }
-        return si;
-    }
-
-    public void setRed(int index, int value) {
-        try {
-            mN.setRed(index, value);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void setGreen(int index, int value) {
-        try {
-            mN.setGreen(index, value);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void setBlue(int index, int value) {
-        try {
-            mN.setBlue(index, value);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void setAlpha(int index, int value) {
-        try {
-            mN.setAlpha(index, value);
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void forEach(Allocation ain, Allocation aout) {
-        AllocationThunker aint = (AllocationThunker)ain;
-        AllocationThunker aoutt = (AllocationThunker)aout;
-        try {
-            mN.forEach(aint.getNObj(), aoutt.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public Script.KernelID getKernelID() {
-        Script.KernelID k = createKernelID(0, 3, null, null);
-        try {
-            k.mN = mN.getKernelID();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return k;
-    }
-}
-
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicYuvToRGB.java b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicYuvToRGB.java
index 70e43ba..9e48713 100644
--- a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicYuvToRGB.java
+++ b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicYuvToRGB.java
@@ -42,11 +42,6 @@
      * @return ScriptIntrinsicYuvToRGB
      */
     public static ScriptIntrinsicYuvToRGB create(RenderScript rs, Element e) {
-        if (rs.isNative) {
-            RenderScriptThunker rst = (RenderScriptThunker) rs;
-            return ScriptIntrinsicYuvToRGBThunker.create(rs, e);
-        }
-
         // 6 comes from RS_SCRIPT_INTRINSIC_YUV_TO_RGB in rsDefines.h
         int id = rs.nScriptIntrinsicCreate(6, e.getID(rs));
         ScriptIntrinsicYuvToRGB si = new ScriptIntrinsicYuvToRGB(id, rs);
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicYuvToRGBThunker.java b/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicYuvToRGBThunker.java
deleted file mode 100644
index 7338469..0000000
--- a/v8/renderscript/java/src/android/support/v8/renderscript/ScriptIntrinsicYuvToRGBThunker.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.support.v8.renderscript;
-
-
-class ScriptIntrinsicYuvToRGBThunker extends ScriptIntrinsicYuvToRGB {
-    android.renderscript.ScriptIntrinsicYuvToRGB mN;
-
-    android.renderscript.ScriptIntrinsicYuvToRGB getNObj() {
-        return mN;
-    }
-
-
-    private ScriptIntrinsicYuvToRGBThunker(int id, RenderScript rs) {
-        super(id, rs);
-    }
-
-    public static ScriptIntrinsicYuvToRGBThunker create(RenderScript rs, Element e) {
-        RenderScriptThunker rst = (RenderScriptThunker) rs;
-        ElementThunker et = (ElementThunker) e;
-
-        ScriptIntrinsicYuvToRGBThunker si = new ScriptIntrinsicYuvToRGBThunker(0, rs);
-        try {
-            si.mN = android.renderscript.ScriptIntrinsicYuvToRGB.create(rst.mN, et.getNObj());
-        } catch (android.renderscript.RSRuntimeException exc) {
-            throw ExceptionThunker.convertException(exc);
-        }
-        return si;
-    }
-
-
-    public void setInput(Allocation ain) {
-        AllocationThunker aint = (AllocationThunker)ain;
-        try {
-            mN.setInput(aint.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public void forEach(Allocation aout) {
-        AllocationThunker aoutt = (AllocationThunker)aout;
-        try {
-            mN.forEach(aoutt.getNObj());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-    }
-
-    public Script.KernelID getKernelID() {
-        Script.KernelID k = createKernelID(0, 2, null, null);
-        try {
-            k.mN = mN.getKernelID();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return k;
-    }
-
-    public Script.FieldID getFieldID_Input() {
-        Script.FieldID f = createFieldID(0, null);
-        try {
-            f.mN = mN.getFieldID_Input();
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-        return f;
-    }
-}
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/Type.java b/v8/renderscript/java/src/android/support/v8/renderscript/Type.java
index a6eeb77..b688523 100644
--- a/v8/renderscript/java/src/android/support/v8/renderscript/Type.java
+++ b/v8/renderscript/java/src/android/support/v8/renderscript/Type.java
@@ -312,15 +312,10 @@
             }
 
             Type t;
-            if (mRS.isNative) {
-                RenderScriptThunker rst = (RenderScriptThunker)mRS;
-                t = TypeThunker.create(rst, mElement, mDimX, mDimY, mDimZ,
-                                       mDimMipmaps, mDimFaces, mYuv);
-            } else {
-                int id = mRS.nTypeCreate(mElement.getID(mRS),
-                                         mDimX, mDimY, mDimZ, mDimMipmaps, mDimFaces, mYuv);
-                t = new Type(id, mRS);
-            }
+            int id = mRS.nTypeCreate(mElement.getID(mRS),
+                                     mDimX, mDimY, mDimZ, mDimMipmaps, mDimFaces, mYuv);
+            t = new Type(id, mRS);
+
             t.mElement = mElement;
             t.mDimX = mDimX;
             t.mDimY = mDimY;
diff --git a/v8/renderscript/java/src/android/support/v8/renderscript/TypeThunker.java b/v8/renderscript/java/src/android/support/v8/renderscript/TypeThunker.java
deleted file mode 100644
index 557c545..0000000
--- a/v8/renderscript/java/src/android/support/v8/renderscript/TypeThunker.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.support.v8.renderscript;
-
-import android.graphics.ImageFormat;
-import android.util.Log;
-import java.util.HashMap;
-
-class TypeThunker extends Type {
-    android.renderscript.Type mN;
-
-    android.renderscript.Type getNObj() {
-        return mN;
-    }
-
-    static HashMap<android.renderscript.Type, Type> mMap = new HashMap();
-
-    void internalCalc() {
-        mDimX = mN.getX();
-        mDimY = mN.getY();
-        mDimZ = mN.getZ();
-        mDimFaces = mN.hasFaces();
-        mDimMipmaps = mN.hasMipmaps();
-        mDimYuv = mN.getYuv();
-        calcElementCount();
-    }
-
-    TypeThunker(RenderScript rs, android.renderscript.Type t) {
-        super(0, rs);
-        mN = t;
-        try {
-            internalCalc();
-            mElement = new ElementThunker(rs, t.getElement());
-        } catch (android.renderscript.RSRuntimeException e) {
-            throw ExceptionThunker.convertException(e);
-        }
-
-        synchronized(mMap) {
-            mMap.put(mN, this);
-        }
-    }
-
-    static Type find(android.renderscript.Type nt) {
-        return mMap.get(nt);
-    }
-
-    static Type create(RenderScript rs, Element e,
-                       int dx, int dy, int dz, boolean dmip, boolean dfaces, int yuv) {
-        ElementThunker et = (ElementThunker)e;
-        RenderScriptThunker rst = (RenderScriptThunker)rs;
-        try {
-            android.renderscript.Type.Builder tb =
-                new android.renderscript.Type.Builder(rst.mN, et.mN);
-            if (dx > 0) tb.setX(dx);
-            if (dy > 0) tb.setY(dy);
-            if (dz > 0) tb.setZ(dz);
-            if (dmip) tb.setMipmaps(dmip);
-            if (dfaces) tb.setFaces(dfaces);
-            if (yuv > 0) tb.setYuvFormat(yuv);
-            android.renderscript.Type nt = tb.create();
-            TypeThunker tt = new TypeThunker(rs, nt);
-            tt.internalCalc();
-
-            return tt;
-        } catch (android.renderscript.RSRuntimeException exc) {
-            throw ExceptionThunker.convertException(exc);
-        }
-    }
-}
diff --git a/v8/renderscript/jni/Android.mk b/v8/renderscript/jni/Android.mk
index 9b36b90..4ee8a25 100644
--- a/v8/renderscript/jni/Android.mk
+++ b/v8/renderscript/jni/Android.mk
@@ -8,7 +8,6 @@
     android_renderscript_RenderScript.cpp
 
 LOCAL_SHARED_LIBRARIES := \
-        libRSSupport \
         libjnigraphics
 
 LOCAL_STATIC_LIBRARIES := \
@@ -19,6 +18,7 @@
 LOCAL_C_INCLUDES += \
 	$(JNI_H_INCLUDE) \
 	frameworks/rs \
+	frameworks/rs/cpp \
 	$(rs_generated_include_dir)
 
 LOCAL_CFLAGS += -Wno-unused-parameter -U_FORTIFY_SOURCE
@@ -30,4 +30,6 @@
 LOCAL_REQUIRED_MODULES := libRSSupport
 LOCAL_32_BIT_ONLY := true
 
+LOCAL_LDFLAGS += -ldl
+
 include $(BUILD_SHARED_LIBRARY)
diff --git a/v8/renderscript/jni/android_renderscript_RenderScript.cpp b/v8/renderscript/jni/android_renderscript_RenderScript.cpp
index 07374b6..593cdfe 100644
--- a/v8/renderscript/jni/android_renderscript_RenderScript.cpp
+++ b/v8/renderscript/jni/android_renderscript_RenderScript.cpp
@@ -27,6 +27,9 @@
 #include <rs.h>
 #include <rsEnv.h>
 
+#include "rsDispatch.h"
+#include <dlfcn.h>
+
 //#define LOG_API ALOG
 #define LOG_API(...)
 
@@ -87,20 +90,382 @@
     jsize        mStringsLength;
 };
 
+
+// ---------------------------------------------------------------------------
+
+static dispatchTable dispatchTab;
+
+static bool loadSymbols(void* handle) {
+
+    dispatchTab.AllocationGetType = (AllocationGetTypeFnPtr)dlsym(handle, "rsaAllocationGetType");
+    if (dispatchTab.AllocationGetType == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.AllocationGetType");
+        return false;
+    }
+    dispatchTab.TypeGetNativeData = (TypeGetNativeDataFnPtr)dlsym(handle, "rsaTypeGetNativeData");
+    if (dispatchTab.TypeGetNativeData == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.TypeGetNativeData");
+        return false;
+    }
+    dispatchTab.ElementGetNativeData = (ElementGetNativeDataFnPtr)dlsym(handle, "rsaElementGetNativeData");
+    if (dispatchTab.ElementGetNativeData == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ElementGetNativeData");
+        return false;
+    }
+    dispatchTab.ElementGetSubElements = (ElementGetSubElementsFnPtr)dlsym(handle, "rsaElementGetSubElements");
+    if (dispatchTab.ElementGetSubElements == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ElementGetSubElements");
+        return false;
+    }
+    dispatchTab.DeviceCreate = (DeviceCreateFnPtr)dlsym(handle, "rsDeviceCreate");
+    if (dispatchTab.DeviceCreate == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.DeviceCreate");
+        return false;
+    }
+    dispatchTab.DeviceDestroy = (DeviceDestroyFnPtr)dlsym(handle, "rsDeviceDestroy");
+    if (dispatchTab.DeviceDestroy == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.DeviceDestroy");
+        return false;
+    }
+    dispatchTab.DeviceSetConfig = (DeviceSetConfigFnPtr)dlsym(handle, "rsDeviceSetConfig");
+    if (dispatchTab.DeviceSetConfig == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.DeviceSetConfig");
+        return false;
+    }
+    dispatchTab.ContextCreate = (ContextCreateFnPtr)dlsym(handle, "rsContextCreate");;
+    if (dispatchTab.ContextCreate == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ContextCreate");
+        return false;
+    }
+    dispatchTab.GetName = (GetNameFnPtr)dlsym(handle, "rsaGetName");;
+    if (dispatchTab.GetName == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.GetName");
+        return false;
+    }
+    dispatchTab.ContextDestroy = (ContextDestroyFnPtr)dlsym(handle, "rsContextDestroy");
+    if (dispatchTab.ContextDestroy == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ContextDestroy");
+        return false;
+    }
+    dispatchTab.ContextGetMessage = (ContextGetMessageFnPtr)dlsym(handle, "rsContextGetMessage");
+    if (dispatchTab.ContextGetMessage == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ContextGetMessage");
+        return false;
+    }
+    dispatchTab.ContextPeekMessage = (ContextPeekMessageFnPtr)dlsym(handle, "rsContextPeekMessage");
+    if (dispatchTab.ContextPeekMessage == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ContextPeekMessage");
+        return false;
+    }
+    dispatchTab.ContextSendMessage = (ContextSendMessageFnPtr)dlsym(handle, "rsContextSendMessage");
+    if (dispatchTab.ContextSendMessage == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ContextSendMessage");
+        return false;
+    }
+    dispatchTab.ContextInitToClient = (ContextInitToClientFnPtr)dlsym(handle, "rsContextInitToClient");
+    if (dispatchTab.ContextInitToClient == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ContextInitToClient");
+        return false;
+    }
+    dispatchTab.ContextDeinitToClient = (ContextDeinitToClientFnPtr)dlsym(handle, "rsContextDeinitToClient");
+    if (dispatchTab.ContextDeinitToClient == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ContextDeinitToClient");
+        return false;
+    }
+    dispatchTab.TypeCreate = (TypeCreateFnPtr)dlsym(handle, "rsTypeCreate");
+    if (dispatchTab.TypeCreate == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.TypeCreate");
+        return false;
+    }
+    dispatchTab.AllocationCreateTyped = (AllocationCreateTypedFnPtr)dlsym(handle, "rsAllocationCreateTyped");
+    if (dispatchTab.AllocationCreateTyped == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.AllocationCreateTyped");
+        return false;
+    }
+    dispatchTab.AllocationCreateFromBitmap = (AllocationCreateFromBitmapFnPtr)dlsym(handle, "rsAllocationCreateFromBitmap");
+    if (dispatchTab.AllocationCreateFromBitmap == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.AllocationCreateFromBitmap");
+        return false;
+    }
+    dispatchTab.AllocationCubeCreateFromBitmap = (AllocationCubeCreateFromBitmapFnPtr)dlsym(handle, "rsAllocationCubeCreateFromBitmap");
+    if (dispatchTab.AllocationCubeCreateFromBitmap == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.AllocationCubeCreateFromBitmap");
+        return false;
+    }
+    dispatchTab.AllocationGetSurface = (AllocationGetSurfaceFnPtr)dlsym(handle, "rsAllocationGetSurface");
+    if (dispatchTab.AllocationGetSurface == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.AllocationGetSurface");
+        return false;
+    }
+    dispatchTab.AllocationSetSurface = (AllocationSetSurfaceFnPtr)dlsym(handle, "rsAllocationSetSurface");
+    if (dispatchTab.AllocationSetSurface == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.AllocationSetSurface");
+        return false;
+    }
+    dispatchTab.ContextFinish = (ContextFinishFnPtr)dlsym(handle, "rsContextFinish");
+    if (dispatchTab.ContextFinish == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ContextFinish");
+        return false;
+    }
+    dispatchTab.ContextDump = (ContextDumpFnPtr)dlsym(handle, "rsContextDump");
+    if (dispatchTab.ContextDump == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ContextDump");
+        return false;
+    }
+    dispatchTab.ContextSetPriority = (ContextSetPriorityFnPtr)dlsym(handle, "rsContextSetPriority");
+    if (dispatchTab.ContextSetPriority == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ContextSetPriority");
+        return false;
+    }
+    dispatchTab.AssignName = (AssignNameFnPtr)dlsym(handle, "rsAssignName");
+    if (dispatchTab.AssignName == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.AssignName");
+        return false;
+    }
+    dispatchTab.ObjDestroy = (ObjDestroyFnPtr)dlsym(handle, "rsObjDestroy");
+    if (dispatchTab.ObjDestroy == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ObjDestroy");
+        return false;
+    }
+    dispatchTab.ElementCreate = (ElementCreateFnPtr)dlsym(handle, "rsElementCreate");
+    if (dispatchTab.ElementCreate == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ElementCreate");
+        return false;
+    }
+    dispatchTab.ElementCreate2 = (ElementCreate2FnPtr)dlsym(handle, "rsElementCreate2");
+    if (dispatchTab.ElementCreate2 == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ElementCreate2");
+        return false;
+    }
+    dispatchTab.AllocationCopyToBitmap = (AllocationCopyToBitmapFnPtr)dlsym(handle, "rsAllocationCopyToBitmap");
+    if (dispatchTab.AllocationCopyToBitmap == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.AllocationCopyToBitmap");
+        return false;
+    }
+    dispatchTab.Allocation1DData = (Allocation1DDataFnPtr)dlsym(handle, "rsAllocation1DData");
+    if (dispatchTab.Allocation1DData == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.Allocation1DData");
+        return false;
+    }
+    dispatchTab.Allocation1DElementData = (Allocation1DElementDataFnPtr)dlsym(handle, "rsAllocation1DElementData");
+    if (dispatchTab.Allocation1DElementData == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.Allocation1DElementData");
+        return false;
+    }
+    dispatchTab.Allocation2DData = (Allocation2DDataFnPtr)dlsym(handle, "rsAllocation2DData");
+    if (dispatchTab.Allocation2DData == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.Allocation2DData");
+        return false;
+    }
+    dispatchTab.Allocation3DData = (Allocation3DDataFnPtr)dlsym(handle, "rsAllocation3DData");
+    if (dispatchTab.Allocation3DData == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.Allocation3DData");
+        return false;
+    }
+    dispatchTab.AllocationGenerateMipmaps = (AllocationGenerateMipmapsFnPtr)dlsym(handle, "rsAllocationGenerateMipmaps");
+    if (dispatchTab.AllocationGenerateMipmaps == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.AllocationGenerateMipmaps");
+        return false;
+    }
+    dispatchTab.AllocationRead = (AllocationReadFnPtr)dlsym(handle, "rsAllocationRead");
+    if (dispatchTab.AllocationRead == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.AllocationRead");
+        return false;
+    }
+    dispatchTab.Allocation1DRead = (Allocation1DReadFnPtr)dlsym(handle, "rsAllocation1DRead");
+    if (dispatchTab.Allocation1DRead == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.Allocation1DRead");
+        return false;
+    }
+    dispatchTab.Allocation2DRead = (Allocation2DReadFnPtr)dlsym(handle, "rsAllocation2DRead");
+    if (dispatchTab.Allocation2DRead == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.Allocation2DRead");
+        return false;
+    }
+    dispatchTab.AllocationSyncAll = (AllocationSyncAllFnPtr)dlsym(handle, "rsAllocationSyncAll");
+    if (dispatchTab.AllocationSyncAll == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.AllocationSyncAll");
+        return false;
+    }
+    dispatchTab.AllocationResize1D = (AllocationResize1DFnPtr)dlsym(handle, "rsAllocationResize1D");
+    if (dispatchTab.AllocationResize1D == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.AllocationResize1D");
+        return false;
+    }
+    dispatchTab.AllocationCopy2DRange = (AllocationCopy2DRangeFnPtr)dlsym(handle, "rsAllocationCopy2DRange");
+    if (dispatchTab.AllocationCopy2DRange == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.AllocationCopy2DRange");
+        return false;
+    }
+    dispatchTab.AllocationCopy3DRange = (AllocationCopy3DRangeFnPtr)dlsym(handle, "rsAllocationCopy3DRange");
+    if (dispatchTab.AllocationCopy3DRange == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.AllocationCopy3DRange");
+        return false;
+    }
+    dispatchTab.SamplerCreate = (SamplerCreateFnPtr)dlsym(handle, "rsSamplerCreate");
+    if (dispatchTab.SamplerCreate == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.SamplerCreate");
+        return false;
+    }
+    dispatchTab.ScriptBindAllocation = (ScriptBindAllocationFnPtr)dlsym(handle, "rsScriptBindAllocation");
+    if (dispatchTab.ScriptBindAllocation == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ScriptBindAllocation");
+        return false;
+    }
+    dispatchTab.ScriptSetTimeZone = (ScriptSetTimeZoneFnPtr)dlsym(handle, "rsScriptSetTimeZone");
+    if (dispatchTab.ScriptSetTimeZone == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ScriptSetTimeZone");
+        return false;
+    }
+    dispatchTab.ScriptInvoke = (ScriptInvokeFnPtr)dlsym(handle, "rsScriptInvoke");
+    if (dispatchTab.ScriptInvoke == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ScriptInvoke");
+        return false;
+    }
+    dispatchTab.ScriptInvokeV = (ScriptInvokeVFnPtr)dlsym(handle, "rsScriptInvokeV");
+    if (dispatchTab.ScriptInvokeV == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ScriptInvokeV");
+        return false;
+    }
+    dispatchTab.ScriptForEach = (ScriptForEachFnPtr)dlsym(handle, "rsScriptForEach");
+    if (dispatchTab.ScriptForEach == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ScriptForEach");
+        return false;
+    }
+    dispatchTab.ScriptSetVarI = (ScriptSetVarIFnPtr)dlsym(handle, "rsScriptSetVarI");
+    if (dispatchTab.ScriptSetVarI == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ScriptSetVarI");
+        return false;
+    }
+    dispatchTab.ScriptSetVarObj = (ScriptSetVarObjFnPtr)dlsym(handle, "rsScriptSetVarObj");
+    if (dispatchTab.ScriptSetVarObj == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ScriptSetVarObj");
+        return false;
+    }
+    dispatchTab.ScriptSetVarJ = (ScriptSetVarJFnPtr)dlsym(handle, "rsScriptSetVarJ");
+    if (dispatchTab.ScriptSetVarJ == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ScriptSetVarJ");
+        return false;
+    }
+    dispatchTab.ScriptSetVarF = (ScriptSetVarFFnPtr)dlsym(handle, "rsScriptSetVarF");
+    if (dispatchTab.ScriptSetVarF == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ScriptSetVarF");
+        return false;
+    }
+    dispatchTab.ScriptSetVarD = (ScriptSetVarDFnPtr)dlsym(handle, "rsScriptSetVarD");
+    if (dispatchTab.ScriptSetVarD == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ScriptSetVarD");
+        return false;
+    }
+    dispatchTab.ScriptSetVarV = (ScriptSetVarVFnPtr)dlsym(handle, "rsScriptSetVarV");
+    if (dispatchTab.ScriptSetVarV == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ScriptSetVarV");
+        return false;
+    }
+    dispatchTab.ScriptGetVarV = (ScriptGetVarVFnPtr)dlsym(handle, "rsScriptGetVarV");
+    if (dispatchTab.ScriptGetVarV == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ScriptGetVarV");
+        return false;
+    }
+    dispatchTab.ScriptSetVarVE = (ScriptSetVarVEFnPtr)dlsym(handle, "rsScriptSetVarVE");
+    if (dispatchTab.ScriptSetVarVE == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ScriptSetVarVE");
+        return false;
+    }
+    dispatchTab.ScriptCCreate = (ScriptCCreateFnPtr)dlsym(handle, "rsScriptCCreate");
+    if (dispatchTab.ScriptCCreate == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ScriptCCreate");
+        return false;
+    }
+    dispatchTab.ScriptIntrinsicCreate = (ScriptIntrinsicCreateFnPtr)dlsym(handle, "rsScriptIntrinsicCreate");
+    if (dispatchTab.ScriptIntrinsicCreate == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ScriptIntrinsicCreate");
+        return false;
+    }
+    dispatchTab.ScriptKernelIDCreate = (ScriptKernelIDCreateFnPtr)dlsym(handle, "rsScriptKernelIDCreate");
+    if (dispatchTab.ScriptKernelIDCreate == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ScriptKernelIDCreate");
+        return false;
+    }
+    dispatchTab.ScriptFieldIDCreate = (ScriptFieldIDCreateFnPtr)dlsym(handle, "rsScriptFieldIDCreate");
+    if (dispatchTab.ScriptFieldIDCreate == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ScriptFieldIDCreate");
+        return false;
+    }
+    dispatchTab.ScriptGroupCreate = (ScriptGroupCreateFnPtr)dlsym(handle, "rsScriptGroupCreate");
+    if (dispatchTab.ScriptGroupCreate == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ScriptGroupCreate");
+        return false;
+    }
+    dispatchTab.ScriptGroupSetOutput = (ScriptGroupSetOutputFnPtr)dlsym(handle, "rsScriptGroupSetOutput");
+    if (dispatchTab.ScriptGroupSetOutput == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ScriptGroupSetOutput");
+        return false;
+    }
+    dispatchTab.ScriptGroupSetInput = (ScriptGroupSetInputFnPtr)dlsym(handle, "rsScriptGroupSetInput");
+    if (dispatchTab.ScriptGroupSetInput == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ScriptGroupSetInput");
+        return false;
+    }
+    dispatchTab.ScriptGroupExecute = (ScriptGroupExecuteFnPtr)dlsym(handle, "rsScriptGroupExecute");
+    if (dispatchTab.ScriptGroupExecute == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.ScriptGroupExecute");
+        return false;
+    }
+    dispatchTab.AllocationIoSend = (AllocationIoSendFnPtr)dlsym(handle, "rsAllocationIoSend");
+    if (dispatchTab.AllocationIoSend == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.AllocationIoSend");
+        return false;
+    }
+    dispatchTab.AllocationIoReceive = (AllocationIoReceiveFnPtr)dlsym(handle, "rsAllocationIoReceive");
+    if (dispatchTab.AllocationIoReceive == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.AllocationIoReceive");
+        return false;
+    }
+    dispatchTab.AllocationGetPointer = (AllocationGetPointerFnPtr)dlsym(handle, "rsAllocationGetPointer");
+    if (dispatchTab.AllocationGetPointer == NULL) {
+        LOG_API("Couldn't initialize dispatchTab.AllocationGetPointer");
+        return false;
+    }
+
+    return true;
+}
+
+
+static jboolean nLoadSO(JNIEnv *_env, jobject _this, jboolean useNative) {
+    void* handle = NULL;
+    if (useNative) {
+        handle = dlopen("libRS.so", RTLD_LAZY | RTLD_LOCAL);
+    } else {
+        handle = dlopen("libRSSupport.so", RTLD_LAZY | RTLD_LOCAL);
+    }
+    if (handle == NULL) {
+        LOG_API("couldn't dlopen %s, %s", filename, dlerror());
+        return false;
+    }
+
+    if (loadSymbols(handle) == false) {
+        LOG_API("%s init failed!", filename);
+        return false;
+    }
+    LOG_API("Successfully loaded %s", filename);
+    return true;
+}
+
 // ---------------------------------------------------------------------------
 
 static void
 nContextFinish(JNIEnv *_env, jobject _this, RsContext con)
 {
     LOG_API("nContextFinish, con(%p)", con);
-    rsContextFinish(con);
+    dispatchTab.ContextFinish(con);
 }
 
 static void
 nObjDestroy(JNIEnv *_env, jobject _this, RsContext con, jint obj)
 {
     LOG_API("nObjDestroy, con(%p) obj(%p)", con, (void *)obj);
-    rsObjDestroy(con, (void *)obj);
+    dispatchTab.ObjDestroy(con, (void *)obj);
 }
 
 // ---------------------------------------------------------------------------
@@ -109,28 +474,28 @@
 nDeviceCreate(JNIEnv *_env, jobject _this)
 {
     LOG_API("nDeviceCreate");
-    return (jint)rsDeviceCreate();
+    return (jint)dispatchTab.DeviceCreate();
 }
 
 static void
 nDeviceDestroy(JNIEnv *_env, jobject _this, jint dev)
 {
     LOG_API("nDeviceDestroy");
-    return rsDeviceDestroy((RsDevice)dev);
+    return dispatchTab.DeviceDestroy((RsDevice)dev);
 }
 
 static void
 nDeviceSetConfig(JNIEnv *_env, jobject _this, jint dev, jint p, jint value)
 {
     LOG_API("nDeviceSetConfig  dev(%p), param(%i), value(%i)", (void *)dev, p, value);
-    return rsDeviceSetConfig((RsDevice)dev, (RsDeviceParam)p, value);
+    return dispatchTab.DeviceSetConfig((RsDevice)dev, (RsDeviceParam)p, value);
 }
 
 static jint
 nContextCreate(JNIEnv *_env, jobject _this, jint dev, jint ver, jint sdkVer, jint ct)
 {
     LOG_API("nContextCreate");
-    return (jint)rsContextCreate((RsDevice)dev, ver, sdkVer, (RsContextType)ct, 0);
+    return (jint)dispatchTab.ContextCreate((RsDevice)dev, ver, sdkVer, (RsContextType)ct, 0);
 }
 
 
@@ -138,7 +503,7 @@
 nContextSetPriority(JNIEnv *_env, jobject _this, RsContext con, jint p)
 {
     LOG_API("ContextSetPriority, con(%p), priority(%i)", con, p);
-    rsContextSetPriority(con, p);
+    dispatchTab.ContextSetPriority(con, p);
 }
 
 
@@ -147,14 +512,14 @@
 nContextDestroy(JNIEnv *_env, jobject _this, RsContext con)
 {
     LOG_API("nContextDestroy, con(%p)", con);
-    rsContextDestroy(con);
+    dispatchTab.ContextDestroy(con);
 }
 
 static void
 nContextDump(JNIEnv *_env, jobject _this, RsContext con, jint bits)
 {
     LOG_API("nContextDump, con(%p)  bits(%i)", (RsContext)con, bits);
-    rsContextDump((RsContext)con, bits);
+    dispatchTab.ContextDump((RsContext)con, bits);
 }
 
 
@@ -166,7 +531,7 @@
 
     size_t receiveLen;
     uint32_t subID;
-    int id = rsContextGetMessage(con,
+    int id = dispatchTab.ContextGetMessage(con,
                                  buf, sizeof(buf),
                                  &receiveLen, sizeof(receiveLen),
                                  &subID, sizeof(subID));
@@ -185,7 +550,7 @@
     jint *ptr = _env->GetIntArrayElements(data, NULL);
     size_t receiveLen;
     uint32_t subID;
-    int id = rsContextGetMessage(con,
+    int id = dispatchTab.ContextGetMessage(con,
                                  ptr, len * 4,
                                  &receiveLen, sizeof(receiveLen),
                                  &subID, sizeof(subID));
@@ -204,7 +569,7 @@
     jint *auxDataPtr = _env->GetIntArrayElements(auxData, NULL);
     size_t receiveLen;
     uint32_t subID;
-    int id = rsContextPeekMessage(con, &receiveLen, sizeof(receiveLen),
+    int id = dispatchTab.ContextPeekMessage(con, &receiveLen, sizeof(receiveLen),
                                   &subID, sizeof(subID));
     auxDataPtr[0] = (jint)subID;
     auxDataPtr[1] = (jint)receiveLen;
@@ -215,13 +580,13 @@
 static void nContextInitToClient(JNIEnv *_env, jobject _this, RsContext con)
 {
     LOG_API("nContextInitToClient, con(%p)", con);
-    rsContextInitToClient(con);
+    dispatchTab.ContextInitToClient(con);
 }
 
 static void nContextDeinitToClient(JNIEnv *_env, jobject _this, RsContext con)
 {
     LOG_API("nContextDeinitToClient, con(%p)", con);
-    rsContextDeinitToClient(con);
+    dispatchTab.ContextDeinitToClient(con);
 }
 
 static void
@@ -234,7 +599,7 @@
         jint *ptr = _env->GetIntArrayElements(data, NULL);
     }
     LOG_API("nContextSendMessage, con(%p), id(%i), len(%i)", con, id, len);
-    rsContextSendMessage(con, id, (const uint8_t *)ptr, len * sizeof(int));
+    dispatchTab.ContextSendMessage(con, id, (const uint8_t *)ptr, len * sizeof(int));
     if (data) {
         _env->ReleaseIntArrayElements(data, ptr, JNI_ABORT);
     }
@@ -246,7 +611,7 @@
 nElementCreate(JNIEnv *_env, jobject _this, RsContext con, jint type, jint kind, jboolean norm, jint size)
 {
     LOG_API("nElementCreate, con(%p), type(%i), kind(%i), norm(%i), size(%i)", con, type, kind, norm, size);
-    return (jint)rsElementCreate(con, (RsDataType)type, (RsDataKind)kind, norm, size);
+    return (jint)dispatchTab.ElementCreate(con, (RsDataType)type, (RsDataKind)kind, norm, size);
 }
 
 static jint
@@ -264,7 +629,7 @@
     const char **nameArray = names.c_str();
     size_t *sizeArray = names.c_str_len();
 
-    jint id = (jint)rsElementCreate2(con,
+    jint id = (jint)dispatchTab.ElementCreate2(con,
                                      (RsElement *)ids, fieldCount,
                                      nameArray, fieldCount * sizeof(size_t),  sizeArray,
                                      (const uint32_t *)arraySizes, fieldCount);
@@ -289,7 +654,7 @@
     const char **names = (const char **)malloc((uint32_t)dataSize * sizeof(const char *));
     uint32_t *arraySizes = (uint32_t *)malloc((uint32_t)dataSize * sizeof(uint32_t));
 
-    rsaElementGetSubElements(con, (RsElement)id, ids, names, arraySizes, (uint32_t)dataSize);
+    dispatchTab.ElementGetSubElements(con, (RsElement)id, ids, names, arraySizes, (uint32_t)dataSize);
 
     for(jint i = 0; i < dataSize; i++) {
         _env->SetObjectArrayElement(_names, i, _env->NewStringUTF(names[i]));
@@ -311,7 +676,7 @@
     LOG_API("nTypeCreate, con(%p) eid(%p), x(%i), y(%i), z(%i), mips(%i), faces(%i), yuv(%i)",
             con, eid, dimx, dimy, dimz, mips, faces, yuv);
 
-    jint id = (jint)rsTypeCreate(con, (RsElement)eid, dimx, dimy, dimz, mips, faces, yuv);
+    jint id = (jint)dispatchTab.TypeCreate(con, (RsElement)eid, dimx, dimy, dimz, mips, faces, yuv);
     return (jint)id;
 }
 
@@ -321,21 +686,21 @@
 nAllocationCreateTyped(JNIEnv *_env, jobject _this, RsContext con, jint type, jint mips, jint usage, jint pointer)
 {
     LOG_API("nAllocationCreateTyped, con(%p), type(%p), mip(%i), usage(%i), ptr(%p)", con, (RsElement)type, mips, usage, (void *)pointer);
-    return (jint) rsAllocationCreateTyped(con, (RsType)type, (RsAllocationMipmapControl)mips, (uint32_t)usage, (uint32_t)pointer);
+    return (jint) dispatchTab.AllocationCreateTyped(con, (RsType)type, (RsAllocationMipmapControl)mips, (uint32_t)usage, (uint32_t)pointer);
 }
 
 static void
 nAllocationSyncAll(JNIEnv *_env, jobject _this, RsContext con, jint a, jint bits)
 {
     LOG_API("nAllocationSyncAll, con(%p), a(%p), bits(0x%08x)", con, (RsAllocation)a, bits);
-    rsAllocationSyncAll(con, (RsAllocation)a, (RsAllocationUsageType)bits);
+    dispatchTab.AllocationSyncAll(con, (RsAllocation)a, (RsAllocationUsageType)bits);
 }
 
 static void
 nAllocationGenerateMipmaps(JNIEnv *_env, jobject _this, RsContext con, jint alloc)
 {
     LOG_API("nAllocationGenerateMipmaps, con(%p), a(%p)", con, (RsAllocation)alloc);
-    rsAllocationGenerateMipmaps(con, (RsAllocation)alloc);
+    dispatchTab.AllocationGenerateMipmaps(con, (RsAllocation)alloc);
 }
 
 static size_t GetBitmapSize(JNIEnv *env, jobject jbitmap) {
@@ -359,7 +724,7 @@
     AndroidBitmap_lockPixels(_env, jbitmap, &pixels);
 
     if (pixels != NULL) {
-        id = (jint)rsAllocationCreateFromBitmap(con,
+        id = (jint)dispatchTab.AllocationCreateFromBitmap(con,
                                                 (RsType)type, (RsAllocationMipmapControl)mip,
                                                 pixels, GetBitmapSize(_env, jbitmap), usage);
         AndroidBitmap_unlockPixels(_env, jbitmap);
@@ -375,7 +740,7 @@
     AndroidBitmap_lockPixels(_env, jbitmap, &pixels);
 
     if (pixels != NULL) {
-        id = (jint)rsAllocationCreateTyped(con,
+        id = (jint)dispatchTab.AllocationCreateTyped(con,
                                           (RsType)type, (RsAllocationMipmapControl)mip,
                                           (uint32_t)usage, (uintptr_t)pixels);
         AndroidBitmap_unlockPixels(_env, jbitmap);
@@ -391,7 +756,7 @@
 
     jint id = 0;
     if (pixels != NULL) {
-        id = (jint)rsAllocationCubeCreateFromBitmap(con,
+        id = (jint)dispatchTab.AllocationCubeCreateFromBitmap(con,
                                                     (RsType)type, (RsAllocationMipmapControl)mip,
                                                     pixels, GetBitmapSize(_env, jbitmap), usage);
         AndroidBitmap_unlockPixels(_env, jbitmap);
@@ -410,7 +775,7 @@
     AndroidBitmap_lockPixels(_env, jbitmap, &pixels);
 
     if (pixels != NULL) {
-        rsAllocation2DData(con, (RsAllocation)alloc, 0, 0,
+        dispatchTab.Allocation2DData(con, (RsAllocation)alloc, 0, 0,
                            0, RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X,
                            info.width, info.height, pixels, GetBitmapSize(_env, jbitmap), 0);
         AndroidBitmap_unlockPixels(_env, jbitmap);
@@ -428,7 +793,7 @@
     AndroidBitmap_lockPixels(_env, jbitmap, &pixels);
 
     if (pixels != NULL) {
-        rsAllocationCopyToBitmap(con, (RsAllocation)alloc, pixels, GetBitmapSize(_env, jbitmap));
+        dispatchTab.AllocationCopyToBitmap(con, (RsAllocation)alloc, pixels, GetBitmapSize(_env, jbitmap));
         AndroidBitmap_unlockPixels(_env, jbitmap);
     }
     //bitmap.notifyPixelsChanged();
@@ -441,7 +806,7 @@
     jint len = _env->GetArrayLength(data);
     LOG_API("nAllocation1DData_i, con(%p), adapter(%p), offset(%i), count(%i), len(%i), sizeBytes(%i)", con, (RsAllocation)alloc, offset, count, len, sizeBytes);
     jint *ptr = _env->GetIntArrayElements(data, NULL);
-    rsAllocation1DData(con, (RsAllocation)alloc, offset, lod, count, ptr, sizeBytes);
+    dispatchTab.Allocation1DData(con, (RsAllocation)alloc, offset, lod, count, ptr, sizeBytes);
     _env->ReleaseIntArrayElements(data, ptr, JNI_ABORT);
 }
 
@@ -451,7 +816,7 @@
     jint len = _env->GetArrayLength(data);
     LOG_API("nAllocation1DData_s, con(%p), adapter(%p), offset(%i), count(%i), len(%i), sizeBytes(%i)", con, (RsAllocation)alloc, offset, count, len, sizeBytes);
     jshort *ptr = _env->GetShortArrayElements(data, NULL);
-    rsAllocation1DData(con, (RsAllocation)alloc, offset, lod, count, ptr, sizeBytes);
+    dispatchTab.Allocation1DData(con, (RsAllocation)alloc, offset, lod, count, ptr, sizeBytes);
     _env->ReleaseShortArrayElements(data, ptr, JNI_ABORT);
 }
 
@@ -461,7 +826,7 @@
     jint len = _env->GetArrayLength(data);
     LOG_API("nAllocation1DData_b, con(%p), adapter(%p), offset(%i), count(%i), len(%i), sizeBytes(%i)", con, (RsAllocation)alloc, offset, count, len, sizeBytes);
     jbyte *ptr = _env->GetByteArrayElements(data, NULL);
-    rsAllocation1DData(con, (RsAllocation)alloc, offset, lod, count, ptr, sizeBytes);
+    dispatchTab.Allocation1DData(con, (RsAllocation)alloc, offset, lod, count, ptr, sizeBytes);
     _env->ReleaseByteArrayElements(data, ptr, JNI_ABORT);
 }
 
@@ -471,7 +836,7 @@
     jint len = _env->GetArrayLength(data);
     LOG_API("nAllocation1DData_f, con(%p), adapter(%p), offset(%i), count(%i), len(%i), sizeBytes(%i)", con, (RsAllocation)alloc, offset, count, len, sizeBytes);
     jfloat *ptr = _env->GetFloatArrayElements(data, NULL);
-    rsAllocation1DData(con, (RsAllocation)alloc, offset, lod, count, ptr, sizeBytes);
+    dispatchTab.Allocation1DData(con, (RsAllocation)alloc, offset, lod, count, ptr, sizeBytes);
     _env->ReleaseFloatArrayElements(data, ptr, JNI_ABORT);
 }
 
@@ -482,7 +847,7 @@
     jint len = _env->GetArrayLength(data);
     LOG_API("nAllocationElementData1D, con(%p), alloc(%p), offset(%i), comp(%i), len(%i), sizeBytes(%i)", con, (RsAllocation)alloc, offset, compIdx, len, sizeBytes);
     jbyte *ptr = _env->GetByteArrayElements(data, NULL);
-    rsAllocation1DElementData(con, (RsAllocation)alloc, offset, lod, ptr, sizeBytes, compIdx);
+    dispatchTab.Allocation1DElementData(con, (RsAllocation)alloc, offset, lod, ptr, sizeBytes, compIdx);
     _env->ReleaseByteArrayElements(data, ptr, JNI_ABORT);
 }
 
@@ -493,7 +858,7 @@
     jint len = _env->GetArrayLength(data);
     LOG_API("nAllocation2DData_s, con(%p), adapter(%p), xoff(%i), yoff(%i), w(%i), h(%i), len(%i)", con, (RsAllocation)alloc, xoff, yoff, w, h, len);
     jshort *ptr = _env->GetShortArrayElements(data, NULL);
-    rsAllocation2DData(con, (RsAllocation)alloc, xoff, yoff, lod, (RsAllocationCubemapFace)face, w, h, ptr, sizeBytes, 0);
+    dispatchTab.Allocation2DData(con, (RsAllocation)alloc, xoff, yoff, lod, (RsAllocationCubemapFace)face, w, h, ptr, sizeBytes, 0);
     _env->ReleaseShortArrayElements(data, ptr, JNI_ABORT);
 }
 
@@ -504,7 +869,7 @@
     jint len = _env->GetArrayLength(data);
     LOG_API("nAllocation2DData_b, con(%p), adapter(%p), xoff(%i), yoff(%i), w(%i), h(%i), len(%i)", con, (RsAllocation)alloc, xoff, yoff, w, h, len);
     jbyte *ptr = _env->GetByteArrayElements(data, NULL);
-    rsAllocation2DData(con, (RsAllocation)alloc, xoff, yoff, lod, (RsAllocationCubemapFace)face, w, h, ptr, sizeBytes, 0);
+    dispatchTab.Allocation2DData(con, (RsAllocation)alloc, xoff, yoff, lod, (RsAllocationCubemapFace)face, w, h, ptr, sizeBytes, 0);
     _env->ReleaseByteArrayElements(data, ptr, JNI_ABORT);
 }
 
@@ -515,7 +880,7 @@
     jint len = _env->GetArrayLength(data);
     LOG_API("nAllocation2DData_i, con(%p), adapter(%p), xoff(%i), yoff(%i), w(%i), h(%i), len(%i)", con, (RsAllocation)alloc, xoff, yoff, w, h, len);
     jint *ptr = _env->GetIntArrayElements(data, NULL);
-    rsAllocation2DData(con, (RsAllocation)alloc, xoff, yoff, lod, (RsAllocationCubemapFace)face, w, h, ptr, sizeBytes, 0);
+    dispatchTab.Allocation2DData(con, (RsAllocation)alloc, xoff, yoff, lod, (RsAllocationCubemapFace)face, w, h, ptr, sizeBytes, 0);
     _env->ReleaseIntArrayElements(data, ptr, JNI_ABORT);
 }
 
@@ -526,7 +891,7 @@
     jint len = _env->GetArrayLength(data);
     LOG_API("nAllocation2DData_i, con(%p), adapter(%p), xoff(%i), yoff(%i), w(%i), h(%i), len(%i)", con, (RsAllocation)alloc, xoff, yoff, w, h, len);
     jfloat *ptr = _env->GetFloatArrayElements(data, NULL);
-    rsAllocation2DData(con, (RsAllocation)alloc, xoff, yoff, lod, (RsAllocationCubemapFace)face, w, h, ptr, sizeBytes, 0);
+    dispatchTab.Allocation2DData(con, (RsAllocation)alloc, xoff, yoff, lod, (RsAllocationCubemapFace)face, w, h, ptr, sizeBytes, 0);
     _env->ReleaseFloatArrayElements(data, ptr, JNI_ABORT);
 }
 
@@ -544,7 +909,7 @@
             con, (RsAllocation)dstAlloc, dstXoff, dstYoff, dstMip, dstFace,
             width, height, (RsAllocation)srcAlloc, srcXoff, srcYoff, srcMip, srcFace);
 
-    rsAllocationCopy2DRange(con,
+    dispatchTab.AllocationCopy2DRange(con,
                             (RsAllocation)dstAlloc,
                             dstXoff, dstYoff,
                             dstMip, dstFace,
@@ -561,7 +926,7 @@
     jint len = _env->GetArrayLength(data);
     LOG_API("nAllocation3DData_s, con(%p), adapter(%p), xoff(%i), yoff(%i), w(%i), h(%i), len(%i)", con, (RsAllocation)alloc, xoff, yoff, zoff, w, h, d, len);
     jshort *ptr = _env->GetShortArrayElements(data, NULL);
-    rsAllocation3DData(con, (RsAllocation)alloc, xoff, yoff, zoff, lod, w, h, d, ptr, sizeBytes, 0);
+    dispatchTab.Allocation3DData(con, (RsAllocation)alloc, xoff, yoff, zoff, lod, w, h, d, ptr, sizeBytes, 0);
     _env->ReleaseShortArrayElements(data, ptr, JNI_ABORT);
 }
 
@@ -572,7 +937,7 @@
     jint len = _env->GetArrayLength(data);
     LOG_API("nAllocation3DData_b, con(%p), adapter(%p), xoff(%i), yoff(%i), w(%i), h(%i), len(%i)", con, (RsAllocation)alloc, xoff, yoff, zoff, w, h, d, len);
     jbyte *ptr = _env->GetByteArrayElements(data, NULL);
-    rsAllocation3DData(con, (RsAllocation)alloc, xoff, yoff, zoff, lod, w, h, d, ptr, sizeBytes, 0);
+    dispatchTab.Allocation3DData(con, (RsAllocation)alloc, xoff, yoff, zoff, lod, w, h, d, ptr, sizeBytes, 0);
     _env->ReleaseByteArrayElements(data, ptr, JNI_ABORT);
 }
 
@@ -583,7 +948,7 @@
     jint len = _env->GetArrayLength(data);
     LOG_API("nAllocation3DData_i, con(%p), adapter(%p), xoff(%i), yoff(%i), w(%i), h(%i), len(%i)", con, (RsAllocation)alloc, xoff, yoff, zoff, w, h, d, len);
     jint *ptr = _env->GetIntArrayElements(data, NULL);
-    rsAllocation3DData(con, (RsAllocation)alloc, xoff, yoff, zoff, lod, w, h, d, ptr, sizeBytes, 0);
+    dispatchTab.Allocation3DData(con, (RsAllocation)alloc, xoff, yoff, zoff, lod, w, h, d, ptr, sizeBytes, 0);
     _env->ReleaseIntArrayElements(data, ptr, JNI_ABORT);
 }
 
@@ -594,7 +959,7 @@
     jint len = _env->GetArrayLength(data);
     LOG_API("nAllocation3DData_f, con(%p), adapter(%p), xoff(%i), yoff(%i), w(%i), h(%i), len(%i)", con, (RsAllocation)alloc, xoff, yoff, zoff, w, h, d, len);
     jfloat *ptr = _env->GetFloatArrayElements(data, NULL);
-    rsAllocation3DData(con, (RsAllocation)alloc, xoff, yoff, zoff, lod, w, h, d, ptr, sizeBytes, 0);
+    dispatchTab.Allocation3DData(con, (RsAllocation)alloc, xoff, yoff, zoff, lod, w, h, d, ptr, sizeBytes, 0);
     _env->ReleaseFloatArrayElements(data, ptr, JNI_ABORT);
 }
 
@@ -612,7 +977,7 @@
             con, (RsAllocation)dstAlloc, dstXoff, dstYoff, dstMip, dstFace,
             width, height, (RsAllocation)srcAlloc, srcXoff, srcYoff, srcMip, srcFace);
 
-    rsAllocationCopy3DRange(con,
+    dispatchTab.AllocationCopy3DRange(con,
                             (RsAllocation)dstAlloc,
                             dstXoff, dstYoff, dstZoff, dstMip,
                             width, height, depth,
@@ -627,7 +992,7 @@
     LOG_API("nAllocationRead_i, con(%p), alloc(%p), len(%i)", con, (RsAllocation)alloc, len);
     jint *ptr = _env->GetIntArrayElements(data, NULL);
     jsize length = _env->GetArrayLength(data);
-    rsAllocationRead(con, (RsAllocation)alloc, ptr, length * sizeof(int));
+    dispatchTab.AllocationRead(con, (RsAllocation)alloc, ptr, length * sizeof(int));
     _env->ReleaseIntArrayElements(data, ptr, 0);
 }
 
@@ -638,7 +1003,7 @@
     LOG_API("nAllocationRead_i, con(%p), alloc(%p), len(%i)", con, (RsAllocation)alloc, len);
     jshort *ptr = _env->GetShortArrayElements(data, NULL);
     jsize length = _env->GetArrayLength(data);
-    rsAllocationRead(con, (RsAllocation)alloc, ptr, length * sizeof(short));
+    dispatchTab.AllocationRead(con, (RsAllocation)alloc, ptr, length * sizeof(short));
     _env->ReleaseShortArrayElements(data, ptr, 0);
 }
 
@@ -649,7 +1014,7 @@
     LOG_API("nAllocationRead_i, con(%p), alloc(%p), len(%i)", con, (RsAllocation)alloc, len);
     jbyte *ptr = _env->GetByteArrayElements(data, NULL);
     jsize length = _env->GetArrayLength(data);
-    rsAllocationRead(con, (RsAllocation)alloc, ptr, length * sizeof(char));
+    dispatchTab.AllocationRead(con, (RsAllocation)alloc, ptr, length * sizeof(char));
     _env->ReleaseByteArrayElements(data, ptr, 0);
 }
 
@@ -660,7 +1025,7 @@
     LOG_API("nAllocationRead_f, con(%p), alloc(%p), len(%i)", con, (RsAllocation)alloc, len);
     jfloat *ptr = _env->GetFloatArrayElements(data, NULL);
     jsize length = _env->GetArrayLength(data);
-    rsAllocationRead(con, (RsAllocation)alloc, ptr, length * sizeof(float));
+    dispatchTab.AllocationRead(con, (RsAllocation)alloc, ptr, length * sizeof(float));
     _env->ReleaseFloatArrayElements(data, ptr, 0);
 }
 
@@ -668,14 +1033,14 @@
 nAllocationGetType(JNIEnv *_env, jobject _this, RsContext con, jint a)
 {
     LOG_API("nAllocationGetType, con(%p), a(%p)", con, (RsAllocation)a);
-    return (jint) rsaAllocationGetType(con, (RsAllocation)a);
+    return (jint) dispatchTab.AllocationGetType(con, (RsAllocation)a);
 }
 
 static void
 nAllocationResize1D(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jint dimX)
 {
     LOG_API("nAllocationResize1D, con(%p), alloc(%p), sizeX(%i)", con, (RsAllocation)alloc, dimX);
-    rsAllocationResize1D(con, (RsAllocation)alloc, dimX);
+    dispatchTab.AllocationResize1D(con, (RsAllocation)alloc, dimX);
 }
 
 // -----------------------------------
@@ -684,42 +1049,42 @@
 nScriptBindAllocation(JNIEnv *_env, jobject _this, RsContext con, jint script, jint alloc, jint slot)
 {
     LOG_API("nScriptBindAllocation, con(%p), script(%p), alloc(%p), slot(%i)", con, (RsScript)script, (RsAllocation)alloc, slot);
-    rsScriptBindAllocation(con, (RsScript)script, (RsAllocation)alloc, slot);
+    dispatchTab.ScriptBindAllocation(con, (RsScript)script, (RsAllocation)alloc, slot);
 }
 
 static void
 nScriptSetVarI(JNIEnv *_env, jobject _this, RsContext con, jint script, jint slot, jint val)
 {
     LOG_API("nScriptSetVarI, con(%p), s(%p), slot(%i), val(%i)", con, (void *)script, slot, val);
-    rsScriptSetVarI(con, (RsScript)script, slot, val);
+    dispatchTab.ScriptSetVarI(con, (RsScript)script, slot, val);
 }
 
 static void
 nScriptSetVarObj(JNIEnv *_env, jobject _this, RsContext con, jint script, jint slot, jint val)
 {
     LOG_API("nScriptSetVarObj, con(%p), s(%p), slot(%i), val(%i)", con, (void *)script, slot, val);
-    rsScriptSetVarObj(con, (RsScript)script, slot, (RsObjectBase)val);
+    dispatchTab.ScriptSetVarObj(con, (RsScript)script, slot, (RsObjectBase)val);
 }
 
 static void
 nScriptSetVarJ(JNIEnv *_env, jobject _this, RsContext con, jint script, jint slot, jlong val)
 {
     LOG_API("nScriptSetVarJ, con(%p), s(%p), slot(%i), val(%lli)", con, (void *)script, slot, val);
-    rsScriptSetVarJ(con, (RsScript)script, slot, val);
+    dispatchTab.ScriptSetVarJ(con, (RsScript)script, slot, val);
 }
 
 static void
 nScriptSetVarF(JNIEnv *_env, jobject _this, RsContext con, jint script, jint slot, float val)
 {
     LOG_API("nScriptSetVarF, con(%p), s(%p), slot(%i), val(%f)", con, (void *)script, slot, val);
-    rsScriptSetVarF(con, (RsScript)script, slot, val);
+    dispatchTab.ScriptSetVarF(con, (RsScript)script, slot, val);
 }
 
 static void
 nScriptSetVarD(JNIEnv *_env, jobject _this, RsContext con, jint script, jint slot, double val)
 {
     LOG_API("nScriptSetVarD, con(%p), s(%p), slot(%i), val(%lf)", con, (void *)script, slot, val);
-    rsScriptSetVarD(con, (RsScript)script, slot, val);
+    dispatchTab.ScriptSetVarD(con, (RsScript)script, slot, val);
 }
 
 static void
@@ -728,7 +1093,7 @@
     LOG_API("nScriptSetVarV, con(%p), s(%p), slot(%i)", con, (void *)script, slot);
     jint len = _env->GetArrayLength(data);
     jbyte *ptr = _env->GetByteArrayElements(data, NULL);
-    rsScriptSetVarV(con, (RsScript)script, slot, ptr, len);
+    dispatchTab.ScriptSetVarV(con, (RsScript)script, slot, ptr, len);
     _env->ReleaseByteArrayElements(data, ptr, JNI_ABORT);
 }
 
@@ -740,7 +1105,7 @@
     jbyte *ptr = _env->GetByteArrayElements(data, NULL);
     jint dimsLen = _env->GetArrayLength(dims) * sizeof(int);
     jint *dimsPtr = _env->GetIntArrayElements(dims, NULL);
-    rsScriptSetVarVE(con, (RsScript)script, slot, ptr, len, (RsElement)elem,
+    dispatchTab.ScriptSetVarVE(con, (RsScript)script, slot, ptr, len, (RsElement)elem,
                      (const uint32_t *)dimsPtr, dimsLen);
     _env->ReleaseByteArrayElements(data, ptr, JNI_ABORT);
     _env->ReleaseIntArrayElements(dims, dimsPtr, JNI_ABORT);
@@ -756,7 +1121,7 @@
     jbyte* timeZone_ptr;
     timeZone_ptr = (jbyte *) _env->GetPrimitiveArrayCritical(timeZone, (jboolean *)0);
 
-    rsScriptSetTimeZone(con, (RsScript)script, (const char *)timeZone_ptr, length);
+    dispatchTab.ScriptSetTimeZone(con, (RsScript)script, (const char *)timeZone_ptr, length);
 
     if (timeZone_ptr) {
         _env->ReleasePrimitiveArrayCritical(timeZone, timeZone_ptr, 0);
@@ -767,7 +1132,7 @@
 nScriptInvoke(JNIEnv *_env, jobject _this, RsContext con, jint obj, jint slot)
 {
     LOG_API("nScriptInvoke, con(%p), script(%p)", con, (void *)obj);
-    rsScriptInvoke(con, (RsScript)obj, slot);
+    dispatchTab.ScriptInvoke(con, (RsScript)obj, slot);
 }
 
 static void
@@ -776,7 +1141,7 @@
     LOG_API("nScriptInvokeV, con(%p), s(%p), slot(%i)", con, (void *)script, slot);
     jint len = _env->GetArrayLength(data);
     jbyte *ptr = _env->GetByteArrayElements(data, NULL);
-    rsScriptInvokeV(con, (RsScript)script, slot, ptr, len);
+    dispatchTab.ScriptInvokeV(con, (RsScript)script, slot, ptr, len);
     _env->ReleaseByteArrayElements(data, ptr, JNI_ABORT);
 }
 
@@ -785,7 +1150,7 @@
                jint script, jint slot, jint ain, jint aout)
 {
     LOG_API("nScriptForEach, con(%p), s(%p), slot(%i)", con, (void *)script, slot);
-    rsScriptForEach(con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, NULL, 0, NULL, 0);
+    dispatchTab.ScriptForEach(con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, NULL, 0, NULL, 0);
 }
 static void
 nScriptForEachV(JNIEnv *_env, jobject _this, RsContext con,
@@ -794,7 +1159,7 @@
     LOG_API("nScriptForEach, con(%p), s(%p), slot(%i)", con, (void *)script, slot);
     jint len = _env->GetArrayLength(params);
     jbyte *ptr = _env->GetByteArrayElements(params, NULL);
-    rsScriptForEach(con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, ptr, len, NULL, 0);
+    dispatchTab.ScriptForEach(con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, ptr, len, NULL, 0);
     _env->ReleaseByteArrayElements(params, ptr, JNI_ABORT);
 }
 
@@ -815,7 +1180,7 @@
     sc.strategy = RS_FOR_EACH_STRATEGY_DONT_CARE;
     sc.arrayStart = 0;
     sc.arrayEnd = 0;
-    rsScriptForEach(con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, NULL, 0, &sc, sizeof(sc));
+    dispatchTab.ScriptForEach(con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, NULL, 0, &sc, sizeof(sc));
 }
 
 static void
@@ -837,7 +1202,7 @@
     sc.strategy = RS_FOR_EACH_STRATEGY_DONT_CARE;
     sc.arrayStart = 0;
     sc.arrayEnd = 0;
-    rsScriptForEach(con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, ptr, len, &sc, sizeof(sc));
+    dispatchTab.ScriptForEach(con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, ptr, len, &sc, sizeof(sc));
     _env->ReleaseByteArrayElements(params, ptr, JNI_ABORT);
 }
 
@@ -878,7 +1243,7 @@
 
     //rsScriptCSetText(con, (const char *)script_ptr, length);
 
-    ret = (jint)rsScriptCCreate(con,
+    ret = (jint)dispatchTab.ScriptCCreate(con,
                                 resNameUTF.c_str(), resNameUTF.length(),
                                 cacheDirUTF.c_str(), cacheDirUTF.length(),
                                 (const char *)script_ptr, length);
@@ -896,21 +1261,21 @@
 nScriptIntrinsicCreate(JNIEnv *_env, jobject _this, RsContext con, jint id, jint eid)
 {
     LOG_API("nScriptIntrinsicCreate, con(%p) id(%i) element(%p)", con, id, (void *)eid);
-    return (jint)rsScriptIntrinsicCreate(con, id, (RsElement)eid);
+    return (jint)dispatchTab.ScriptIntrinsicCreate(con, id, (RsElement)eid);
 }
 
 static jint
 nScriptKernelIDCreate(JNIEnv *_env, jobject _this, RsContext con, jint sid, jint slot, jint sig)
 {
     LOG_API("nScriptKernelIDCreate, con(%p) script(%p), slot(%i), sig(%i)", con, (void *)sid, slot, sig);
-    return (jint)rsScriptKernelIDCreate(con, (RsScript)sid, slot, sig);
+    return (jint)dispatchTab.ScriptKernelIDCreate(con, (RsScript)sid, slot, sig);
 }
 
 static jint
 nScriptFieldIDCreate(JNIEnv *_env, jobject _this, RsContext con, jint sid, jint slot)
 {
     LOG_API("nScriptFieldIDCreate, con(%p) script(%p), slot(%i)", con, (void *)sid, slot);
-    return (jint)rsScriptFieldIDCreate(con, (RsScript)sid, slot);
+    return (jint)dispatchTab.ScriptFieldIDCreate(con, (RsScript)sid, slot);
 }
 
 static jint
@@ -930,7 +1295,7 @@
     jint typesLen = _env->GetArrayLength(_types) * sizeof(int);
     jint *typesPtr = _env->GetIntArrayElements(_types, NULL);
 
-    int id = (int)rsScriptGroupCreate(con,
+    int id = (int)dispatchTab.ScriptGroupCreate(con,
                                (RsScriptKernelID *)kernelsPtr, kernelsLen,
                                (RsScriptKernelID *)srcPtr, srcLen,
                                (RsScriptKernelID *)dstkPtr, dstkLen,
@@ -950,7 +1315,7 @@
 {
     LOG_API("nScriptGroupSetInput, con(%p) group(%p), kernelId(%p), alloc(%p)", con,
         (void *)gid, (void *)kid, (void *)alloc);
-    rsScriptGroupSetInput(con, (RsScriptGroup)gid, (RsScriptKernelID)kid, (RsAllocation)alloc);
+    dispatchTab.ScriptGroupSetInput(con, (RsScriptGroup)gid, (RsScriptKernelID)kid, (RsAllocation)alloc);
 }
 
 static void
@@ -958,14 +1323,14 @@
 {
     LOG_API("nScriptGroupSetOutput, con(%p) group(%p), kernelId(%p), alloc(%p)", con,
         (void *)gid, (void *)kid, (void *)alloc);
-    rsScriptGroupSetOutput(con, (RsScriptGroup)gid, (RsScriptKernelID)kid, (RsAllocation)alloc);
+    dispatchTab.ScriptGroupSetOutput(con, (RsScriptGroup)gid, (RsScriptKernelID)kid, (RsAllocation)alloc);
 }
 
 static void
 nScriptGroupExecute(JNIEnv *_env, jobject _this, RsContext con, jint gid)
 {
     LOG_API("nScriptGroupSetOutput, con(%p) group(%p)", con, (void *)gid);
-    rsScriptGroupExecute(con, (RsScriptGroup)gid);
+    dispatchTab.ScriptGroupExecute(con, (RsScriptGroup)gid);
 }
 
 // ---------------------------------------------------------------------------
@@ -975,7 +1340,7 @@
                jint wrapS, jint wrapT, jint wrapR, jfloat aniso)
 {
     LOG_API("nSamplerCreate, con(%p)", con);
-    return (jint)rsSamplerCreate(con,
+    return (jint)dispatchTab.SamplerCreate(con,
                                  (RsSamplerValue)magFilter,
                                  (RsSamplerValue)minFilter,
                                  (RsSamplerValue)wrapS,
@@ -990,6 +1355,7 @@
 static const char *classPathName = "android/support/v8/renderscript/RenderScript";
 
 static JNINativeMethod methods[] = {
+{"nLoadSO",                        "(Z)Z",                                    (bool*)nLoadSO },
 {"nDeviceCreate",                  "()I",                                     (void*)nDeviceCreate },
 {"nDeviceDestroy",                 "(I)V",                                    (void*)nDeviceDestroy },
 {"nDeviceSetConfig",               "(III)V",                                  (void*)nDeviceSetConfig },