2 // Copyright (c) 2002-2014 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
7 // IndexDataManager.h: Defines the IndexDataManager, a class that
8 // runs the Buffer translation process for index buffers.
10 #ifndef LIBGLESV2_INDEXDATAMANAGER_H_
11 #define LIBGLESV2_INDEXDATAMANAGER_H_
13 #include "common/angleutils.h"
17 enum { INITIAL_INDEX_BUFFER_SIZE = 4096 * sizeof(GLuint) };
27 class StaticIndexBufferInterface;
28 class StreamingIndexBufferInterface;
33 struct TranslatedIndexData
35 unsigned int minIndex;
36 unsigned int maxIndex;
37 unsigned int startIndex;
38 unsigned int startOffset; // In bytes
40 IndexBuffer *indexBuffer;
41 BufferStorage *storage;
46 class IndexDataManager
49 explicit IndexDataManager(Renderer *renderer);
50 virtual ~IndexDataManager();
52 GLenum prepareIndexData(GLenum type, GLsizei count, gl::Buffer *arrayElementBuffer, const GLvoid *indices, TranslatedIndexData *translated);
53 StaticIndexBufferInterface *getCountingIndices(GLsizei count);
56 DISALLOW_COPY_AND_ASSIGN(IndexDataManager);
58 Renderer *const mRenderer;
60 StreamingIndexBufferInterface *mStreamingBufferShort;
61 StreamingIndexBufferInterface *mStreamingBufferInt;
62 StaticIndexBufferInterface *mCountingBuffer;
67 #endif // LIBGLESV2_INDEXDATAMANAGER_H_