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

Side by Side Diff: tests/ImageCacheTest.cpp

Issue 22571010: SkTDynamicHash: support remove() without needing Deleted(). (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: tweaks 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 | « tests/DynamicHashTest.cpp ('k') | 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 "Test.h" 8 #include "Test.h"
9 #include "SkScaledImageCache.h" 9 #include "SkScaledImageCache.h"
10 10
(...skipping 30 matching lines...) Expand all
41 REPORTER_ASSERT(reporter, tmp.pixelRef() == tmp2.pixelRef()); 41 REPORTER_ASSERT(reporter, tmp.pixelRef() == tmp2.pixelRef());
42 REPORTER_ASSERT(reporter, tmp.width() == tmp2.width()); 42 REPORTER_ASSERT(reporter, tmp.width() == tmp2.width());
43 REPORTER_ASSERT(reporter, tmp.height() == tmp2.height()); 43 REPORTER_ASSERT(reporter, tmp.height() == tmp2.height());
44 cache.unlock(id2); 44 cache.unlock(id2);
45 45
46 cache.unlock(id); 46 cache.unlock(id);
47 } 47 }
48 48
49 // stress test, should trigger purges 49 // stress test, should trigger purges
50 for (size_t i = 0; i < COUNT * 100; ++i) { 50 for (size_t i = 0; i < COUNT * 100; ++i) {
51 scale += 1;
52
51 SkBitmap tmp; 53 SkBitmap tmp;
52 54
53 make_bm(&tmp, DIM, DIM); 55 make_bm(&tmp, DIM, DIM);
54 id = cache.addAndLock(bm[0], scale, scale, tmp); 56 id = cache.addAndLock(bm[0], scale, scale, tmp);
55 REPORTER_ASSERT(reporter, NULL != id); 57 REPORTER_ASSERT(reporter, NULL != id);
56 cache.unlock(id); 58 cache.unlock(id);
57
58 scale += 1;
59 } 59 }
60 60
61 cache.setByteLimit(0); 61 cache.setByteLimit(0);
62 } 62 }
63 63
64 #include "TestClassDef.h" 64 #include "TestClassDef.h"
65 DEFINE_TESTCLASS("ImageCache", TestImageCacheClass, TestImageCache) 65 DEFINE_TESTCLASS("ImageCache", TestImageCacheClass, TestImageCache)
OLDNEW
« no previous file with comments | « tests/DynamicHashTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698