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

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

Issue 471473002: Optimize CSS box-shadow performance (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add SkMaskCache Created 6 years, 4 months 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
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 "SkChecksum.h" 8 #include "SkChecksum.h"
9 #include "SkScaledImageCache.h" 9 #include "SkScaledImageCache.h"
10 #include "SkMipMap.h" 10 #include "SkMipMap.h"
11 #include "SkPixelRef.h" 11 #include "SkPixelRef.h"
12 #include "SkRect.h"
reed1 2014/08/25 11:58:42 nit: we can land this change separately.
qiankun 2014/08/26 08:36:33 Done.
13 12
14 // This can be defined by the caller's build system 13 // This can be defined by the caller's build system
15 //#define SK_USE_DISCARDABLE_SCALEDIMAGECACHE 14 //#define SK_USE_DISCARDABLE_SCALEDIMAGECACHE
16 15
17 #ifndef SK_DISCARDABLEMEMORY_SCALEDIMAGECACHE_COUNT_LIMIT 16 #ifndef SK_DISCARDABLEMEMORY_SCALEDIMAGECACHE_COUNT_LIMIT
18 # define SK_DISCARDABLEMEMORY_SCALEDIMAGECACHE_COUNT_LIMIT 1024 17 # define SK_DISCARDABLEMEMORY_SCALEDIMAGECACHE_COUNT_LIMIT 1024
19 #endif 18 #endif
20 19
21 #ifndef SK_DEFAULT_IMAGE_CACHE_LIMIT 20 #ifndef SK_DEFAULT_IMAGE_CACHE_LIMIT
22 #define SK_DEFAULT_IMAGE_CACHE_LIMIT (2 * 1024 * 1024) 21 #define SK_DEFAULT_IMAGE_CACHE_LIMIT (2 * 1024 * 1024)
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 89
91 /////////////////////////////////////////////////////////////////////////////// 90 ///////////////////////////////////////////////////////////////////////////////
92 91
93 // experimental hash to speed things up 92 // experimental hash to speed things up
94 #define USE_HASH 93 #define USE_HASH
95 94
96 #if !defined(USE_HASH) 95 #if !defined(USE_HASH)
97 static inline SkScaledImageCache::Rec* find_rec_in_list( 96 static inline SkScaledImageCache::Rec* find_rec_in_list(
98 SkScaledImageCache::Rec* head, const Key & key) { 97 SkScaledImageCache::Rec* head, const Key & key) {
99 SkScaledImageCache::Rec* rec = head; 98 SkScaledImageCache::Rec* rec = head;
100 while ((rec != NULL) && (rec->fKey != key)) { 99 while ((rec != NULL) && (*rec->fKey != key)) {
101 rec = rec->fNext; 100 rec = rec->fNext;
102 } 101 }
103 return rec; 102 return rec;
104 } 103 }
105 #endif 104 #endif
106 105
107 void SkScaledImageCache::init() { 106 void SkScaledImageCache::init() {
108 fHead = NULL; 107 fHead = NULL;
109 fTail = NULL; 108 fTail = NULL;
110 #ifdef USE_HASH 109 #ifdef USE_HASH
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 } 654 }
656 655
657 size_t SkGraphics::GetImageCacheSingleAllocationByteLimit() { 656 size_t SkGraphics::GetImageCacheSingleAllocationByteLimit() {
658 return SkScaledImageCache::GetSingleAllocationByteLimit(); 657 return SkScaledImageCache::GetSingleAllocationByteLimit();
659 } 658 }
660 659
661 size_t SkGraphics::SetImageCacheSingleAllocationByteLimit(size_t newLimit) { 660 size_t SkGraphics::SetImageCacheSingleAllocationByteLimit(size_t newLimit) {
662 return SkScaledImageCache::SetSingleAllocationByteLimit(newLimit); 661 return SkScaledImageCache::SetSingleAllocationByteLimit(newLimit);
663 } 662 }
664 663
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698