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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     2 /*
     3  * Copyright 2010 Google Inc.
     4  *
     5  * Use of this source code is governed by a BSD-style license that can be
     6  * found in the LICENSE file.
     7  */
    11 #ifndef GrIndexBuffer_DEFINED
    12 #define GrIndexBuffer_DEFINED
    14 #include "GrGeometryBuffer.h"
    16 class GrIndexBuffer : public GrGeometryBuffer {
    17 public:
    18     /**
    19      * Retrieves the maximum number of quads that could be rendered
    20      * from the index buffer (using kTriangles_GrPrimitiveType).
    21      * @return the maximum number of quads using full size of index buffer.
    22      */
    23     int maxQuads() const {
    24         return static_cast<int>(this->sizeInBytes() / (sizeof(uint16_t) * 6));
    25     }
    26 protected:
    27     GrIndexBuffer(GrGpu* gpu, bool isWrapped, size_t sizeInBytes, bool dynamic, bool cpuBacked)
    28         : INHERITED(gpu, isWrapped, sizeInBytes, dynamic, cpuBacked) {}
    29 private:
    30     typedef GrGeometryBuffer INHERITED;
    31 };
    33 #endif

mercurial