OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 | 8 |
9 #include "SkGraphics.h" | 9 #include "SkGraphics.h" |
10 | 10 |
11 #include "SkBlitter.h" | 11 #include "SkBlitter.h" |
12 #include "SkCanvas.h" | 12 #include "SkCanvas.h" |
13 #include "SkCpu.h" | 13 #include "SkCpu.h" |
14 #include "SkGeometry.h" | 14 #include "SkGeometry.h" |
15 #include "SkGlyphCache.h" | 15 #include "SkGlyphCache.h" |
16 #include "SkImageFilter.h" | 16 #include "SkImageFilter.h" |
17 #include "SkMath.h" | 17 #include "SkMath.h" |
18 #include "SkMatrix.h" | 18 #include "SkMatrix.h" |
19 #include "SkOpts.h" | 19 #include "SkOpts.h" |
20 #include "SkPath.h" | 20 #include "SkPath.h" |
21 #include "SkPathEffect.h" | 21 #include "SkPathEffect.h" |
22 #include "SkPixelRef.h" | 22 #include "SkPixelRef.h" |
23 #include "SkRefCnt.h" | 23 #include "SkRefCnt.h" |
24 #include "SkResourceCache.h" | 24 #include "SkResourceCache.h" |
25 #include "SkRTConf.h" | |
26 #include "SkScalerContext.h" | 25 #include "SkScalerContext.h" |
27 #include "SkShader.h" | 26 #include "SkShader.h" |
28 #include "SkStream.h" | 27 #include "SkStream.h" |
29 #include "SkTSearch.h" | 28 #include "SkTSearch.h" |
30 #include "SkTime.h" | 29 #include "SkTime.h" |
31 #include "SkUtils.h" | 30 #include "SkUtils.h" |
32 #include "SkXfermode.h" | 31 #include "SkXfermode.h" |
33 | 32 |
34 #include <stdlib.h> | 33 #include <stdlib.h> |
35 | 34 |
36 void SkGraphics::GetVersion(int32_t* major, int32_t* minor, int32_t* patch) { | 35 void SkGraphics::GetVersion(int32_t* major, int32_t* minor, int32_t* patch) { |
37 if (major) { | 36 if (major) { |
38 *major = SKIA_VERSION_MAJOR; | 37 *major = SKIA_VERSION_MAJOR; |
39 } | 38 } |
40 if (minor) { | 39 if (minor) { |
41 *minor = SKIA_VERSION_MINOR; | 40 *minor = SKIA_VERSION_MINOR; |
42 } | 41 } |
43 if (patch) { | 42 if (patch) { |
44 *patch = SKIA_VERSION_PATCH; | 43 *patch = SKIA_VERSION_PATCH; |
45 } | 44 } |
46 } | 45 } |
47 | 46 |
48 void SkGraphics::Init() { | 47 void SkGraphics::Init() { |
49 // SkGraphics::Init() must be thread-safe and idempotent. | 48 // SkGraphics::Init() must be thread-safe and idempotent. |
50 SkCpu::CacheRuntimeFeatures(); | 49 SkCpu::CacheRuntimeFeatures(); |
51 SkOpts::Init(); | 50 SkOpts::Init(); |
52 | |
53 #ifdef SK_DEBUG | |
54 skRTConfRegistry().possiblyDumpFile(); | |
55 skRTConfRegistry().validate(); | |
56 if (skRTConfRegistry().hasNonDefault()) { | |
57 SkDebugf("Non-default runtime configuration options:\n"); | |
58 skRTConfRegistry().printNonDefault(); | |
59 } | |
60 #endif | |
61 } | 51 } |
62 | 52 |
63 /////////////////////////////////////////////////////////////////////////////// | 53 /////////////////////////////////////////////////////////////////////////////// |
64 | 54 |
65 void SkGraphics::DumpMemoryStatistics(SkTraceMemoryDump* dump) { | 55 void SkGraphics::DumpMemoryStatistics(SkTraceMemoryDump* dump) { |
66 SkResourceCache::DumpMemoryStatistics(dump); | 56 SkResourceCache::DumpMemoryStatistics(dump); |
67 SkGlyphCache::DumpMemoryStatistics(dump); | 57 SkGlyphCache::DumpMemoryStatistics(dump); |
68 } | 58 } |
69 | 59 |
70 void SkGraphics::PurgeAllCaches() { | 60 void SkGraphics::PurgeAllCaches() { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 if (nextEqual) { | 103 if (nextEqual) { |
114 val = (size_t) atoi(nextEqual + 1); | 104 val = (size_t) atoi(nextEqual + 1); |
115 } | 105 } |
116 (gFlags[i].fFunc)(val); | 106 (gFlags[i].fFunc)(val); |
117 break; | 107 break; |
118 } | 108 } |
119 } | 109 } |
120 flags = nextSemi + 1; | 110 flags = nextSemi + 1; |
121 } while (nextSemi); | 111 } while (nextSemi); |
122 } | 112 } |
OLD | NEW |