123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- #ifndef ANDROID_RS_PROGRAM_FRAGMENT_STORE_H
- #define ANDROID_RS_PROGRAM_FRAGMENT_STORE_H
- #include "rsProgramBase.h"
- #include "rsStream.h"
- #include <vector>
- namespace android {
- namespace renderscript {
- class ProgramStoreState;
- class ProgramStore : public ProgramBase {
- public:
- struct Hal {
- mutable void *drv;
- struct State {
- bool ditherEnable;
-
- bool colorRWriteEnable;
- bool colorGWriteEnable;
- bool colorBWriteEnable;
- bool colorAWriteEnable;
- RsBlendSrcFunc blendSrc;
- RsBlendDstFunc blendDst;
-
- bool depthWriteEnable;
- RsDepthFunc depthFunc;
- };
- State state;
- };
- Hal mHal;
- virtual void setup(const Context *, ProgramStoreState *);
- virtual void serialize(Context *rsc, OStream *stream) const;
- virtual RsA3DClassID getClassId() const { return RS_A3D_CLASS_ID_PROGRAM_STORE; }
- static ProgramStore *createFromStream(Context *rsc, IStream *stream);
- static ObjectBaseRef<ProgramStore> getProgramStore(Context *,
- bool colorMaskR, bool colorMaskG,
- bool colorMaskB, bool colorMaskA,
- bool depthMask, bool ditherEnable,
- RsBlendSrcFunc srcFunc, RsBlendDstFunc destFunc,
- RsDepthFunc depthFunc);
- void init();
- protected:
- virtual void preDestroy() const;
- virtual ~ProgramStore();
- private:
- ProgramStore(Context *,
- bool colorMaskR, bool colorMaskG, bool colorMaskB, bool colorMaskA,
- bool depthMask, bool ditherEnable,
- RsBlendSrcFunc srcFunc, RsBlendDstFunc destFunc,
- RsDepthFunc depthFunc);
- };
- class ProgramStoreState {
- public:
- ProgramStoreState();
- ~ProgramStoreState();
- void init(Context *rsc);
- void deinit(Context *rsc);
- ObjectBaseRef<ProgramStore> mDefault;
- ObjectBaseRef<ProgramStore> mLast;
-
- std::vector<ProgramStore *> mStorePrograms;
- };
- }
- }
- #endif
|