| 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 SK_ATTR_DEPRECATED("SkGraphics::Term() is a no-op. We're in the middle of c
leaning it up.") | 26 /** |
| 27 static void Term() {} | 27 * Call this to release any memory held privately, such as the font cache. |
| 28 */ |
| 29 static void Term(); |
| 28 | 30 |
| 29 /** | 31 /** |
| 30 * Return the version numbers for the library. If the parameter is not | 32 * Return the version numbers for the library. If the parameter is not |
| 31 * null, it is set to the version number. | 33 * null, it is set to the version number. |
| 32 */ | 34 */ |
| 33 static void GetVersion(int32_t* major, int32_t* minor, int32_t* patch); | 35 static void GetVersion(int32_t* major, int32_t* minor, int32_t* patch); |
| 34 | 36 |
| 35 /** | 37 /** |
| 36 * Return the max number of bytes that should be used by the font cache. | 38 * Return the max number of bytes that should be used by the font cache. |
| 37 * If the cache needs to allocate more, it will purge previous entries. | 39 * 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... |
| 160 */ | 162 */ |
| 161 static ImageGeneratorFromEncodedFactory | 163 static ImageGeneratorFromEncodedFactory |
| 162 SetImageGeneratorFromEncodedFactory(ImageGeneratorFromEncodedFactory)
; | 164 SetImageGeneratorFromEncodedFactory(ImageGeneratorFromEncodedFactory)
; |
| 163 }; | 165 }; |
| 164 | 166 |
| 165 class SkAutoGraphics { | 167 class SkAutoGraphics { |
| 166 public: | 168 public: |
| 167 SkAutoGraphics() { | 169 SkAutoGraphics() { |
| 168 SkGraphics::Init(); | 170 SkGraphics::Init(); |
| 169 } | 171 } |
| 172 ~SkAutoGraphics() { |
| 173 SkGraphics::Term(); |
| 174 } |
| 170 }; | 175 }; |
| 171 | 176 |
| 172 #endif | 177 #endif |
| OLD | NEW |