diff options
| author | Jason Sams <rjsams@android.com> | 2010-02-12 11:27:01 -0800 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2010-02-12 11:27:01 -0800 |
| commit | 79b646ffe51c532f00b69dc4967ee51ca28986cf (patch) | |
| tree | 64dc779a8ee4d21f322499bbefa11e5972741be3 /libs/rs/rsProgramFragmentStore.cpp | |
| parent | 1e90ab542d675616e9370ab7e5add99d7af12587 (diff) | |
| parent | 0b9bbb6dc5d7dabecf23e8c6bb4a267ba8c34fe8 (diff) | |
| download | frameworks_base-79b646ffe51c532f00b69dc4967ee51ca28986cf.zip frameworks_base-79b646ffe51c532f00b69dc4967ee51ca28986cf.tar.gz frameworks_base-79b646ffe51c532f00b69dc4967ee51ca28986cf.tar.bz2 | |
am 0b9bbb6d: DO NOT MERGE. Merge Froyo renderscript to Eclair to support live wallpapers on droid. This gives the necessary CPU reduction to allow the wallpapers to work on the slower CPU.
Merge commit '0b9bbb6dc5d7dabecf23e8c6bb4a267ba8c34fe8' into eclair-plus-aosp
* commit '0b9bbb6dc5d7dabecf23e8c6bb4a267ba8c34fe8':
DO NOT MERGE. Merge Froyo renderscript to Eclair to support live wallpapers on droid. This gives the necessary CPU reduction to allow the wallpapers to work on the slower CPU.
Diffstat (limited to 'libs/rs/rsProgramFragmentStore.cpp')
| -rw-r--r-- | libs/rs/rsProgramFragmentStore.cpp | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/libs/rs/rsProgramFragmentStore.cpp b/libs/rs/rsProgramFragmentStore.cpp index de33d9c..8a2157f 100644 --- a/libs/rs/rsProgramFragmentStore.cpp +++ b/libs/rs/rsProgramFragmentStore.cpp @@ -24,8 +24,8 @@ using namespace android; using namespace android::renderscript; -ProgramFragmentStore::ProgramFragmentStore(Context *rsc, Element *in, Element *out) : - Program(rsc, in, out) +ProgramFragmentStore::ProgramFragmentStore(Context *rsc) : + Program(rsc) { mAllocFile = __FILE__; mAllocLine = __LINE__; @@ -83,10 +83,44 @@ void ProgramFragmentStore::setupGL(const Context *rsc, ProgramFragmentStoreState } else { glDisable(GL_DITHER); } +} +void ProgramFragmentStore::setupGL2(const Context *rsc, ProgramFragmentStoreState *state) +{ + if (state->mLast.get() == this) { + return; + } + state->mLast.set(this); + + glColorMask(mColorRWriteEnable, + mColorGWriteEnable, + mColorBWriteEnable, + mColorAWriteEnable); + if (mBlendEnable) { + glEnable(GL_BLEND); + glBlendFunc(mBlendSrc, mBlendDst); + } else { + glDisable(GL_BLEND); + } + //LOGE("pfs %i, %i, %x", mDepthWriteEnable, mDepthTestEnable, mDepthFunc); + + glDepthMask(mDepthWriteEnable); + if(mDepthTestEnable || mDepthWriteEnable) { + glEnable(GL_DEPTH_TEST); + glDepthFunc(mDepthFunc); + } else { + glDisable(GL_DEPTH_TEST); + } + + if (mDitherEnable) { + glEnable(GL_DITHER); + } else { + glDisable(GL_DITHER); + } } + void ProgramFragmentStore::setDitherEnable(bool enable) { mDitherEnable = enable; @@ -215,7 +249,7 @@ ProgramFragmentStoreState::~ProgramFragmentStoreState() void ProgramFragmentStoreState::init(Context *rsc, int32_t w, int32_t h) { - ProgramFragmentStore *pfs = new ProgramFragmentStore(rsc, NULL, NULL); + ProgramFragmentStore *pfs = new ProgramFragmentStore(rsc); mDefault.set(pfs); } @@ -232,7 +266,7 @@ namespace renderscript { void rsi_ProgramFragmentStoreBegin(Context * rsc, RsElement in, RsElement out) { delete rsc->mStateFragmentStore.mPFS; - rsc->mStateFragmentStore.mPFS = new ProgramFragmentStore(rsc, (Element *)in, (Element *)out); + rsc->mStateFragmentStore.mPFS = new ProgramFragmentStore(rsc); } |
