/* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef GrGpu_DEFINED #define GrGpu_DEFINED #include "GrDrawTarget.h" #include "GrPathRenderer.h" #include "GrRect.h" #include "GrRefCnt.h" #include "GrTexture.h" class GrContext; class GrIndexBufferAllocPool; class GrResource; class GrVertexBufferAllocPool; /** * Gpu usage statistics. */ struct GrGpuStats { uint32_t fVertexCnt; // fGeoSrcStateStackStorage; GrTArray fGeomPoolStateStack; mutable GrIndexBuffer* fQuadIndexBuffer; // mutable so it can be // created on-demand mutable GrVertexBuffer* fUnitSquareVertexBuffer; // mutable so it can be // created on-demand GrDefaultPathRenderer* fDefaultPathRenderer; GrPathRenderer* fClientPathRenderer; bool fContextIsDirty; GrResource* fResourceHead; // GrDrawTarget overrides virtual void onDrawIndexed(GrPrimitiveType type, int startVertex, int startIndex, int vertexCount, int indexCount); virtual void onDrawNonIndexed(GrPrimitiveType type, int startVertex, int vertexCount); // readies the pools to provide vertex/index data. void prepareVertexPool(); void prepareIndexPool(); // determines the path renderer used to draw a clip path element. GrPathRenderer* getClipPathRenderer(const SkPath& path, GrPathFill fill); void handleDirtyContext() { if (fContextIsDirty) { this->resetContext(); fContextIsDirty = false; } } typedef GrDrawTarget INHERITED; }; #endif