OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "SkGraphics.h" | 10 #include "SkGraphics.h" |
11 | 11 |
12 #include "SkBlitter.h" | 12 #include "SkBlitter.h" |
13 #include "SkCanvas.h" | 13 #include "SkCanvas.h" |
14 #include "SkGeometry.h" | 14 #include "SkGeometry.h" |
| 15 #include "SkGlyphCache.h" |
15 #include "SkMath.h" | 16 #include "SkMath.h" |
16 #include "SkMatrix.h" | 17 #include "SkMatrix.h" |
17 #include "SkOpts.h" | 18 #include "SkOpts.h" |
18 #include "SkPath.h" | 19 #include "SkPath.h" |
19 #include "SkPathEffect.h" | 20 #include "SkPathEffect.h" |
20 #include "SkPixelRef.h" | 21 #include "SkPixelRef.h" |
21 #include "SkRefCnt.h" | 22 #include "SkRefCnt.h" |
| 23 #include "SkResourceCache.h" |
22 #include "SkRTConf.h" | 24 #include "SkRTConf.h" |
23 #include "SkScalerContext.h" | 25 #include "SkScalerContext.h" |
24 #include "SkShader.h" | 26 #include "SkShader.h" |
25 #include "SkStream.h" | 27 #include "SkStream.h" |
26 #include "SkTSearch.h" | 28 #include "SkTSearch.h" |
27 #include "SkTime.h" | 29 #include "SkTime.h" |
28 #include "SkUtils.h" | 30 #include "SkUtils.h" |
29 #include "SkXfermode.h" | 31 #include "SkXfermode.h" |
30 | 32 |
31 #include <stdlib.h> | 33 #include <stdlib.h> |
(...skipping 25 matching lines...) Expand all Loading... |
57 } | 59 } |
58 | 60 |
59 void SkGraphics::Term() { | 61 void SkGraphics::Term() { |
60 PurgeFontCache(); | 62 PurgeFontCache(); |
61 PurgeResourceCache(); | 63 PurgeResourceCache(); |
62 SkPaint::Term(); | 64 SkPaint::Term(); |
63 } | 65 } |
64 | 66 |
65 /////////////////////////////////////////////////////////////////////////////// | 67 /////////////////////////////////////////////////////////////////////////////// |
66 | 68 |
| 69 void SkGraphics::DumpMemoryStatistics(SkTraceMemoryDump* dump) { |
| 70 SkResourceCache::DumpMemoryStatistics(dump); |
| 71 SkGlyphCache::DumpMemoryStatistics(dump); |
| 72 } |
| 73 |
| 74 /////////////////////////////////////////////////////////////////////////////// |
| 75 |
67 static const char kFontCacheLimitStr[] = "font-cache-limit"; | 76 static const char kFontCacheLimitStr[] = "font-cache-limit"; |
68 static const size_t kFontCacheLimitLen = sizeof(kFontCacheLimitStr) - 1; | 77 static const size_t kFontCacheLimitLen = sizeof(kFontCacheLimitStr) - 1; |
69 | 78 |
70 static const struct { | 79 static const struct { |
71 const char* fStr; | 80 const char* fStr; |
72 size_t fLen; | 81 size_t fLen; |
73 size_t (*fFunc)(size_t); | 82 size_t (*fFunc)(size_t); |
74 } gFlags[] = { | 83 } gFlags[] = { |
75 { kFontCacheLimitStr, kFontCacheLimitLen, SkGraphics::SetFontCacheLimit } | 84 { kFontCacheLimitStr, kFontCacheLimitLen, SkGraphics::SetFontCacheLimit } |
76 }; | 85 }; |
(...skipping 25 matching lines...) Expand all Loading... |
102 if (nextEqual) { | 111 if (nextEqual) { |
103 val = (size_t) atoi(nextEqual + 1); | 112 val = (size_t) atoi(nextEqual + 1); |
104 } | 113 } |
105 (gFlags[i].fFunc)(val); | 114 (gFlags[i].fFunc)(val); |
106 break; | 115 break; |
107 } | 116 } |
108 } | 117 } |
109 flags = nextSemi + 1; | 118 flags = nextSemi + 1; |
110 } while (nextSemi); | 119 } while (nextSemi); |
111 } | 120 } |
OLD | NEW |