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 #ifndef SkGraphics_DEFINED | 8 #ifndef SkGraphics_DEFINED |
9 #define SkGraphics_DEFINED | 9 #define SkGraphics_DEFINED |
10 | 10 |
11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
12 | 12 |
13 class SkData; | 13 class SkData; |
14 class SkImageGenerator; | 14 class SkImageGenerator; |
15 class SkTraceMemoryDump; | 15 class SkTraceMemoryDump; |
16 | 16 |
17 class SK_API SkGraphics { | 17 class SK_API SkGraphics { |
18 public: | 18 public: |
19 /** | 19 /** |
20 * Call this at process initialization time if your environment does not | 20 * Call this at process initialization time if your environment does not |
21 * permit static global initializers that execute code. | 21 * permit static global initializers that execute code. |
22 * Init() is thread-safe and idempotent. | 22 * Init() is thread-safe and idempotent. |
23 */ | 23 */ |
24 static void Init(); | 24 static void Init(); |
25 | 25 |
26 /** | 26 // We're in the middle of cleaning this up. |
27 * Call this to release any memory held privately, such as the font cache. | 27 static void Term() {} |
28 */ | |
29 static void Term(); | |
30 | 28 |
31 /** | 29 /** |
32 * Return the version numbers for the library. If the parameter is not | 30 * Return the version numbers for the library. If the parameter is not |
33 * null, it is set to the version number. | 31 * null, it is set to the version number. |
34 */ | 32 */ |
35 static void GetVersion(int32_t* major, int32_t* minor, int32_t* patch); | 33 static void GetVersion(int32_t* major, int32_t* minor, int32_t* patch); |
36 | 34 |
37 /** | 35 /** |
38 * Return the max number of bytes that should be used by the font cache. | 36 * Return the max number of bytes that should be used by the font cache. |
39 * If the cache needs to allocate more, it will purge previous entries. | 37 * If the cache needs to allocate more, it will purge previous entries. |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 */ | 160 */ |
163 static ImageGeneratorFromEncodedFactory | 161 static ImageGeneratorFromEncodedFactory |
164 SetImageGeneratorFromEncodedFactory(ImageGeneratorFromEncodedFactory)
; | 162 SetImageGeneratorFromEncodedFactory(ImageGeneratorFromEncodedFactory)
; |
165 }; | 163 }; |
166 | 164 |
167 class SkAutoGraphics { | 165 class SkAutoGraphics { |
168 public: | 166 public: |
169 SkAutoGraphics() { | 167 SkAutoGraphics() { |
170 SkGraphics::Init(); | 168 SkGraphics::Init(); |
171 } | 169 } |
172 ~SkAutoGraphics() { | |
173 SkGraphics::Term(); | |
174 } | |
175 }; | 170 }; |
176 | 171 |
177 #endif | 172 #endif |
OLD | NEW |