summaryrefslogtreecommitdiff
path: root/libs/rs/rsSampler.cpp
diff options
context:
space:
mode:
author Android (Google) Code Review <android-gerrit@google.com> 2009-05-28 16:43:29 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2009-05-28 16:43:29 -0700
commitb2b96c255b2dfc442a4cbb72b8df607c0217a805 (patch)
treefc05f4b3e72fa7bfc3f098a08bc46f5af8a2115d /libs/rs/rsSampler.cpp
parent3d7fcb6918b807ce780fc2f3e9b2301fa1779124 (diff)
parent02fb2cb531035779a25dbf9595e0628ea40585b0 (diff)
Merge change 2668
* changes: Add sampler support
Diffstat (limited to 'libs/rs/rsSampler.cpp')
-rw-r--r--libs/rs/rsSampler.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/libs/rs/rsSampler.cpp b/libs/rs/rsSampler.cpp
index 3c008c9de8cc..ca407db40381 100644
--- a/libs/rs/rsSampler.cpp
+++ b/libs/rs/rsSampler.cpp
@@ -53,7 +53,21 @@ Sampler::~Sampler()
void Sampler::setupGL()
{
+ GLenum translate[] = {
+ GL_NEAREST, //RS_SAMPLER_NEAREST,
+ GL_LINEAR, //RS_SAMPLER_LINEAR,
+ GL_LINEAR_MIP_LINEAR, //RS_SAMPLER_LINEAR_MIP_LINEAR,
+ GL_WRAP, //RS_SAMPLER_WRAP,
+ GL_CLAMP_TO_EDGS, //RS_SAMPLER_CLAMP
+
+ }
+
+
//LOGE("setup gl");
+ switch(mMagFilter) {
+ case RS_SAMPLER_
+ }
+
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
@@ -76,7 +90,7 @@ void Sampler::unbindFromContext(SamplerState *ss)
void SamplerState::setupGL()
{
- for (uint32_t ct=0; ct < 1/*RS_MAX_SAMPLER_SLOT*/; ct++) {
+ for (uint32_t ct=0; ct < RS_MAX_SAMPLER_SLOT; ct++) {
Sampler *s = mSamplers[ct].get();
if (s) {
s->setupGL();
@@ -140,4 +154,12 @@ RsSampler rsi_SamplerCreate(Context *rsc)
return s;
}
+void rsi_SamplerDestroy(Context *rsc, RsSampler vs)
+{
+ Sampler * s = static_cast<Sampler *>(vs);
+ s->decRef();
+
+}
+
+
}}