Add onMemoryDump to GrContext

Adds an entry point to GrContext to allow enumeration and tracing of GPU resources
via the newly added SkTraceMemoryDump.

Plan is for Chrome to call this on each of its GrContexts.

Dumps both the total size of GPU resources, as well as the total purgeable size.

BUG=526261

Review URL: https://codereview.chromium.org/1313743002
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index c7e6ca9..4d6b6b8 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -105,7 +105,7 @@
     }
 }
 
-GrDrawContext* GrContext::DrawingMgr::drawContext(const SkSurfaceProps* surfaceProps) { 
+GrDrawContext* GrContext::DrawingMgr::drawContext(const SkSurfaceProps* surfaceProps) {
     if (this->abandoned()) {
         return nullptr;
     }
@@ -119,7 +119,7 @@
     }
 
     // For now, everyone gets a faux creation ref
-    return SkRef(fDrawContext[props.pixelGeometry()][props.isUseDeviceIndependentFonts()]); 
+    return SkRef(fDrawContext[props.pixelGeometry()][props.isUseDeviceIndependentFonts()]);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -759,3 +759,8 @@
     fResourceCache->setLimits(maxTextures, maxTextureBytes);
 }
 
+//////////////////////////////////////////////////////////////////////////////
+
+void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const {
+    fResourceCache->dumpMemoryStatistics(traceMemoryDump);
+}