aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-06 18:21:18 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-06 18:21:18 +0000
commit9923c2b29aafc7ebc81c929c68c6b32443c9f22b (patch)
tree68d2b0401eebbd7674dbcbea3ee222ad04006efe
parentd4340e2b35ceea8a86a17dd001e168e9e758eea7 (diff)
Remove gpu stats tracking
Review URL: http://codereview.appspot.com/6300052/ git-svn-id: http://skia.googlecode.com/svn/trunk@4194 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--experimental/iOSSampleApp/SkSampleUIView.mm8
-rw-r--r--include/gpu/GrConfig.h8
-rw-r--r--include/gpu/GrContext.h5
-rw-r--r--src/gpu/GrContext.cpp12
-rw-r--r--src/gpu/GrGpu.cpp38
-rw-r--r--src/gpu/GrGpu.h34
-rw-r--r--src/gpu/gl/GrGpuGL.cpp16
7 files changed, 1 insertions, 120 deletions
diff --git a/experimental/iOSSampleApp/SkSampleUIView.mm b/experimental/iOSSampleApp/SkSampleUIView.mm
index b1ec537c51..54177878c0 100644
--- a/experimental/iOSSampleApp/SkSampleUIView.mm
+++ b/experimental/iOSSampleApp/SkSampleUIView.mm
@@ -354,14 +354,6 @@ static FPSState gFPS;
glBindRenderbuffer(GL_RENDERBUFFER, fGL.fRenderbuffer);
[fGL.fContext presentRenderbuffer:GL_RENDERBUFFER];
-#if GR_COLLECT_STATS
- // static int frame = 0;
- // if (!(frame % 100)) {
- // ctx->printStats();
- // }
- // ctx->resetStats();
- // ++frame;
-#endif
}
- (void)drawInRaster {
diff --git a/include/gpu/GrConfig.h b/include/gpu/GrConfig.h
index e25859be23..eecce79d2b 100644
--- a/include/gpu/GrConfig.h
+++ b/include/gpu/GrConfig.h
@@ -328,14 +328,6 @@ inline void GrCrash(const char* msg) { GrPrintf(msg); GrAlwaysAssert(false); }
#endif
/**
- * GR_COLLECT_STATS controls whether the GrGpu class collects stats.
- * If not already defined then collect in debug build but not release.
- */
-#if !defined(GR_COLLECT_STATS)
- #define GR_COLLECT_STATS GR_DEBUG
-#endif
-
-/**
* GR_STATIC_RECT_VB controls whether rects are drawn by issuing a vertex
* for each corner or using a static vb that is positioned by modifying the
* view / texture matrix.
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index adceb778c5..33a3abf41d 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -21,7 +21,6 @@ class GrDrawState;
class GrDrawTarget;
class GrFontCache;
class GrGpu;
-struct GrGpuStats;
class GrIndexBuffer;
class GrIndexBufferAllocPool;
class GrInOrderDrawBuffer;
@@ -665,9 +664,7 @@ public:
GrFontCache* getFontCache() { return fFontCache; }
GrDrawTarget* getTextTarget(const GrPaint& paint);
const GrIndexBuffer* getQuadIndexBuffer() const;
- void resetStats();
- const GrGpuStats& getStats() const;
- void printStats() const;
+
/**
* Stencil buffers add themselves to the cache using
* addAndLockStencilBuffer. When a SB's RT-attachment count
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;
}