Code Cleanup and better Sampler creation method
Change-Id: I9e35081ee6034cb619f43a47f8f22f38977f5d12
diff --git a/libs/rs/rsSampler.h b/libs/rs/rsSampler.h
index 737bb8b0..192ee07 100644
--- a/libs/rs/rsSampler.h
+++ b/libs/rs/rsSampler.h
@@ -50,14 +50,22 @@
virtual RsA3DClassID getClassId() const { return RS_A3D_CLASS_ID_SAMPLER; }
static Sampler *createFromStream(Context *rsc, IStream *stream);
-protected:
- RsSamplerValue mMagFilter;
- RsSamplerValue mMinFilter;
- RsSamplerValue mWrapS;
- RsSamplerValue mWrapT;
- RsSamplerValue mWrapR;
- float mAniso;
+ struct Hal {
+ mutable void *drv;
+ struct State {
+ RsSamplerValue magFilter;
+ RsSamplerValue minFilter;
+ RsSamplerValue wrapS;
+ RsSamplerValue wrapT;
+ RsSamplerValue wrapR;
+ float aniso;
+ };
+ State state;
+ };
+ Hal mHal;
+
+protected:
int32_t mBoundSlot;
private:
@@ -67,13 +75,6 @@
class SamplerState {
public:
- RsSamplerValue mMagFilter;
- RsSamplerValue mMinFilter;
- RsSamplerValue mWrapS;
- RsSamplerValue mWrapT;
- RsSamplerValue mWrapR;
- float mAniso;
-
ObjectBaseRef<Sampler> mSamplers[RS_MAX_SAMPLER_SLOT];
};