diff -r 000000000000 -r 6474c204b198 gfx/skia/trunk/src/gpu/GrIndexBuffer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gfx/skia/trunk/src/gpu/GrIndexBuffer.h Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,33 @@ + +/* + * Copyright 2010 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + + + +#ifndef GrIndexBuffer_DEFINED +#define GrIndexBuffer_DEFINED + +#include "GrGeometryBuffer.h" + +class GrIndexBuffer : public GrGeometryBuffer { +public: + /** + * Retrieves the maximum number of quads that could be rendered + * from the index buffer (using kTriangles_GrPrimitiveType). + * @return the maximum number of quads using full size of index buffer. + */ + int maxQuads() const { + return static_cast(this->sizeInBytes() / (sizeof(uint16_t) * 6)); + } +protected: + GrIndexBuffer(GrGpu* gpu, bool isWrapped, size_t sizeInBytes, bool dynamic, bool cpuBacked) + : INHERITED(gpu, isWrapped, sizeInBytes, dynamic, cpuBacked) {} +private: + typedef GrGeometryBuffer INHERITED; +}; + +#endif