summaryrefslogtreecommitdiff
path: root/libs/hwui/pipeline/skia/SkiaPipeline.cpp
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2016-11-08 01:15:29 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-11-08 01:15:33 +0000
commite3d281ea18f7ccd477e4db5e74cf4fc1506e9f98 (patch)
tree29adbdfb0fab66111d70e32345fddd1bb81fac38 /libs/hwui/pipeline/skia/SkiaPipeline.cpp
parentb54e147041540acda5869d4e3e997fa24aad1da9 (diff)
parent4bda6bfaa6b8cb775f18f2453720d05f4cb29152 (diff)
Merge "Add debug memory tracking to SkiaGLPipeline"
Diffstat (limited to 'libs/hwui/pipeline/skia/SkiaPipeline.cpp')
-rw-r--r--libs/hwui/pipeline/skia/SkiaPipeline.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/hwui/pipeline/skia/SkiaPipeline.cpp b/libs/hwui/pipeline/skia/SkiaPipeline.cpp
index 69e603b6c927..a6612c96b8f3 100644
--- a/libs/hwui/pipeline/skia/SkiaPipeline.cpp
+++ b/libs/hwui/pipeline/skia/SkiaPipeline.cpp
@@ -266,6 +266,20 @@ void SkiaPipeline::renderFrame(const LayerUpdateQueue& layers, const SkRect& cli
canvas->flush();
}
+void SkiaPipeline::dumpResourceCacheUsage() const {
+ int resources, maxResources;
+ size_t bytes, maxBytes;
+ mRenderThread.getGrContext()->getResourceCacheUsage(&resources, &bytes);
+ mRenderThread.getGrContext()->getResourceCacheLimits(&maxResources, &maxBytes);
+
+ SkString log("Resource Cache Usage:\n");
+ log.appendf("%8d items out of %d maximum items\n", resources, maxResources);
+ log.appendf("%8zu bytes (%.2f MB) out of %.2f MB maximum\n",
+ bytes, bytes * (1.0f / (1024.0f * 1024.0f)), maxBytes * (1.0f / (1024.0f * 1024.0f)));
+
+ ALOGD("%s", log.c_str());
+}
+
} /* namespace skiapipeline */
} /* namespace uirenderer */
} /* namespace android */