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

Side by Side Diff: bench/GrResourceCacheBench.cpp

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
Patch Set: rebase Created 6 years, 3 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
« no previous file with comments | « bench/ETCBitmapBench.cpp ('k') | bench/HairlinePathBench.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 /* 2 /*
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #if SK_SUPPORT_GPU 9 #if SK_SUPPORT_GPU
10 10
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 } 139 }
140 } 140 }
141 141
142 // Benchmark also find calls that always fail. 142 // Benchmark also find calls that always fail.
143 { 143 {
144 GrTextureDesc desc; 144 GrTextureDesc desc;
145 get_texture_desc(k, &desc); 145 get_texture_desc(k, &desc);
146 desc.fHeight |= 1; 146 desc.fHeight |= 1;
147 GrResourceKey key = TextureResource::ComputeKey(desc); 147 GrResourceKey key = TextureResource::ComputeKey(desc);
148 GrGpuResource* item = cache->find(key); 148 GrGpuResource* item = cache->find(key);
149 if (NULL != item) { 149 if (item) {
150 SkFAIL("cache add does not work as expected"); 150 SkFAIL("cache add does not work as expected");
151 return; 151 return;
152 } 152 }
153 } 153 }
154 { 154 {
155 int w, h, s; 155 int w, h, s;
156 get_stencil(k, &w, &h, &s); 156 get_stencil(k, &w, &h, &s);
157 h |= 1; 157 h |= 1;
158 GrResourceKey key = StencilResource::ComputeKey(w, h, s); 158 GrResourceKey key = StencilResource::ComputeKey(w, h, s);
159 GrGpuResource* item = cache->find(key); 159 GrGpuResource* item = cache->find(key);
160 if (NULL != item) { 160 if (item) {
161 SkFAIL("cache add does not work as expected"); 161 SkFAIL("cache add does not work as expected");
162 return; 162 return;
163 } 163 }
164 } 164 }
165 } 165 }
166 166
167 class GrResourceCacheBenchAdd : public Benchmark { 167 class GrResourceCacheBenchAdd : public Benchmark {
168 enum { 168 enum {
169 RESOURCE_COUNT = CACHE_SIZE_COUNT / 2, 169 RESOURCE_COUNT = CACHE_SIZE_COUNT / 2,
170 DUPLICATE_COUNT = CACHE_SIZE_COUNT / 4, 170 DUPLICATE_COUNT = CACHE_SIZE_COUNT / 4,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 } 230 }
231 231
232 private: 232 private:
233 typedef Benchmark INHERITED; 233 typedef Benchmark INHERITED;
234 }; 234 };
235 235
236 DEF_BENCH( return new GrResourceCacheBenchAdd(); ) 236 DEF_BENCH( return new GrResourceCacheBenchAdd(); )
237 DEF_BENCH( return new GrResourceCacheBenchFind(); ) 237 DEF_BENCH( return new GrResourceCacheBenchFind(); )
238 238
239 #endif 239 #endif
OLDNEW
« no previous file with comments | « bench/ETCBitmapBench.cpp ('k') | bench/HairlinePathBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698