diff options
author | Alex Sakhartchouk <alexst@google.com> | 2011-12-13 15:22:34 -0800 |
---|---|---|
committer | Alex Sakhartchouk <alexst@google.com> | 2011-12-13 15:22:34 -0800 |
commit | b6e9dad7823fd5458f381530c09bd71fcfcef98f (patch) | |
tree | 613a70aa2ba13f32ac7f5d021f92cc919727a40f /tests/RenderScriptTests/SceneGraph | |
parent | 34e7ce888d08feaf937920e55fbda08db1353619 (diff) | |
download | frameworks_base-b6e9dad7823fd5458f381530c09bd71fcfcef98f.zip frameworks_base-b6e9dad7823fd5458f381530c09bd71fcfcef98f.tar.gz frameworks_base-b6e9dad7823fd5458f381530c09bd71fcfcef98f.tar.bz2 |
Properly detecting blending case.
Change-Id: I9963e50928f17610c509d00780714aea0cb00613
Diffstat (limited to 'tests/RenderScriptTests/SceneGraph')
3 files changed, 11 insertions, 6 deletions
diff --git a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/FullscreenBlur.java b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/FullscreenBlur.java index 2e365aa..049083b 100644 --- a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/FullscreenBlur.java +++ b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/FullscreenBlur.java @@ -31,7 +31,7 @@ import android.util.Log; import java.util.ArrayList;
-class GaussianBlur {
+class FullscreenBlur {
static Allocation sRenderTargetBlur0Color;
static Allocation sRenderTargetBlur0Depth;
diff --git a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/TestAppRS.java b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/TestAppRS.java index 94347ce..7b710ee 100644 --- a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/TestAppRS.java +++ b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/TestAppRS.java @@ -310,7 +310,7 @@ public class TestAppRS { mPF_Texture.bindConstants(mFsConst.getAllocation(), 0); mPF_Texture.bindSampler(Sampler.WRAP_LINEAR_MIP_LINEAR(mRS), 0); - GaussianBlur.initShaders(mRes, mRS, mVsConst, mFsConst); + FullscreenBlur.initShaders(mRes, mRS, mVsConst, mFsConst); } // This needs to be cleaned up a bit, it's one of the default render state objects @@ -366,7 +366,7 @@ public class TestAppRS { int numDraw = allDraw.size(); if (mUseBlur) { - GaussianBlur.addBlurPasses(mActiveScene, mRS, mSceneManager); + FullscreenBlur.addBlurPasses(mActiveScene, mRS, mSceneManager); } RenderPass mainPass = new RenderPass(); @@ -381,7 +381,7 @@ public class TestAppRS { mActiveScene.appendRenderPass(mainPass); if (mUseBlur) { - GaussianBlur.addCompositePass(mActiveScene, mRS, mSceneManager); + FullscreenBlur.addCompositePass(mActiveScene, mRS, mSceneManager); } } @@ -431,7 +431,7 @@ public class TestAppRS { private void initRS() { - GaussianBlur.createRenderTargets(mRS, mWidth, mHeight); + FullscreenBlur.createRenderTargets(mRS, mWidth, mHeight); initPaintShaders(); new ImageLoaderTask().execute(); diff --git a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/render.rs b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/render.rs index 2891657..d7343dc 100644 --- a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/render.rs +++ b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/render.rs @@ -150,7 +150,12 @@ static void sortToBucket(SgDrawable *obj) { } const SgRenderState *renderState = (const SgRenderState *)rsGetElementAt(obj->render_state, 0); if (rsIsObject(renderState->ps)) { - gBackToFront[gBackToFrontCount++] = (uint32_t)obj; + if ((rsgProgramStoreGetBlendSrcFunc(renderState->ps) == RS_BLEND_SRC_ONE) && + (rsgProgramStoreGetBlendDstFunc(renderState->ps) == RS_BLEND_DST_ZERO)) { + gFrontToBack[gFrontToBackCount++] = (uint32_t)obj; + } else { + gBackToFront[gBackToFrontCount++] = (uint32_t)obj; + } } else { gFrontToBack[gFrontToBackCount++] = (uint32_t)obj; } |