summaryrefslogtreecommitdiffstats
path: root/cpp
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2013-11-26 15:38:31 -0800
committerStephen Hines <srhines@google.com>2013-11-26 16:56:30 -0800
commit8a588bd9d34088ed89ef2c192c32ea2301e601bc (patch)
tree8c55a31502d2edba474c7460c3db56cc37fff898 /cpp
parentb98626d1da831c5ced7d74d374a3242cbb82c3a5 (diff)
downloadandroid_frameworks_rs-8a588bd9d34088ed89ef2c192c32ea2301e601bc.tar.gz
android_frameworks_rs-8a588bd9d34088ed89ef2c192c32ea2301e601bc.tar.bz2
android_frameworks_rs-8a588bd9d34088ed89ef2c192c32ea2301e601bc.zip
Fix problems with NDK Sampler implementation.
Creation methods should be static and we need to use the proper Context pointer for the dispatch methods. Change-Id: I43c25a7348c9a9aa9a2a82e184d4ac644625800b
Diffstat (limited to 'cpp')
-rw-r--r--cpp/Sampler.cpp2
-rw-r--r--cpp/rsCppStructs.h18
2 files changed, 10 insertions, 10 deletions
diff --git a/cpp/Sampler.cpp b/cpp/Sampler.cpp
index a1f46691..767d626e 100644
--- a/cpp/Sampler.cpp
+++ b/cpp/Sampler.cpp
@@ -51,7 +51,7 @@ float Sampler::getAnisotropy() {
sp<Sampler> Sampler::create(sp<RS> rs, RsSamplerValue min, RsSamplerValue mag, RsSamplerValue wrapS, RsSamplerValue wrapT, float anisotropy) {
// we aren't supporting wrapR in C++ API atm, so always pass wrap for that
- void* id = RS::dispatch->SamplerCreate(rs.get(), min, mag, wrapS, wrapT, RS_SAMPLER_WRAP, anisotropy);
+ void* id = RS::dispatch->SamplerCreate(rs->getContext(), min, mag, wrapS, wrapT, RS_SAMPLER_WRAP, anisotropy);
return new Sampler(rs, id);
}
diff --git a/cpp/rsCppStructs.h b/cpp/rsCppStructs.h
index 1efd128c..68345443 100644
--- a/cpp/rsCppStructs.h
+++ b/cpp/rsCppStructs.h
@@ -1917,7 +1917,7 @@ class ScriptIntrinsicYuvToRGB : public ScriptIntrinsic {
*
* @return Sampler
*/
- sp<const Sampler> CLAMP_NEAREST(sp<RS> rs);
+ static sp<const Sampler> CLAMP_NEAREST(sp<RS> rs);
/**
* Retrieve a sampler with min and mag set to linear and wrap modes set to
* clamp.
@@ -1926,7 +1926,7 @@ class ScriptIntrinsicYuvToRGB : public ScriptIntrinsic {
*
* @return Sampler
*/
- sp<const Sampler> CLAMP_LINEAR(sp<RS> rs);
+ static sp<const Sampler> CLAMP_LINEAR(sp<RS> rs);
/**
* Retrieve a sampler with mag set to linear, min linear mipmap linear, and
* wrap modes set to clamp.
@@ -1935,7 +1935,7 @@ class ScriptIntrinsicYuvToRGB : public ScriptIntrinsic {
*
* @return Sampler
*/
- sp<const Sampler> CLAMP_LINEAR_MIP_LINEAR(sp<RS> rs);
+ static sp<const Sampler> CLAMP_LINEAR_MIP_LINEAR(sp<RS> rs);
/**
* Retrieve a sampler with min and mag set to nearest and wrap modes set to
* wrap.
@@ -1944,7 +1944,7 @@ class ScriptIntrinsicYuvToRGB : public ScriptIntrinsic {
*
* @return Sampler
*/
- sp<const Sampler> WRAP_NEAREST(sp<RS> rs);
+ static sp<const Sampler> WRAP_NEAREST(sp<RS> rs);
/**
* Retrieve a sampler with min and mag set to linear and wrap modes set to
* wrap.
@@ -1953,7 +1953,7 @@ class ScriptIntrinsicYuvToRGB : public ScriptIntrinsic {
*
* @return Sampler
*/
- sp<const Sampler> WRAP_LINEAR(sp<RS> rs);
+ static sp<const Sampler> WRAP_LINEAR(sp<RS> rs);
/**
* Retrieve a sampler with mag set to linear, min linear mipmap linear, and
* wrap modes set to wrap.
@@ -1962,7 +1962,7 @@ class ScriptIntrinsicYuvToRGB : public ScriptIntrinsic {
*
* @return Sampler
*/
- sp<const Sampler> WRAP_LINEAR_MIP_LINEAR(sp<RS> rs);
+ static sp<const Sampler> WRAP_LINEAR_MIP_LINEAR(sp<RS> rs);
/**
* Retrieve a sampler with min and mag set to nearest and wrap modes set to
* mirrored repeat.
@@ -1971,7 +1971,7 @@ class ScriptIntrinsicYuvToRGB : public ScriptIntrinsic {
*
* @return Sampler
*/
- sp<const Sampler> MIRRORED_REPEAT_NEAREST(sp<RS> rs);
+ static sp<const Sampler> MIRRORED_REPEAT_NEAREST(sp<RS> rs);
/**
* Retrieve a sampler with min and mag set to linear and wrap modes set to
* mirrored repeat.
@@ -1980,7 +1980,7 @@ class ScriptIntrinsicYuvToRGB : public ScriptIntrinsic {
*
* @return Sampler
*/
- sp<const Sampler> MIRRORED_REPEAT_LINEAR(sp<RS> rs);
+ static sp<const Sampler> MIRRORED_REPEAT_LINEAR(sp<RS> rs);
/**
* Retrieve a sampler with min and mag set to linear and wrap modes set to
* mirrored repeat.
@@ -1989,7 +1989,7 @@ class ScriptIntrinsicYuvToRGB : public ScriptIntrinsic {
*
* @return Sampler
*/
- sp<const Sampler> MIRRORED_REPEAT_LINEAR_MIP_LINEAR(sp<RS> rs);
+ static sp<const Sampler> MIRRORED_REPEAT_LINEAR_MIP_LINEAR(sp<RS> rs);
};