summaryrefslogtreecommitdiff
path: root/libs/rs/rsProgramFragmentStore.cpp
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2009-11-25 13:22:07 -0800
committerJason Sams <rjsams@android.com>2009-11-25 13:22:07 -0800
commitbb51c40d89c7dbdee7d7507fdfe0a64e8f4f87a9 (patch)
tree55de9e729267eb463e07599b6b809fb4635c9472 /libs/rs/rsProgramFragmentStore.cpp
parent3fdee335fe95ab94ef1ee619ad37f9369447fde5 (diff)
Begin gl2 support. Renderscript still uses GL1.1 by default. However, 2.0 can be enabled and will render most tests correctly.
Diffstat (limited to 'libs/rs/rsProgramFragmentStore.cpp')
-rw-r--r--libs/rs/rsProgramFragmentStore.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/libs/rs/rsProgramFragmentStore.cpp b/libs/rs/rsProgramFragmentStore.cpp
index de33d9c5ed04..d7d5c7589159 100644
--- a/libs/rs/rsProgramFragmentStore.cpp
+++ b/libs/rs/rsProgramFragmentStore.cpp
@@ -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;