Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(336)

Side by Side Diff: src/core/SkScaledImageCache.cpp

Issue 104433005: SkOnce: let f be any functor, update comments (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: tests SkOnceFlag was uninitialized Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/core/SkOnce.h ('k') | tests/OnceTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/core/SkOnce.h ('k') | tests/OnceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698