diff options
author | Alex Sakhartchouk <alexst@google.com> | 2011-04-04 14:33:19 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-04-04 14:33:19 -0700 |
commit | 78a9f6a8227d1e9b465acb84f8476a30c5af9c13 (patch) | |
tree | 4bb01528d4691740ec94528d0816f65706be34ed /tests/RenderScriptTests/PerfTest/src/com/android/perftest/RsBenchRS.java | |
parent | fb2e9d23e03c93fd11d79545a07ae776721117f9 (diff) | |
parent | 8e90f2bc1fa35a2dc7bd2aab8b8241b628800218 (diff) | |
download | frameworks_base-78a9f6a8227d1e9b465acb84f8476a30c5af9c13.zip frameworks_base-78a9f6a8227d1e9b465acb84f8476a30c5af9c13.tar.gz frameworks_base-78a9f6a8227d1e9b465acb84f8476a30c5af9c13.tar.bz2 |
Merge "First draft of fbo in renderscript. Updating samples and benchmark"
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); } } |