gfx/skia/trunk/src/gpu/GrIndexBuffer.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/trunk/src/gpu/GrIndexBuffer.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,33 @@
     1.4 +
     1.5 +/*
     1.6 + * Copyright 2010 Google Inc.
     1.7 + *
     1.8 + * Use of this source code is governed by a BSD-style license that can be
     1.9 + * found in the LICENSE file.
    1.10 + */
    1.11 +
    1.12 +
    1.13 +
    1.14 +#ifndef GrIndexBuffer_DEFINED
    1.15 +#define GrIndexBuffer_DEFINED
    1.16 +
    1.17 +#include "GrGeometryBuffer.h"
    1.18 +
    1.19 +class GrIndexBuffer : public GrGeometryBuffer {
    1.20 +public:
    1.21 +    /**
    1.22 +     * Retrieves the maximum number of quads that could be rendered
    1.23 +     * from the index buffer (using kTriangles_GrPrimitiveType).
    1.24 +     * @return the maximum number of quads using full size of index buffer.
    1.25 +     */
    1.26 +    int maxQuads() const {
    1.27 +        return static_cast<int>(this->sizeInBytes() / (sizeof(uint16_t) * 6));
    1.28 +    }
    1.29 +protected:
    1.30 +    GrIndexBuffer(GrGpu* gpu, bool isWrapped, size_t sizeInBytes, bool dynamic, bool cpuBacked)
    1.31 +        : INHERITED(gpu, isWrapped, sizeInBytes, dynamic, cpuBacked) {}
    1.32 +private:
    1.33 +    typedef GrGeometryBuffer INHERITED;
    1.34 +};
    1.35 +
    1.36 +#endif

mercurial