diff options
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/GrContext.cpp | 12 | ||||
-rw-r--r-- | src/gpu/GrGpu.cpp | 38 | ||||
-rw-r--r-- | src/gpu/GrGpu.h | 34 | ||||
-rw-r--r-- | src/gpu/gl/GrGpuGL.cpp | 16 |
4 files changed, 0 insertions, 100 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index 072bc47314..bbca09ac58 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -1898,18 +1898,6 @@ static inline intptr_t setOrClear(intptr_t bits, int shift, intptr_t pred) { return bits; } -void GrContext::resetStats() { - fGpu->resetStats(); -} - -const GrGpuStats& GrContext::getStats() const { - return fGpu->getStats(); -} - -void GrContext::printStats() const { - fGpu->printStats(); -} - GrContext::GrContext(GrGpu* gpu) { fGpu = gpu; fGpu->ref(); diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp index a873fe7ef5..9e26135122 100644 --- a/src/gpu/GrGpu.cpp +++ b/src/gpu/GrGpu.cpp @@ -53,7 +53,6 @@ GrGpu::GrGpu() poolState.fPoolIndexBuffer = (GrIndexBuffer*)DEBUG_INVAL_BUFFER; poolState.fPoolStartIndex = DEBUG_INVAL_START_IDX; #endif - resetStats(); for (int i = 0; i < kGrPixelConfigCount; ++i) { fConfigRenderSupport[i] = false; @@ -415,12 +414,6 @@ void GrGpu::onDrawIndexed(GrPrimitiveType type, return; } -#if GR_COLLECT_STATS - fStats.fVertexCnt += vertexCount; - fStats.fIndexCnt += indexCount; - fStats.fDrawCnt += 1; -#endif - int sVertex = startVertex; int sIndex = startIndex; setupGeometry(&sVertex, &sIndex, vertexCount, indexCount); @@ -437,10 +430,6 @@ void GrGpu::onDrawNonIndexed(GrPrimitiveType type, if (!this->setupClipAndFlushState(type)) { return; } -#if GR_COLLECT_STATS - fStats.fVertexCnt += vertexCount; - fStats.fDrawCnt += 1; -#endif int sVertex = startVertex; setupGeometry(&sVertex, NULL, vertexCount, 0); @@ -586,30 +575,3 @@ void GrGpu::releaseIndexArray() { --fIndexPoolUseCnt; } -//////////////////////////////////////////////////////////////////////////////// - -const GrGpuStats& GrGpu::getStats() const { - return fStats; -} - -void GrGpu::resetStats() { - memset(&fStats, 0, sizeof(fStats)); -} - -void GrGpu::printStats() const { - if (GR_COLLECT_STATS) { - GrPrintf( - "-v-------------------------GPU STATS----------------------------v-\n" - "Stats collection is: %s\n" - "Draws: %04d, Verts: %04d, Indices: %04d\n" - "ProgChanges: %04d, TexChanges: %04d, RTChanges: %04d\n" - "TexCreates: %04d, RTCreates:%04d\n" - "-^--------------------------------------------------------------^-\n", - (GR_COLLECT_STATS ? "ON" : "OFF"), - fStats.fDrawCnt, fStats.fVertexCnt, fStats.fIndexCnt, - fStats.fProgChngCnt, fStats.fTextureChngCnt, fStats.fRenderTargetChngCnt, - fStats.fTextureCreateCnt, fStats.fRenderTargetCreateCnt); - } -} - - diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h index f14c17f5cf..baca8248ff 100644 --- a/src/gpu/GrGpu.h +++ b/src/gpu/GrGpu.h @@ -24,34 +24,6 @@ class GrResource; class GrStencilBuffer; class GrVertexBufferAllocPool; -/** - * Gpu usage statistics. - */ -struct GrGpuStats { - uint32_t fVertexCnt; //<! Number of vertices drawn - uint32_t fIndexCnt; //<! Number of indices drawn - uint32_t fDrawCnt; //<! Number of draws - - uint32_t fProgChngCnt;//<! Number of program changes - - /** - * Number of times the texture is set in 3D API - */ - uint32_t fTextureChngCnt; - /** - * Number of times the render target is set in 3D API - */ - uint32_t fRenderTargetChngCnt; - /** - * Number of textures created (includes textures that are rendertargets). - */ - uint32_t fTextureCreateCnt; - /** - * Number of rendertargets created. - */ - uint32_t fRenderTargetCreateCnt; -}; - class GrGpu : public GrDrawTarget { public: @@ -286,10 +258,6 @@ public: GrPixelConfig config, const void* buffer, size_t rowBytes); - const GrGpuStats& getStats() const; - void resetStats(); - void printStats() const; - /** * Called to tell Gpu object that all GrResources have been lost and should * be abandoned. Overrides must call INHERITED::abandonResources(). @@ -391,8 +359,6 @@ protected: // and the client isn't using the stencil test. static const GrStencilSettings* GetClipStencilSettings(); - GrGpuStats fStats; - GrClipMaskManager fClipMaskManager; struct GeometryPoolState { diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp index f9d4cbb569..82a65fd451 100644 --- a/src/gpu/gl/GrGpuGL.cpp +++ b/src/gpu/gl/GrGpuGL.cpp @@ -1002,10 +1002,6 @@ GrTexture* GrGpuGL::onCreateTexture(const GrTextureDesc& desc, const void* srcData, size_t rowBytes) { -#if GR_COLLECT_STATS - ++fStats.fTextureCreateCnt; -#endif - GrGLTexture::Desc glTexDesc; GrGLRenderTarget::Desc glRTDesc; @@ -1093,9 +1089,6 @@ GrTexture* GrGpuGL::onCreateTexture(const GrTextureDesc& desc, GrGLTexture* tex; if (renderTarget) { -#if GR_COLLECT_STATS - ++fStats.fRenderTargetCreateCnt; -#endif // unbind the texture from the texture unit before binding it to the frame buffer GL_CALL(BindTexture(GR_GL_TEXTURE_2D, 0)); @@ -1613,9 +1606,6 @@ void GrGpuGL::flushRenderTarget(const GrIRect* bound) { if (fHWBoundRenderTarget != rt) { GL_CALL(BindFramebuffer(GR_GL_FRAMEBUFFER, rt->renderFBOID())); - #if GR_COLLECT_STATS - ++fStats.fRenderTargetChngCnt; - #endif #if GR_DEBUG GrGLenum status; GL_CALL_RET(status, CheckFramebufferStatus(GR_GL_FRAMEBUFFER)); @@ -1737,9 +1727,6 @@ void GrGpuGL::onResolveRenderTarget(GrRenderTarget* target) { rt->renderFBOID())); GL_CALL(BindFramebuffer(GR_GL_DRAW_FRAMEBUFFER, rt->textureFBOID())); - #if GR_COLLECT_STATS - ++fStats.fRenderTargetChngCnt; - #endif // make sure we go through flushRenderTarget() since we've modified // the bound DRAW FBO ID. fHWBoundRenderTarget = NULL; @@ -2134,9 +2121,6 @@ void GrGpuGL::flushBoundTextureAndParams(int stage) { if (fHWBoundTextures[stage] != nextTexture) { this->setTextureUnit(stage); GL_CALL(BindTexture(GR_GL_TEXTURE_2D, nextTexture->textureID())); - #if GR_COLLECT_STATS - ++fStats.fTextureChngCnt; - #endif //GrPrintf("---- bindtexture %d\n", nextTexture->textureID()); fHWBoundTextures[stage] = nextTexture; } |