summaryrefslogtreecommitdiff
path: root/libs/rs/rsProgramFragmentStore.cpp
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2009-08-05 13:57:03 -0700
committerJason Sams <rjsams@android.com>2009-08-05 13:57:03 -0700
commit9bee51c42eb8c3daffe7d6fa483edbb1689b94d2 (patch)
treeed0f12b149a98299f205173a5563c42599426fe3 /libs/rs/rsProgramFragmentStore.cpp
parent9d1a3149f35b716caeda89dad53c0d8c45c6ca4b (diff)
Remove useless slot from ProgramVertex. Optimize GL state setup.
Diffstat (limited to 'libs/rs/rsProgramFragmentStore.cpp')
-rw-r--r--libs/rs/rsProgramFragmentStore.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/libs/rs/rsProgramFragmentStore.cpp b/libs/rs/rsProgramFragmentStore.cpp
index 9ee270f2226e..27f401532886 100644
--- a/libs/rs/rsProgramFragmentStore.cpp
+++ b/libs/rs/rsProgramFragmentStore.cpp
@@ -48,8 +48,13 @@ ProgramFragmentStore::~ProgramFragmentStore()
{
}
-void ProgramFragmentStore::setupGL()
+void ProgramFragmentStore::setupGL(ProgramFragmentStoreState *state)
{
+ if (state->mLast.get() == this) {
+ return;
+ }
+ state->mLast.set(this);
+
glColorMask(mColorRWriteEnable,
mColorGWriteEnable,
mColorBWriteEnable,
@@ -123,7 +128,7 @@ void ProgramFragmentStore::setDepthMask(bool mask)
void ProgramFragmentStore::setBlendFunc(RsBlendSrcFunc src, RsBlendDstFunc dst)
{
mBlendEnable = true;
- if ((src == RS_BLEND_SRC_ONE) &&
+ if ((src == RS_BLEND_SRC_ONE) &&
(dst == RS_BLEND_DST_ZERO)) {
mBlendEnable = false;
}