summaryrefslogtreecommitdiff
path: root/rsProgramRaster.h
diff options
context:
space:
mode:
authorAlex Sakhartchouk <alexst@google.com>2011-08-16 13:09:46 -0700
committerAlex Sakhartchouk <alexst@google.com>2011-08-16 13:09:46 -0700
commitc700e649ca44d0dcff8b271e42d949ea72fe3c63 (patch)
tree0c9bb3cdc112d1a3f4de3e10aaeb138add7311c0 /rsProgramRaster.h
parent5c4369a3a1b19eaeabb044af2cdeef05474f9069 (diff)
downloadrs-c700e649ca44d0dcff8b271e42d949ea72fe3c63.tar.gz
Fixing asynchronous performance issues.
Change-Id: I10f02cd37a33a6c655814d24e0a4291dc044fba3
Diffstat (limited to 'rsProgramRaster.h')
-rw-r--r--rsProgramRaster.h28
1 files changed, 20 insertions, 8 deletions
diff --git a/rsProgramRaster.h b/rsProgramRaster.h
index efdb9487..09d7d543 100644
--- a/rsProgramRaster.h
+++ b/rsProgramRaster.h
@@ -27,19 +27,17 @@ class ProgramRasterState;
class ProgramRaster : public ProgramBase {
public:
- ProgramRaster(Context *rsc,
- bool pointSmooth,
- bool lineSmooth,
- bool pointSprite,
- float lineWidth,
- RsCullMode cull);
- virtual ~ProgramRaster();
-
virtual void setup(const Context *, ProgramRasterState *);
virtual void serialize(OStream *stream) const;
virtual RsA3DClassID getClassId() const { return RS_A3D_CLASS_ID_PROGRAM_RASTER; }
static ProgramRaster *createFromStream(Context *rsc, IStream *stream);
+ static ObjectBaseRef<ProgramRaster> getProgramRaster(Context *rsc,
+ bool pointSmooth,
+ bool lineSmooth,
+ bool pointSprite,
+ float lineWidth,
+ RsCullMode cull);
struct Hal {
mutable void *drv;
@@ -55,6 +53,17 @@ public:
Hal mHal;
protected:
+ virtual void preDestroy() const;
+ virtual ~ProgramRaster();
+
+private:
+ ProgramRaster(Context *rsc,
+ bool pointSmooth,
+ bool lineSmooth,
+ bool pointSprite,
+ float lineWidth,
+ RsCullMode cull);
+
};
class ProgramRasterState {
@@ -66,6 +75,9 @@ public:
ObjectBaseRef<ProgramRaster> mDefault;
ObjectBaseRef<ProgramRaster> mLast;
+
+ // Cache of all existing raster programs.
+ Vector<ProgramRaster *> mRasterPrograms;
};