diff options
author | Jason Sams <rjsams@android.com> | 2010-02-23 17:44:28 -0800 |
---|---|---|
committer | Jason Sams <rjsams@android.com> | 2010-02-23 17:44:28 -0800 |
commit | c2908e60c9b021fb4bb69acff8d49981dd4dade8 (patch) | |
tree | 7b719d7ca8dc804e2906df1d38022ea4f9c22c50 /graphics/java | |
parent | 7eecbf2085bcfe475daf68090a1a4f47fbb6ec72 (diff) | |
download | frameworks_base-c2908e60c9b021fb4bb69acff8d49981dd4dade8.zip frameworks_base-c2908e60c9b021fb4bb69acff8d49981dd4dade8.tar.gz frameworks_base-c2908e60c9b021fb4bb69acff8d49981dd4dade8.tar.bz2 |
Support defered generation of mipmaps. With this change we support mipmap generation when the texture is uploaded to GL without requiring RS to retain the full chain.
Diffstat (limited to 'graphics/java')
-rw-r--r-- | graphics/java/android/renderscript/Allocation.java | 7 | ||||
-rw-r--r-- | graphics/java/android/renderscript/RenderScript.java | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java index e5cf38e..8185404 100644 --- a/graphics/java/android/renderscript/Allocation.java +++ b/graphics/java/android/renderscript/Allocation.java @@ -45,7 +45,12 @@ public class Allocation extends BaseObj { public void uploadToTexture(int baseMipLevel) { mRS.validate(); - mRS.nAllocationUploadToTexture(mID, baseMipLevel); + mRS.nAllocationUploadToTexture(mID, false, baseMipLevel); + } + + public void uploadToTexture(boolean genMips, int baseMipLevel) { + mRS.validate(); + mRS.nAllocationUploadToTexture(mID, genMips, baseMipLevel); } public void uploadToBufferObject() { diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java index 84b1a70..70c97ea 100644 --- a/graphics/java/android/renderscript/RenderScript.java +++ b/graphics/java/android/renderscript/RenderScript.java @@ -101,7 +101,7 @@ public class RenderScript { native int nAllocationCreateFromBitmapBoxed(int dstFmt, boolean genMips, Bitmap bmp); native int nAllocationCreateFromAssetStream(int dstFmt, boolean genMips, int assetStream); - native void nAllocationUploadToTexture(int alloc, int baseMioLevel); + native void nAllocationUploadToTexture(int alloc, boolean genMips, int baseMioLevel); native void nAllocationUploadToBufferObject(int alloc); native void nAllocationSubData1D(int id, int off, int count, int[] d, int sizeBytes); |