From c700e649ca44d0dcff8b271e42d949ea72fe3c63 Mon Sep 17 00:00:00 2001 From: Alex Sakhartchouk Date: Tue, 16 Aug 2011 13:09:46 -0700 Subject: Fixing asynchronous performance issues. Change-Id: I10f02cd37a33a6c655814d24e0a4291dc044fba3 --- rsProgramRaster.h | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'rsProgramRaster.h') 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 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 mDefault; ObjectBaseRef mLast; + + // Cache of all existing raster programs. + Vector mRasterPrograms; }; -- cgit v1.2.3