OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkTraceMemoryDump_DEFINED | 8 #ifndef SkTraceMemoryDump_DEFINED |
9 #define SkTraceMemoryDump_DEFINED | 9 #define SkTraceMemoryDump_DEFINED |
10 | 10 |
11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
12 | 12 |
13 class SkDiscardableMemory; | 13 class SkDiscardableMemory; |
14 | 14 |
15 /** | 15 /** |
16 * Interface for memory tracing. | 16 * Interface for memory tracing. |
17 * This interface is meant to be passed as argument to the memory dump methods o f Skia objects. | 17 * This interface is meant to be passed as argument to the memory dump methods o f Skia objects. |
18 * The implementation of this interface is provided by the embedder. | 18 * The implementation of this interface is provided by the embedder. |
19 */ | 19 */ |
20 class SK_API SkTraceMemoryDump { | 20 class SK_API SkTraceMemoryDump { |
21 public: | 21 public: |
22 /** | 22 /** |
23 * Enum to specify the level of the requested details for the dump from the Skia objects. | |
24 */ | |
25 enum LevelOfDetails { | |
26 // Dump only the minimal details to get the total memory usage (Usually just the totals). | |
27 kLightDumpRequest, | |
Primiano Tucci (use gerrit)
2015/09/24 13:10:27
Remove rquest from the name. Doesn't tell anything
ssid
2015/09/24 13:18:49
I didn't want to make it enum class. So, making it
| |
28 | |
29 // Dump all the details about the memory usage of the caches. | |
30 kDetailedDumpRequest | |
31 }; | |
32 | |
33 /** | |
23 * Appends a new memory dump (i.e. a row) to the trace memory infrastructur e. | 34 * Appends a new memory dump (i.e. a row) to the trace memory infrastructur e. |
24 * If dumpName does not exist yet, a new one is created. Otherwise, a new c olumn is appended to | 35 * If dumpName does not exist yet, a new one is created. Otherwise, a new c olumn is appended to |
25 * the previously created dump. | 36 * the previously created dump. |
26 * Arguments: | 37 * Arguments: |
27 * dumpName: an absolute, slash-separated, name for the item being dumped | 38 * dumpName: an absolute, slash-separated, name for the item being dumped |
28 * e.g., "skia/CacheX/EntryY". | 39 * e.g., "skia/CacheX/EntryY". |
29 * valueName: a string indicating the name of the column. | 40 * valueName: a string indicating the name of the column. |
30 * e.g., "size", "active_size", "number_of_objects". | 41 * e.g., "size", "active_size", "number_of_objects". |
31 * This string is supposed to be long lived and is NOT copied. | 42 * This string is supposed to be long lived and is NOT copied. |
32 * units: a string indicating the units for the value. | 43 * units: a string indicating the units for the value. |
(...skipping 15 matching lines...) Expand all Loading... | |
48 const char* backingType, | 59 const char* backingType, |
49 const char* backingObjectId) = 0; | 60 const char* backingObjectId) = 0; |
50 | 61 |
51 /** | 62 /** |
52 * Specialization for memory backed by discardable memory. | 63 * Specialization for memory backed by discardable memory. |
53 */ | 64 */ |
54 virtual void setDiscardableMemoryBacking( | 65 virtual void setDiscardableMemoryBacking( |
55 const char* dumpName, | 66 const char* dumpName, |
56 const SkDiscardableMemory& discardableMemoryObject) = 0; | 67 const SkDiscardableMemory& discardableMemoryObject) = 0; |
57 | 68 |
69 /** | |
70 * Returns the type of details requested in the dump. The skia objects are e xpected to dump | |
Primiano Tucci (use gerrit)
2015/09/24 13:10:27
THis is a bit difficult to read, but the content i
ssid
2015/09/24 13:18:49
Done.
| |
71 * according to the LevelOfDetails requested and at the same time dump a con sistent total usage | |
72 * across multiple dump requests. Only the detailed information about memory usage can vary. | |
73 */ | |
74 virtual LevelOfDetails getRequestedDetails() const = 0; | |
75 | |
58 protected: | 76 protected: |
59 virtual ~SkTraceMemoryDump() { } | 77 virtual ~SkTraceMemoryDump() { } |
60 }; | 78 }; |
61 | 79 |
62 #endif | 80 #endif |
OLD | NEW |