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

Side by Side Diff: bench/ETCBitmapBench.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/ChartBench.cpp ('k') | bench/GrResourceCacheBench.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 2014 Google Inc. 2 * Copyright 2014 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 "Benchmark.h" 8 #include "Benchmark.h"
9 #include "Resources.h" 9 #include "Resources.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
11 #include "SkData.h" 11 #include "SkData.h"
12 #include "SkDecodingImageGenerator.h" 12 #include "SkDecodingImageGenerator.h"
13 #include "SkImageDecoder.h" 13 #include "SkImageDecoder.h"
14 #include "SkOSFile.h" 14 #include "SkOSFile.h"
15 #include "SkPixelRef.h" 15 #include "SkPixelRef.h"
16 16
17 #ifndef SK_IGNORE_ETC1_SUPPORT 17 #ifndef SK_IGNORE_ETC1_SUPPORT
18 18
19 #include "etc1.h" 19 #include "etc1.h"
20 20
21 // This takes the etc1 data pointed to by orig, and copies it `factor` times in each 21 // This takes the etc1 data pointed to by orig, and copies it `factor` times in each
22 // dimension. The return value is the new data or NULL on error. 22 // dimension. The return value is the new data or NULL on error.
23 static etc1_byte* create_expanded_etc1_bitmap(const uint8_t* orig, int factor) { 23 static etc1_byte* create_expanded_etc1_bitmap(const uint8_t* orig, int factor) {
24 SkASSERT(NULL != orig); 24 SkASSERT(orig);
25 SkASSERT(factor > 1); 25 SkASSERT(factor > 1);
26 26
27 const etc1_byte* origData = reinterpret_cast<const etc1_byte*>(orig); 27 const etc1_byte* origData = reinterpret_cast<const etc1_byte*>(orig);
28 if (!etc1_pkm_is_valid(orig)) { 28 if (!etc1_pkm_is_valid(orig)) {
29 return NULL; 29 return NULL;
30 } 30 }
31 31
32 etc1_uint32 origWidth = etc1_pkm_get_width(origData); 32 etc1_uint32 origWidth = etc1_pkm_get_width(origData);
33 etc1_uint32 origHeight = etc1_pkm_get_height(origData); 33 etc1_uint32 origHeight = etc1_pkm_get_height(origData);
34 34
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 DEF_BENCH(return new ETCBitmapBench(false, Benchmark::kGPU_Backend);) 226 DEF_BENCH(return new ETCBitmapBench(false, Benchmark::kGPU_Backend);)
227 DEF_BENCH(return new ETCBitmapBench(true, Benchmark::kGPU_Backend);) 227 DEF_BENCH(return new ETCBitmapBench(true, Benchmark::kGPU_Backend);)
228 228
229 DEF_BENCH(return new ETCBitmapUploadBench(false, Benchmark::kRaster_Backend);) 229 DEF_BENCH(return new ETCBitmapUploadBench(false, Benchmark::kRaster_Backend);)
230 DEF_BENCH(return new ETCBitmapUploadBench(true, Benchmark::kRaster_Backend);) 230 DEF_BENCH(return new ETCBitmapUploadBench(true, Benchmark::kRaster_Backend);)
231 231
232 DEF_BENCH(return new ETCBitmapUploadBench(false, Benchmark::kGPU_Backend);) 232 DEF_BENCH(return new ETCBitmapUploadBench(false, Benchmark::kGPU_Backend);)
233 DEF_BENCH(return new ETCBitmapUploadBench(true, Benchmark::kGPU_Backend);) 233 DEF_BENCH(return new ETCBitmapUploadBench(true, Benchmark::kGPU_Backend);)
234 234
235 #endif // SK_IGNORE_ETC1_SUPPORT 235 #endif // SK_IGNORE_ETC1_SUPPORT
OLDNEW
« no previous file with comments | « bench/ChartBench.cpp ('k') | bench/GrResourceCacheBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698