1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/angle/src/libGLESv2/renderer/IndexDataManager.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,66 @@ 1.4 +// 1.5 +// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved. 1.6 +// Use of this source code is governed by a BSD-style license that can be 1.7 +// found in the LICENSE file. 1.8 +// 1.9 + 1.10 +// IndexDataManager.h: Defines the IndexDataManager, a class that 1.11 +// runs the Buffer translation process for index buffers. 1.12 + 1.13 +#ifndef LIBGLESV2_INDEXDATAMANAGER_H_ 1.14 +#define LIBGLESV2_INDEXDATAMANAGER_H_ 1.15 + 1.16 +#include "common/angleutils.h" 1.17 + 1.18 +namespace 1.19 +{ 1.20 + enum { INITIAL_INDEX_BUFFER_SIZE = 4096 * sizeof(GLuint) }; 1.21 +} 1.22 + 1.23 +namespace gl 1.24 +{ 1.25 +class Buffer; 1.26 +} 1.27 + 1.28 +namespace rx 1.29 +{ 1.30 +class StaticIndexBufferInterface; 1.31 +class StreamingIndexBufferInterface; 1.32 +class IndexBuffer; 1.33 +class BufferStorage; 1.34 +class Renderer; 1.35 + 1.36 +struct TranslatedIndexData 1.37 +{ 1.38 + unsigned int minIndex; 1.39 + unsigned int maxIndex; 1.40 + unsigned int startIndex; 1.41 + unsigned int startOffset; // In bytes 1.42 + 1.43 + IndexBuffer *indexBuffer; 1.44 + BufferStorage *storage; 1.45 + unsigned int serial; 1.46 +}; 1.47 + 1.48 +class IndexDataManager 1.49 +{ 1.50 + public: 1.51 + explicit IndexDataManager(Renderer *renderer); 1.52 + virtual ~IndexDataManager(); 1.53 + 1.54 + GLenum prepareIndexData(GLenum type, GLsizei count, gl::Buffer *arrayElementBuffer, const GLvoid *indices, TranslatedIndexData *translated); 1.55 + StaticIndexBufferInterface *getCountingIndices(GLsizei count); 1.56 + 1.57 + private: 1.58 + DISALLOW_COPY_AND_ASSIGN(IndexDataManager); 1.59 + 1.60 + Renderer *const mRenderer; 1.61 + 1.62 + StreamingIndexBufferInterface *mStreamingBufferShort; 1.63 + StreamingIndexBufferInterface *mStreamingBufferInt; 1.64 + StaticIndexBufferInterface *mCountingBuffer; 1.65 +}; 1.66 + 1.67 +} 1.68 + 1.69 +#endif // LIBGLESV2_INDEXDATAMANAGER_H_