Chromium Code Reviews| 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 #ifndef SkGraphics_DEFINED | 10 #ifndef SkGraphics_DEFINED |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 * does not change the limit, but will cause subsequent font measures and | 77 * does not change the limit, but will cause subsequent font measures and |
| 78 * draws to be recreated, since they will no longer be in the cache. | 78 * draws to be recreated, since they will no longer be in the cache. |
| 79 */ | 79 */ |
| 80 static void PurgeFontCache(); | 80 static void PurgeFontCache(); |
| 81 | 81 |
| 82 static size_t GetImageCacheBytesUsed(); | 82 static size_t GetImageCacheBytesUsed(); |
| 83 static size_t GetImageCacheByteLimit(); | 83 static size_t GetImageCacheByteLimit(); |
| 84 static size_t SetImageCacheByteLimit(size_t newLimit); | 84 static size_t SetImageCacheByteLimit(size_t newLimit); |
| 85 | 85 |
| 86 /** | 86 /** |
| 87 * Scaling bitmaps with the SkPaint::kHigh_FilterLevel setting is | |
| 88 * expensive, so the result is saved in the global Scaled Image | |
| 89 * Cache. When the resulting bitmap is too large, this can | |
| 90 * overload the cache. If the ImageCacheSingleAllocationByteLimit | |
| 91 * is set to a non-zero number, and the resulting bitmap would be | |
| 92 * larger than that value, the bitmap scaling algorithm falls | |
| 93 * back onto a cheaper algorithm and does not cache the result. | |
| 94 * Zero is the default value. | |
| 95 */ | |
| 96 static size_t GetImageCacheSingleAllocationByteLimit(); | |
| 97 static size_t SetImageCacheSingleAllocationByteLimit(size_t newLimit); | |
|
reveman
2014/07/16 20:38:04
I know this only affects pre-scaling of images and
| |
| 98 | |
| 99 /** | |
| 87 * Applications with command line options may pass optional state, such | 100 * Applications with command line options may pass optional state, such |
| 88 * as cache sizes, here, for instance: | 101 * as cache sizes, here, for instance: |
| 89 * font-cache-limit=12345678 | 102 * font-cache-limit=12345678 |
| 90 * | 103 * |
| 91 * The flags format is name=value[;name=value...] with no spaces. | 104 * The flags format is name=value[;name=value...] with no spaces. |
| 92 * This format is subject to change. | 105 * This format is subject to change. |
| 93 */ | 106 */ |
| 94 static void SetFlags(const char* flags); | 107 static void SetFlags(const char* flags); |
| 95 | 108 |
| 96 /** | 109 /** |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 125 public: | 138 public: |
| 126 SkAutoGraphics() { | 139 SkAutoGraphics() { |
| 127 SkGraphics::Init(); | 140 SkGraphics::Init(); |
| 128 } | 141 } |
| 129 ~SkAutoGraphics() { | 142 ~SkAutoGraphics() { |
| 130 SkGraphics::Term(); | 143 SkGraphics::Term(); |
| 131 } | 144 } |
| 132 }; | 145 }; |
| 133 | 146 |
| 134 #endif | 147 #endif |
| OLD | NEW |