OLD | NEW |
---|---|
(Empty) | |
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 "SkTypes.h" | |
12 | |
13 class SkDiscardableMemory; | |
14 class SkString; | |
reed1
2015/08/20 14:40:48
unneeded
Primiano Tucci (use gerrit)
2015/08/20 14:44:23
Oh good catch. done.
| |
15 | |
16 /** | |
17 * Interface for memory tracing. | |
18 * This interface is meant to be passed as argument to the memory dump methods o f Skia objects. | |
19 * The implementation of this interface is provided by the embedder. | |
20 */ | |
21 class SK_API SkTraceMemoryDump { | |
22 public: | |
23 /** | |
24 * Appends a new memory dump (i.e. a row) to the trace memory infrastructur e. | |
25 * If dumpName does not exist yet, a new one is created. Otherwise, a new c olumn is appended to | |
26 * the previously created dump. | |
27 * Arguments: | |
28 * dumpName: an absolute, slash-separated, name for the item being dumped | |
29 * e.g., "skia/CacheX/EntryY". | |
30 * valueName: a string indicating the name of the column. | |
31 * e.g., "size", "active_size", "number_of_objects". | |
32 * This string is supposed to be long lived and is NOT copied. | |
33 * units: a string indicating the units for the scalar. | |
34 * e.g., "bytes", "objects". | |
35 * This string is supposed to be long lived and is NOT copied. | |
36 * value: the actual value being dumped. | |
37 */ | |
38 virtual void dumpScalarValue(const char* dumpName, | |
reed1
2015/08/20 14:40:48
trival nit:
Skia uses the word Scalar very specif
Primiano Tucci (use gerrit)
2015/08/20 14:44:23
Oh I see. dumpNumericValue SGTM
| |
39 const char* valueName, | |
40 const char* units, | |
41 uint64_t value) = 0; | |
42 | |
43 /** | |
44 * Sets the memory backing for an existing dump. | |
45 * backingType and backingObjectId are used by the embedder to associate the memory dumped via | |
46 * DumpScalarValue with the corresponding dump that backs the memory. | |
47 */ | |
48 virtual void setMemoryBacking(const char* dumpName, | |
49 const char* backingType, | |
50 const char* backingObjectId) = 0; | |
51 | |
52 /** | |
53 * Specialization for memory backed by discardable memory. | |
54 */ | |
55 virtual void setDiscardableMemoryBacking( | |
56 const char* dumpName, | |
57 const SkDiscardableMemory& discardableMemoryObject) = 0; | |
58 | |
59 protected: | |
60 virtual ~SkTraceMemoryDump() { } | |
61 }; | |
62 | |
63 #endif | |
OLD | NEW |