Add stencil buffer create tracking to GPU stats.
Review URL: https://codereview.chromium.org/949953002
This commit is contained in:
parent
088302756b
commit
9e5fc72d63
@ -166,9 +166,8 @@ private:
|
|||||||
void setupCache(const SkClipStack& clip,
|
void setupCache(const SkClipStack& clip,
|
||||||
const SkIRect& bounds);
|
const SkIRect& bounds);
|
||||||
/**
|
/**
|
||||||
* Called prior to return control back the GrGpu in setupClipping. It
|
* Called prior to return control back the GrGpu in setupClipping. It updates the
|
||||||
* updates the GrGpu with stencil settings that account stencil-based
|
* GrPipelineBuilder with stencil settings that account for stencil-based clipping.
|
||||||
* clipping.
|
|
||||||
*/
|
*/
|
||||||
void setPipelineBuilderStencil(GrPipelineBuilder*, GrPipelineBuilder::AutoRestoreStencil*);
|
void setPipelineBuilderStencil(GrPipelineBuilder*, GrPipelineBuilder::AutoRestoreStencil*);
|
||||||
|
|
||||||
|
@ -358,6 +358,7 @@ public:
|
|||||||
fShaderCompilations = 0;
|
fShaderCompilations = 0;
|
||||||
fTextureCreates = 0;
|
fTextureCreates = 0;
|
||||||
fTextureUploads = 0;
|
fTextureUploads = 0;
|
||||||
|
fStencilBufferCreates = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int renderTargetBinds() const { return fRenderTargetBinds; }
|
int renderTargetBinds() const { return fRenderTargetBinds; }
|
||||||
@ -368,6 +369,7 @@ public:
|
|||||||
void incTextureCreates() { fTextureCreates++; }
|
void incTextureCreates() { fTextureCreates++; }
|
||||||
int textureUploads() const { return fTextureUploads; }
|
int textureUploads() const { return fTextureUploads; }
|
||||||
void incTextureUploads() { fTextureUploads++; }
|
void incTextureUploads() { fTextureUploads++; }
|
||||||
|
void incStencilBufferCreates() { fStencilBufferCreates++; }
|
||||||
void dump(SkString*);
|
void dump(SkString*);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -375,12 +377,14 @@ public:
|
|||||||
int fShaderCompilations;
|
int fShaderCompilations;
|
||||||
int fTextureCreates;
|
int fTextureCreates;
|
||||||
int fTextureUploads;
|
int fTextureUploads;
|
||||||
|
int fStencilBufferCreates;
|
||||||
#else
|
#else
|
||||||
void dump(SkString*) {};
|
void dump(SkString*) {};
|
||||||
void incRenderTargetBinds() {}
|
void incRenderTargetBinds() {}
|
||||||
void incShaderCompilations() {}
|
void incShaderCompilations() {}
|
||||||
void incTextureCreates() {}
|
void incTextureCreates() {}
|
||||||
void incTextureUploads() {}
|
void incTextureUploads() {}
|
||||||
|
void incStencilBufferCreates() {}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -72,6 +72,7 @@ void GrGpu::Stats::dump(SkString* out) {
|
|||||||
out->appendf("Shader Compilations: %d\n", fShaderCompilations);
|
out->appendf("Shader Compilations: %d\n", fShaderCompilations);
|
||||||
out->appendf("Textures Created: %d\n", fTextureCreates);
|
out->appendf("Textures Created: %d\n", fTextureCreates);
|
||||||
out->appendf("Texture Uploads: %d\n", fTextureUploads);
|
out->appendf("Texture Uploads: %d\n", fTextureUploads);
|
||||||
|
out->appendf("Stencil Buffer Creates: %d\n", fStencilBufferCreates);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1172,7 +1172,7 @@ bool GrGLGpu::createStencilBufferForRenderTarget(GrRenderTarget* rt, int width,
|
|||||||
created = (GR_GL_NO_ERROR == check_alloc_error(rt->desc(), this->glInterface()));
|
created = (GR_GL_NO_ERROR == check_alloc_error(rt->desc(), this->glInterface()));
|
||||||
}
|
}
|
||||||
if (created) {
|
if (created) {
|
||||||
|
fStats.incStencilBufferCreates();
|
||||||
// After sized formats we attempt an unsized format and take
|
// After sized formats we attempt an unsized format and take
|
||||||
// whatever sizes GL gives us. In that case we query for the size.
|
// whatever sizes GL gives us. In that case we query for the size.
|
||||||
GrGLStencilBuffer::Format format = sFmt;
|
GrGLStencilBuffer::Format format = sFmt;
|
||||||
|
Loading…
Reference in New Issue
Block a user