Index: include/gpu/GrGpuResource.h |
diff --git a/include/gpu/GrGpuResource.h b/include/gpu/GrGpuResource.h |
index d726115a7289127e1fd18dcee5810a984774fb8b..b5a97b1fbe7cd907b46fd433bdb7579fbcc78be5 100644 |
--- a/include/gpu/GrGpuResource.h |
+++ b/include/gpu/GrGpuResource.h |
@@ -15,6 +15,7 @@ |
class GrContext; |
class GrGpu; |
class GrResourceCache; |
+class SkTraceMemoryDump; |
/** |
* Base class for GrGpuResource. Handles the various types of refs we need. Separated out as a base |
@@ -138,8 +139,6 @@ private: |
*/ |
class SK_API GrGpuResource : public GrIORef<GrGpuResource> { |
public: |
- |
- |
enum LifeCycle { |
/** |
* The resource is cached and owned by Skia. Resources with this status may be kept alive |
@@ -252,6 +251,11 @@ public: |
*/ |
void abandon(); |
+ /** |
+ * Dumps memory usage information for this GrGpuResource to traceMemoryDump. |
+ **/ |
+ void dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const; |
+ |
protected: |
// This must be called by every GrGpuObject. It should be called once the object is fully |
// initialized (i.e. not in a base class constructor). |
@@ -288,6 +292,13 @@ protected: |
**/ |
void setScratchKey(const GrScratchKey& scratchKey); |
+ /** |
+ * Allows subclasses to add additional backing information to the SkTraceMemoryDump. Called by |
+ * onMemoryDump. The default implementation adds no backing information. |
+ **/ |
+ virtual void setMemoryBacking(SkTraceMemoryDump* traceMemoryDump, |
+ const SkString& dumpName) const {} |
+ |
private: |
/** |
* Frees the object in the underlying 3D API. Called by CacheAccess. |