Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Unified Diff: src/gpu/GrGpu.cpp

Issue 891973002: Add texture create/upload stats and make nanobench have explicit gpu stats flag (Closed) Base URL: https://skia.googlesource.com/skia.git@lala
Patch Set: rebase Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpu.cpp
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 1566aab67f376b4881ca6f6903a2dbba324401dc..67637e741a3e3bb1685175dd57b1655602de5f84 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -74,6 +74,12 @@ GrTexture* GrGpu::createTexture(const GrSurfaceDesc& desc, bool budgeted,
if (!this->caps()->reuseScratchTextures() && !isRT) {
tex->cacheAccess().removeScratchKey();
}
+ if (tex) {
+ fStats.incTextureCreates();
+ if (srcData) {
+ fStats.incTextureUploads();
+ }
+ }
return tex;
}
@@ -203,8 +209,12 @@ bool GrGpu::writeTexturePixels(GrTexture* texture,
GrPixelConfig config, const void* buffer,
size_t rowBytes) {
this->handleDirtyContext();
- return this->onWriteTexturePixels(texture, left, top, width, height,
- config, buffer, rowBytes);
+ if (this->onWriteTexturePixels(texture, left, top, width, height,
+ config, buffer, rowBytes)) {
+ fStats.incTextureUploads();
+ return true;
+ }
+ return false;
}
void GrGpu::resolveRenderTarget(GrRenderTarget* target) {
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698