OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #include "SkScaledImageCache.h" | 8 #include "SkScaledImageCache.h" |
9 #include "SkMipMap.h" | 9 #include "SkMipMap.h" |
10 #include "SkOnce.h" | 10 #include "SkOnce.h" |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 | 512 |
513 SK_DECLARE_STATIC_MUTEX(gMutex); | 513 SK_DECLARE_STATIC_MUTEX(gMutex); |
514 | 514 |
515 static void create_cache(SkScaledImageCache** cache) { | 515 static void create_cache(SkScaledImageCache** cache) { |
516 *cache = SkNEW_ARGS(SkScaledImageCache, (SK_DEFAULT_IMAGE_CACHE_LIMIT)); | 516 *cache = SkNEW_ARGS(SkScaledImageCache, (SK_DEFAULT_IMAGE_CACHE_LIMIT)); |
517 } | 517 } |
518 | 518 |
519 static SkScaledImageCache* get_cache() { | 519 static SkScaledImageCache* get_cache() { |
520 static SkScaledImageCache* gCache(NULL); | 520 static SkScaledImageCache* gCache(NULL); |
521 SK_DECLARE_STATIC_ONCE(create_cache_once); | 521 SK_DECLARE_STATIC_ONCE(create_cache_once); |
522 SkOnce<SkScaledImageCache**>(&create_cache_once, create_cache, &gCache); | 522 SkOnce(&create_cache_once, create_cache, &gCache); |
523 SkASSERT(NULL != gCache); | 523 SkASSERT(NULL != gCache); |
524 return gCache; | 524 return gCache; |
525 } | 525 } |
526 | 526 |
527 | 527 |
528 SkScaledImageCache::ID* SkScaledImageCache::FindAndLock( | 528 SkScaledImageCache::ID* SkScaledImageCache::FindAndLock( |
529 uint32_t pixelGenerationID, | 529 uint32_t pixelGenerationID, |
530 int32_t width, | 530 int32_t width, |
531 int32_t height, | 531 int32_t height, |
532 SkBitmap* scaled) { | 532 SkBitmap* scaled) { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 return SkScaledImageCache::GetBytesUsed(); | 600 return SkScaledImageCache::GetBytesUsed(); |
601 } | 601 } |
602 | 602 |
603 size_t SkGraphics::GetImageCacheByteLimit() { | 603 size_t SkGraphics::GetImageCacheByteLimit() { |
604 return SkScaledImageCache::GetByteLimit(); | 604 return SkScaledImageCache::GetByteLimit(); |
605 } | 605 } |
606 | 606 |
607 size_t SkGraphics::SetImageCacheByteLimit(size_t newLimit) { | 607 size_t SkGraphics::SetImageCacheByteLimit(size_t newLimit) { |
608 return SkScaledImageCache::SetByteLimit(newLimit); | 608 return SkScaledImageCache::SetByteLimit(newLimit); |
609 } | 609 } |
OLD | NEW |