diff options
| author | Miao Wang <miaowang@google.com> | 2015-03-10 15:29:40 -0700 |
|---|---|---|
| committer | Miao Wang <miaowang@google.com> | 2015-03-30 12:16:28 -0700 |
| commit | e5428e661ce6f9d24f838cab0a8fb0fa8c76dbca (patch) | |
| tree | 63202ff218aff023d7b0adb5e34cb28dff992287 /cpp/Sampler.cpp | |
| parent | c3851d58e6f0a97a3f5239d78515acd2be47b507 (diff) | |
Update RenderScript C++ API
- Add Copy3DRangeTo API
- Add AutoPadding & unPadding for CopyTo and CopyFrom APIs
- Add IntrinsicResize
Change-Id: I1138225f8a7b738929a09636bf2669f5d68b0c7d
Diffstat (limited to 'cpp/Sampler.cpp')
| -rw-r--r-- | cpp/Sampler.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/cpp/Sampler.cpp b/cpp/Sampler.cpp index 500651fe..62cea87c 100644 --- a/cpp/Sampler.cpp +++ b/cpp/Sampler.cpp @@ -25,11 +25,22 @@ Sampler::Sampler(sp<RS> rs, void* id): { RsSamplerValue mMin = RS_SAMPLER_INVALID; RsSamplerValue mMag = RS_SAMPLER_INVALID; - RsSamplerValue mWrapS = RS_SAMPLER_INVALID;; - RsSamplerValue mWrapT = RS_SAMPLER_INVALID;; + RsSamplerValue mWrapS = RS_SAMPLER_INVALID; + RsSamplerValue mWrapT = RS_SAMPLER_INVALID; float mAniso = 0.f; } +Sampler::Sampler(sp<RS> rs, void* id, RsSamplerValue min, RsSamplerValue mag, + RsSamplerValue wrapS, RsSamplerValue wrapT, float anisotropy): + BaseObj(id, rs) +{ + RsSamplerValue mMin = min; + RsSamplerValue mMag = mag; + RsSamplerValue mWrapS = wrapS; + RsSamplerValue mWrapT = wrapT; + float mAniso = anisotropy; +} + RsSamplerValue Sampler::getMinification() { return mMin; } @@ -50,10 +61,12 @@ float Sampler::getAnisotropy() { return mAniso; } -sp<Sampler> Sampler::create(sp<RS> rs, RsSamplerValue min, RsSamplerValue mag, RsSamplerValue wrapS, RsSamplerValue wrapT, float anisotropy) { +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->getContext(), min, mag, wrapS, wrapT, RS_SAMPLER_WRAP, anisotropy); - return new Sampler(rs, id); + void* id = RS::dispatch->SamplerCreate(rs->getContext(), min, mag, wrapS, wrapT, + RS_SAMPLER_WRAP, anisotropy); + return new Sampler(rs, id, min, mag, wrapS, wrapT, anisotropy); } #define CREATE_SAMPLER(N, MIN, MAG, WRAPS, WRAPT) sp<const Sampler> Sampler::N(sp<RS> rs) { \ |
