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