summaryrefslogtreecommitdiff
path: root/tools/emulator/opengl/shared/OpenglCodecCommon/GLDecoderContextData.h
diff options
context:
space:
mode:
authorJacky Romano <jr@graphtech.co.il>2011-04-13 10:03:53 +0300
committerDavid 'Digit' Turner <digit@android.com>2011-05-03 14:38:29 +0200
commit68367ae969fc78d948d6ee02c54b9afd78ffad29 (patch)
tree0319ae00cb8923d08a0fccfd644b69edc81425d7 /tools/emulator/opengl/shared/OpenglCodecCommon/GLDecoderContextData.h
parente72ec4bfbda1aef6faebd20c0afc19ace53b308e (diff)
emulator Opengl - number of supported vertex attributes
make the number of suppoted vertex attributes (by the codec) common across the encoder and the decoder. Change-Id: I699ef62821566cec0764982872adb92ebb8861e9
Diffstat (limited to 'tools/emulator/opengl/shared/OpenglCodecCommon/GLDecoderContextData.h')
-rw-r--r--tools/emulator/opengl/shared/OpenglCodecCommon/GLDecoderContextData.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/tools/emulator/opengl/shared/OpenglCodecCommon/GLDecoderContextData.h b/tools/emulator/opengl/shared/OpenglCodecCommon/GLDecoderContextData.h
index eeb473432..2700554f2 100644
--- a/tools/emulator/opengl/shared/OpenglCodecCommon/GLDecoderContextData.h
+++ b/tools/emulator/opengl/shared/OpenglCodecCommon/GLDecoderContextData.h
@@ -19,6 +19,7 @@
#include <assert.h>
#include <string.h>
#include "FixedBuffer.h"
+#include "codec_defs.h"
class GLDecoderContextData {
public:
@@ -40,18 +41,29 @@ public:
LAST_LOCATION = 14
} PointerDataLocation;
+ GLDecoderContextData(int nLocations = CODEC_MAX_VERTEX_ATTRIBUTES) :
+ m_nLocations(nLocations)
+ {
+ m_pointerData = new FixedBuffer(m_nLocations);
+ }
+
+ ~GLDecoderContextData() {
+ delete m_pointerData;
+ }
+
void storePointerData(PointerDataLocation loc, void *data, size_t len) {
- assert(loc < LAST_LOCATION);
+ assert(loc < m_nLocations);
m_pointerData[loc].alloc(len);
memcpy(m_pointerData[loc].ptr(), data, len);
}
void *pointerData(PointerDataLocation loc) {
- assert(loc < LAST_LOCATION);
+ assert(loc < m_nLocations);
return m_pointerData[loc].ptr();
}
private:
- FixedBuffer m_pointerData[LAST_LOCATION];
+ FixedBuffer *m_pointerData;
+ int m_nLocations;
};
#endif