From d38f137e9b813f8193675ebd3dfbfe8bc42639e9 Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Wed, 12 Oct 2011 19:53:16 +0000 Subject: Move gpu/include/* to include/gpu and gpu/src/* to src/gpu Review URL: http://codereview.appspot.com/5250070/ git-svn-id: http://skia.googlecode.com/svn/trunk@2471 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/gpu/GrIndexBuffer.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/gpu/GrIndexBuffer.h (limited to 'src/gpu/GrIndexBuffer.h') diff --git a/src/gpu/GrIndexBuffer.h b/src/gpu/GrIndexBuffer.h new file mode 100644 index 0000000000..faa5018d32 --- /dev/null +++ b/src/gpu/GrIndexBuffer.h @@ -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_PrimitiveType). + * @return the maximum number of quads using full size of index buffer. + */ + int maxQuads() const { + return this->sizeInBytes() / (sizeof(uint16_t) * 6); + } +protected: + GrIndexBuffer(GrGpu* gpu, size_t sizeInBytes, bool dynamic) + : INHERITED(gpu, sizeInBytes, dynamic) {} +private: + typedef GrGeometryBuffer INHERITED; +}; + +#endif -- cgit v1.2.3