michael@0: // michael@0: // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: // michael@0: michael@0: // IndexDataManager.h: Defines the IndexDataManager, a class that michael@0: // runs the Buffer translation process for index buffers. michael@0: michael@0: #ifndef LIBGLESV2_INDEXDATAMANAGER_H_ michael@0: #define LIBGLESV2_INDEXDATAMANAGER_H_ michael@0: michael@0: #include "common/angleutils.h" michael@0: michael@0: namespace michael@0: { michael@0: enum { INITIAL_INDEX_BUFFER_SIZE = 4096 * sizeof(GLuint) }; michael@0: } michael@0: michael@0: namespace gl michael@0: { michael@0: class Buffer; michael@0: } michael@0: michael@0: namespace rx michael@0: { michael@0: class StaticIndexBufferInterface; michael@0: class StreamingIndexBufferInterface; michael@0: class IndexBuffer; michael@0: class BufferStorage; michael@0: class Renderer; michael@0: michael@0: struct TranslatedIndexData michael@0: { michael@0: unsigned int minIndex; michael@0: unsigned int maxIndex; michael@0: unsigned int startIndex; michael@0: unsigned int startOffset; // In bytes michael@0: michael@0: IndexBuffer *indexBuffer; michael@0: BufferStorage *storage; michael@0: unsigned int serial; michael@0: }; michael@0: michael@0: class IndexDataManager michael@0: { michael@0: public: michael@0: explicit IndexDataManager(Renderer *renderer); michael@0: virtual ~IndexDataManager(); michael@0: michael@0: GLenum prepareIndexData(GLenum type, GLsizei count, gl::Buffer *arrayElementBuffer, const GLvoid *indices, TranslatedIndexData *translated); michael@0: StaticIndexBufferInterface *getCountingIndices(GLsizei count); michael@0: michael@0: private: michael@0: DISALLOW_COPY_AND_ASSIGN(IndexDataManager); michael@0: michael@0: Renderer *const mRenderer; michael@0: michael@0: StreamingIndexBufferInterface *mStreamingBufferShort; michael@0: StreamingIndexBufferInterface *mStreamingBufferInt; michael@0: StaticIndexBufferInterface *mCountingBuffer; michael@0: }; michael@0: michael@0: } michael@0: michael@0: #endif // LIBGLESV2_INDEXDATAMANAGER_H_