2 * Copyright (C) 2011 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 #ifndef _GL_DECODER_CONTEXT_DATA_H_
17 #define _GL_DECODER_CONTEXT_DATA_H_
21 #include "FixedBuffer.h"
22 #include "codec_defs.h"
24 class GLDecoderContextData {
30 POINTSIZE_LOCATION = 3,
31 TEXCOORD0_LOCATION = 4,
32 TEXCOORD1_LOCATION = 5,
33 TEXCOORD2_LOCATION = 6,
34 TEXCOORD3_LOCATION = 7,
35 TEXCOORD4_LOCATION = 8,
36 TEXCOORD5_LOCATION = 9,
37 TEXCOORD6_LOCATION = 10,
38 TEXCOORD7_LOCATION = 11,
39 MATRIXINDEX_LOCATION = 12,
42 } PointerDataLocation;
44 GLDecoderContextData(int nLocations = CODEC_MAX_VERTEX_ATTRIBUTES) :
45 m_nLocations(nLocations)
47 m_pointerData = new FixedBuffer[m_nLocations];
50 ~GLDecoderContextData() {
51 delete [] m_pointerData;
54 void storePointerData(unsigned int loc, void *data, size_t len) {
56 assert(loc < m_nLocations);
57 m_pointerData[loc].alloc(len);
58 memcpy(m_pointerData[loc].ptr(), data, len);
60 void *pointerData(unsigned int loc) {
61 assert(loc < m_nLocations);
62 return m_pointerData[loc].ptr();
65 FixedBuffer *m_pointerData;