| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |