| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 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 SkBitmapCache_DEFINED | 8 #ifndef SkBitmapCache_DEFINED |
| 9 #define SkBitmapCache_DEFINED | 9 #define SkBitmapCache_DEFINED |
| 10 | 10 |
| 11 #include "SkScalar.h" | 11 #include "SkScalar.h" |
| 12 #include "SkBitmap.h" | 12 #include "SkBitmap.h" |
| 13 | 13 |
| 14 class SkResourceCache; | 14 class SkResourceCache; |
| 15 class SkMipMap; | 15 class SkMipMap; |
| 16 | 16 |
| 17 uint64_t SkMakeResourceCacheSharedIDForBitmap(uint32_t bitmapGenID); |
| 18 |
| 19 void SkNotifyBitmapGenIDIsStale(uint32_t bitmapGenID); |
| 20 |
| 17 class SkBitmapCache { | 21 class SkBitmapCache { |
| 18 public: | 22 public: |
| 19 /** | 23 /** |
| 20 * Use this allocator for bitmaps, so they can use ashmem when available. | 24 * Use this allocator for bitmaps, so they can use ashmem when available. |
| 21 * Returns NULL if the ResourceCache has not been initialized with a Discard
ableFactory. | 25 * Returns NULL if the ResourceCache has not been initialized with a Discard
ableFactory. |
| 22 */ | 26 */ |
| 23 static SkBitmap::Allocator* GetAllocator(); | 27 static SkBitmap::Allocator* GetAllocator(); |
| 24 | 28 |
| 25 /** | 29 /** |
| 26 * Search based on the src bitmap and inverse scales in X and Y. If found,
returns true and | 30 * Search based on the src bitmap and inverse scales in X and Y. If found,
returns true and |
| (...skipping 23 matching lines...) Expand all Loading... |
| 50 SkResourceCache* localCache = NULL); | 54 SkResourceCache* localCache = NULL); |
| 51 }; | 55 }; |
| 52 | 56 |
| 53 class SkMipMapCache { | 57 class SkMipMapCache { |
| 54 public: | 58 public: |
| 55 static const SkMipMap* FindAndRef(const SkBitmap& src, SkResourceCache* loca
lCache = NULL); | 59 static const SkMipMap* FindAndRef(const SkBitmap& src, SkResourceCache* loca
lCache = NULL); |
| 56 static const SkMipMap* AddAndRef(const SkBitmap& src, SkResourceCache* local
Cache = NULL); | 60 static const SkMipMap* AddAndRef(const SkBitmap& src, SkResourceCache* local
Cache = NULL); |
| 57 }; | 61 }; |
| 58 | 62 |
| 59 #endif | 63 #endif |
| OLD | NEW |