diff options
author | Alex Sakhartchouk <alexst@google.com> | 2011-04-01 14:19:01 -0700 |
---|---|---|
committer | Alex Sakhartchouk <alexst@google.com> | 2011-04-01 14:19:01 -0700 |
commit | 8e90f2bc1fa35a2dc7bd2aab8b8241b628800218 (patch) | |
tree | c2b3e36a41b00d7ef8be23d6441ff44893f686ab /tests/RenderScriptTests/PerfTest/src/com/android/perftest/RsBenchRS.java | |
parent | 397de169e5462bf0c62506827819f93336b3f123 (diff) | |
download | frameworks_base-8e90f2bc1fa35a2dc7bd2aab8b8241b628800218.zip frameworks_base-8e90f2bc1fa35a2dc7bd2aab8b8241b628800218.tar.gz frameworks_base-8e90f2bc1fa35a2dc7bd2aab8b8241b628800218.tar.bz2 |
First draft of fbo in renderscript.
Updating samples and benchmark
Change-Id: I469bf8b842fca72b59475c8fa024c12cf0e14954
Diffstat (limited to 'tests/RenderScriptTests/PerfTest/src/com/android/perftest/RsBenchRS.java')
-rw-r--r-- | tests/RenderScriptTests/PerfTest/src/com/android/perftest/RsBenchRS.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/RenderScriptTests/PerfTest/src/com/android/perftest/RsBenchRS.java b/tests/RenderScriptTests/PerfTest/src/com/android/perftest/RsBenchRS.java index 9757ec6..5443ef8 100644 --- a/tests/RenderScriptTests/PerfTest/src/com/android/perftest/RsBenchRS.java +++ b/tests/RenderScriptTests/PerfTest/src/com/android/perftest/RsBenchRS.java @@ -22,6 +22,8 @@ import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.renderscript.*; +import android.renderscript.Element.DataKind; +import android.renderscript.Element.DataType; import android.renderscript.Allocation.MipmapControl; import android.renderscript.Program.TextureType; import android.renderscript.ProgramStore.DepthFunc; @@ -399,6 +401,23 @@ public class RsBenchRS { initProgramRaster(); initCustomShaders(); + Type.Builder b = new Type.Builder(mRS, Element.RGBA_8888(mRS)); + b.setX(1280).setY(720); + Allocation offscreen = Allocation.createTyped(mRS, + b.create(), + Allocation.USAGE_GRAPHICS_TEXTURE | + Allocation.USAGE_GRAPHICS_RENDER_TARGET); + mScript.set_gRenderBufferColor(offscreen); + + b = new Type.Builder(mRS, + Element.createPixel(mRS, DataType.UNSIGNED_16, + DataKind.PIXEL_DEPTH)); + b.setX(1280).setY(720); + offscreen = Allocation.createTyped(mRS, + b.create(), + Allocation.USAGE_GRAPHICS_RENDER_TARGET); + mScript.set_gRenderBufferDepth(offscreen); + mRS.bindRootScript(mScript); } } |