diff options
author | 2013-01-28 15:35:28 +0000 | |
---|---|---|
committer | 2013-01-28 15:35:28 +0000 | |
commit | 02ddc8b85ace91b15feb329a6a1d5d62b2b846c6 (patch) | |
tree | d745f2ea7a41bd09efe8c54db1ac0934a1174d22 /src/gpu/GrGpu.h | |
parent | 9e040aed72f80602896a069273a05d8933d6ad6e (diff) |
Make a bunch of virtuals in GrDrawTarget and GrGpu private. Subclasses shouldn't call them directly.
R=robertphillips@google.com
Review URL: https://codereview.appspot.com/7228048
git-svn-id: http://skia.googlecode.com/svn/trunk@7413 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/GrGpu.h')
-rw-r--r-- | src/gpu/GrGpu.h | 79 |
1 files changed, 30 insertions, 49 deletions
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h index 4bc4c25f00..5708c1cd94 100644 --- a/src/gpu/GrGpu.h +++ b/src/gpu/GrGpu.h @@ -417,43 +417,36 @@ protected: // constructors bool fConfigRenderSupport[kGrPixelConfigCount]; + // Helpers for setting up geometry state + void finalizeReservedVertices(); + void finalizeReservedIndices(); + +private: // GrDrawTarget overrides - virtual bool onReserveVertexSpace(GrVertexLayout vertexLayout, - int vertexCount, - void** vertices) SK_OVERRIDE; - virtual bool onReserveIndexSpace(int indexCount, - void** indices) SK_OVERRIDE; + virtual bool onReserveVertexSpace(GrVertexLayout, int vertexCount, void** vertices) SK_OVERRIDE; + virtual bool onReserveIndexSpace(int indexCount, void** indices) SK_OVERRIDE; virtual void releaseReservedVertexSpace() SK_OVERRIDE; virtual void releaseReservedIndexSpace() SK_OVERRIDE; - virtual void onSetVertexSourceToArray(const void* vertexArray, - int vertexCount) SK_OVERRIDE; - virtual void onSetIndexSourceToArray(const void* indexArray, - int indexCount) SK_OVERRIDE; + virtual void onSetVertexSourceToArray(const void* vertexArray, int vertexCount) SK_OVERRIDE; + virtual void onSetIndexSourceToArray(const void* indexArray, int indexCount) SK_OVERRIDE; virtual void releaseVertexArray() SK_OVERRIDE; virtual void releaseIndexArray() SK_OVERRIDE; virtual void geometrySourceWillPush() SK_OVERRIDE; - virtual void geometrySourceWillPop( - const GeometrySrcState& restoredState) SK_OVERRIDE; + virtual void geometrySourceWillPop(const GeometrySrcState& restoredState) SK_OVERRIDE; - // Helpers for setting up geometry state - void finalizeReservedVertices(); - void finalizeReservedIndices(); // called when the 3D context state is unknown. Subclass should emit any // assumed 3D context state and dirty any state cache. virtual void onResetContext() = 0; - // overridden by backend-specific derived class to create objects. virtual GrTexture* onCreateTexture(const GrTextureDesc& desc, const void* srcData, size_t rowBytes) = 0; virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&) = 0; virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&) = 0; - virtual GrVertexBuffer* onCreateVertexBuffer(uint32_t size, - bool dynamic) = 0; - virtual GrIndexBuffer* onCreateIndexBuffer(uint32_t size, - bool dynamic) = 0; + virtual GrVertexBuffer* onCreateVertexBuffer(uint32_t size, bool dynamic) = 0; + virtual GrIndexBuffer* onCreateIndexBuffer(uint32_t size, bool dynamic) = 0; virtual GrPath* onCreatePath(const SkPath& path) = 0; // overridden by backend-specific derived class to perform the clear and @@ -528,36 +521,6 @@ protected: // clears the entire stencil buffer to 0 virtual void clearStencil() = 0; -private: - GrContext* fContext; // not reffed (context refs gpu) - - ResetTimestamp fResetTimestamp; - - GrVertexBufferAllocPool* fVertexPool; - - GrIndexBufferAllocPool* fIndexPool; - - // counts number of uses of vertex/index pool in the geometry stack - int fVertexPoolUseCnt; - int fIndexPoolUseCnt; - - enum { - kPreallocGeomPoolStateStackCnt = 4, - }; - SkSTArray<kPreallocGeomPoolStateStackCnt, - GeometryPoolState, true> fGeomPoolStateStack; - - mutable GrIndexBuffer* fQuadIndexBuffer; // mutable so it can be - // created on-demand - - mutable GrVertexBuffer* fUnitSquareVertexBuffer; // mutable so it can be - // created on-demand - - bool fContextIsDirty; - - typedef SkTInternalLList<GrResource> ResourceList; - ResourceList fResourceList; - // Given a rt, find or create a stencil buffer and attach it bool attachStencilBufferToRenderTarget(GrRenderTarget* target); @@ -593,6 +556,24 @@ private: } } + enum { + kPreallocGeomPoolStateStackCnt = 4, + }; + typedef SkTInternalLList<GrResource> ResourceList; + SkSTArray<kPreallocGeomPoolStateStackCnt, GeometryPoolState, true> fGeomPoolStateStack; + GrContext* fContext; // not reffed + ResetTimestamp fResetTimestamp; + GrVertexBufferAllocPool* fVertexPool; + GrIndexBufferAllocPool* fIndexPool; + // counts number of uses of vertex/index pool in the geometry stack + int fVertexPoolUseCnt; + int fIndexPoolUseCnt; + // these are mutable so they can be created on-demand + mutable GrVertexBuffer* fUnitSquareVertexBuffer; + mutable GrIndexBuffer* fQuadIndexBuffer; + bool fContextIsDirty; + ResourceList fResourceList; + typedef GrDrawTarget INHERITED; }; |