Skia
2D Graphics Library
SkTraceMemoryDump.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 #ifndef SkTraceMemoryDump_DEFINED
9 #define SkTraceMemoryDump_DEFINED
10 
11 #include "include/core/SkTypes.h"
12 
13 class SkDiscardableMemory;
14 
21 public:
26  // Dump only the minimal details to get the total memory usage (Usually just the totals).
28 
29  // Dump the detailed breakdown of the objects in the caches.
30  kObjectsBreakdowns_LevelOfDetail
31  };
32 
48  virtual void dumpNumericValue(const char* dumpName,
49  const char* valueName,
50  const char* units,
51  uint64_t value) = 0;
52 
53  virtual void dumpStringValue(const char* /*dumpName*/,
54  const char* /*valueName*/,
55  const char* /*value*/) { }
56 
62  virtual void setMemoryBacking(const char* dumpName,
63  const char* backingType,
64  const char* backingObjectId) = 0;
65 
70  const char* dumpName,
71  const SkDiscardableMemory& discardableMemoryObject) = 0;
72 
78  virtual LevelOfDetail getRequestedDetails() const = 0;
79 
84  virtual bool shouldDumpWrappedObjects() const { return true; }
85 
86 protected:
87  virtual ~SkTraceMemoryDump() = default;
88  SkTraceMemoryDump() = default;
91 };
92 
93 #endif
SkTraceMemoryDump
Interface for memory tracing.
Definition: SkTraceMemoryDump.h:20
SkTypes.h
SkTraceMemoryDump::operator=
SkTraceMemoryDump & operator=(const SkTraceMemoryDump &)=delete
SkTraceMemoryDump::SkTraceMemoryDump
SkTraceMemoryDump()=default
SkTraceMemoryDump::getRequestedDetails
virtual LevelOfDetail getRequestedDetails() const =0
Returns the type of details requested in the dump.
SkTraceMemoryDump::shouldDumpWrappedObjects
virtual bool shouldDumpWrappedObjects() const
Returns true if we should dump wrapped objects.
Definition: SkTraceMemoryDump.h:84
SK_API
#define SK_API
Definition: SkTypes.h:181
SkTraceMemoryDump::setMemoryBacking
virtual void setMemoryBacking(const char *dumpName, const char *backingType, const char *backingObjectId)=0
Sets the memory backing for an existing dump.
SkTraceMemoryDump::setDiscardableMemoryBacking
virtual void setDiscardableMemoryBacking(const char *dumpName, const SkDiscardableMemory &discardableMemoryObject)=0
Specialization for memory backed by discardable memory.
SkTraceMemoryDump::dumpStringValue
virtual void dumpStringValue(const char *, const char *, const char *)
Definition: SkTraceMemoryDump.h:53
SkTraceMemoryDump::LevelOfDetail
LevelOfDetail
Enum to specify the level of the requested details for the dump from the Skia objects.
Definition: SkTraceMemoryDump.h:25
SkTraceMemoryDump::dumpNumericValue
virtual void dumpNumericValue(const char *dumpName, const char *valueName, const char *units, uint64_t value)=0
Appends a new memory dump (i.e.
SkTraceMemoryDump::SkTraceMemoryDump
SkTraceMemoryDump(const SkTraceMemoryDump &)=delete
SkTraceMemoryDump::kLight_LevelOfDetail
@ kLight_LevelOfDetail
Definition: SkTraceMemoryDump.h:27
SkTraceMemoryDump::~SkTraceMemoryDump
virtual ~SkTraceMemoryDump()=default