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

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

Issue 20378002: experimentally enable USE_HASH for scaledimagecache (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 "SkPixelRef.h" 10 #include "SkPixelRef.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 } 143 }
144 } 144 }
145 145
146 class SkScaledImageCache::Hash : public SkTDynamicHash<SkScaledImageCache::Rec, 146 class SkScaledImageCache::Hash : public SkTDynamicHash<SkScaledImageCache::Rec,
147 Key, key_from_rec, hash_from_key, 147 Key, key_from_rec, hash_from_key,
148 eq_rec_key> {}; 148 eq_rec_key> {};
149 149
150 /////////////////////////////////////////////////////////////////////////////// 150 ///////////////////////////////////////////////////////////////////////////////
151 151
152 // experimental hash to speed things up 152 // experimental hash to speed things up
153 //#define USE_HASH 153 #define USE_HASH
154 154
155 SkScaledImageCache::SkScaledImageCache(size_t byteLimit) { 155 SkScaledImageCache::SkScaledImageCache(size_t byteLimit) {
156 fHead = NULL; 156 fHead = NULL;
157 fTail = NULL; 157 fTail = NULL;
158 #ifdef USE_HASH 158 #ifdef USE_HASH
159 fHash = new Hash; 159 fHash = new Hash;
160 #else 160 #else
161 fHash = NULL; 161 fHash = NULL;
162 #endif 162 #endif
163 fBytesUsed = 0; 163 fBytesUsed = 0;
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 return SkScaledImageCache::GetBytesUsed(); 516 return SkScaledImageCache::GetBytesUsed();
517 } 517 }
518 518
519 size_t SkGraphics::GetImageCacheByteLimit() { 519 size_t SkGraphics::GetImageCacheByteLimit() {
520 return SkScaledImageCache::GetByteLimit(); 520 return SkScaledImageCache::GetByteLimit();
521 } 521 }
522 522
523 size_t SkGraphics::SetImageCacheByteLimit(size_t newLimit) { 523 size_t SkGraphics::SetImageCacheByteLimit(size_t newLimit) {
524 return SkScaledImageCache::SetByteLimit(newLimit); 524 return SkScaledImageCache::SetByteLimit(newLimit);
525 } 525 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698