| 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 "SkGlyphCache.h" | 
|  | 16 #include "SkImageFilter.h" | 
| 16 #include "SkMath.h" | 17 #include "SkMath.h" | 
| 17 #include "SkMatrix.h" | 18 #include "SkMatrix.h" | 
| 18 #include "SkOpts.h" | 19 #include "SkOpts.h" | 
| 19 #include "SkPath.h" | 20 #include "SkPath.h" | 
| 20 #include "SkPathEffect.h" | 21 #include "SkPathEffect.h" | 
| 21 #include "SkPixelRef.h" | 22 #include "SkPixelRef.h" | 
| 22 #include "SkRefCnt.h" | 23 #include "SkRefCnt.h" | 
| 23 #include "SkResourceCache.h" | 24 #include "SkResourceCache.h" | 
| 24 #include "SkRTConf.h" | 25 #include "SkRTConf.h" | 
| 25 #include "SkScalerContext.h" | 26 #include "SkScalerContext.h" | 
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 58 #endif | 59 #endif | 
| 59 } | 60 } | 
| 60 | 61 | 
| 61 /////////////////////////////////////////////////////////////////////////////// | 62 /////////////////////////////////////////////////////////////////////////////// | 
| 62 | 63 | 
| 63 void SkGraphics::DumpMemoryStatistics(SkTraceMemoryDump* dump) { | 64 void SkGraphics::DumpMemoryStatistics(SkTraceMemoryDump* dump) { | 
| 64   SkResourceCache::DumpMemoryStatistics(dump); | 65   SkResourceCache::DumpMemoryStatistics(dump); | 
| 65   SkGlyphCache::DumpMemoryStatistics(dump); | 66   SkGlyphCache::DumpMemoryStatistics(dump); | 
| 66 } | 67 } | 
| 67 | 68 | 
|  | 69 void SkGraphics::PurgeAllCaches() { | 
|  | 70     SkGraphics::PurgeFontCache(); | 
|  | 71     SkGraphics::PurgeResourceCache(); | 
|  | 72     SkImageFilter::PurgeCache(); | 
|  | 73 } | 
|  | 74 | 
| 68 /////////////////////////////////////////////////////////////////////////////// | 75 /////////////////////////////////////////////////////////////////////////////// | 
| 69 | 76 | 
| 70 static const char kFontCacheLimitStr[] = "font-cache-limit"; | 77 static const char kFontCacheLimitStr[] = "font-cache-limit"; | 
| 71 static const size_t kFontCacheLimitLen = sizeof(kFontCacheLimitStr) - 1; | 78 static const size_t kFontCacheLimitLen = sizeof(kFontCacheLimitStr) - 1; | 
| 72 | 79 | 
| 73 static const struct { | 80 static const struct { | 
| 74     const char* fStr; | 81     const char* fStr; | 
| 75     size_t fLen; | 82     size_t fLen; | 
| 76     size_t (*fFunc)(size_t); | 83     size_t (*fFunc)(size_t); | 
| 77 } gFlags[] = { | 84 } gFlags[] = { | 
| (...skipping 27 matching lines...) Expand all  Loading... | 
| 105                 if (nextEqual) { | 112                 if (nextEqual) { | 
| 106                     val = (size_t) atoi(nextEqual + 1); | 113                     val = (size_t) atoi(nextEqual + 1); | 
| 107                 } | 114                 } | 
| 108                 (gFlags[i].fFunc)(val); | 115                 (gFlags[i].fFunc)(val); | 
| 109                 break; | 116                 break; | 
| 110             } | 117             } | 
| 111         } | 118         } | 
| 112         flags = nextSemi + 1; | 119         flags = nextSemi + 1; | 
| 113     } while (nextSemi); | 120     } while (nextSemi); | 
| 114 } | 121 } | 
| OLD | NEW | 
|---|