summaryrefslogtreecommitdiffstats
path: root/libs/rs/rsAllocation.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/rs/rsAllocation.h')
-rw-r--r--libs/rs/rsAllocation.h29
1 files changed, 24 insertions, 5 deletions
diff --git a/libs/rs/rsAllocation.h b/libs/rs/rsAllocation.h
index 516f8b7..24e245f 100644
--- a/libs/rs/rsAllocation.h
+++ b/libs/rs/rsAllocation.h
@@ -55,14 +55,23 @@ public:
void uploadToBufferObject(const Context *rsc);
uint32_t getBufferObjectID() const {return mBufferID;}
+ void copyRange1D(Context *rsc, const Allocation *src, int32_t srcOff, int32_t destOff, int32_t len);
- void data(const void *data, uint32_t sizeBytes);
- void subData(uint32_t xoff, uint32_t count, const void *data, uint32_t sizeBytes);
- void subData(uint32_t xoff, uint32_t yoff,
+ void resize1D(Context *rsc, uint32_t dimX);
+ void resize2D(Context *rsc, uint32_t dimX, uint32_t dimY);
+
+ void data(Context *rsc, const void *data, uint32_t sizeBytes);
+ void subData(Context *rsc, uint32_t xoff, uint32_t count, const void *data, uint32_t sizeBytes);
+ void subData(Context *rsc, uint32_t xoff, uint32_t yoff,
uint32_t w, uint32_t h, const void *data, uint32_t sizeBytes);
- void subData(uint32_t xoff, uint32_t yoff, uint32_t zoff,
+ void subData(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t zoff,
uint32_t w, uint32_t h, uint32_t d, const void *data, uint32_t sizeBytes);
+ void subElementData(Context *rsc, uint32_t x,
+ const void *data, uint32_t elementOff, uint32_t sizeBytes);
+ void subElementData(Context *rsc, uint32_t x, uint32_t y,
+ const void *data, uint32_t elementOff, uint32_t sizeBytes);
+
void read(void *data);
void enableGLVertexBuffers() const;
@@ -72,12 +81,22 @@ public:
void removeProgramToDirty(const Program *);
virtual void dumpLOGV(const char *prefix) const;
+ virtual void serialize(OStream *stream) const;
+ virtual RsA3DClassID getClassId() const { return RS_A3D_CLASS_ID_ALLOCATION; }
+ static Allocation *createFromStream(Context *rsc, IStream *stream);
virtual void uploadCheck(const Context *rsc);
-protected:
+ bool getIsTexture() const {return mIsTexture;}
+ bool getIsBufferObject() const {return mIsVertexBuffer;}
+
+ void incRefs(const void *ptr, size_t ct, size_t startOff = 0) const;
+ void decRefs(const void *ptr, size_t ct, size_t startOff = 0) const;
+
void sendDirty() const;
+ bool getHasGraphicsMipmaps() const {return mTextureGenMipmap;}
+protected:
ObjectBaseRef<const Type> mType;
void * mPtr;