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" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 } else { | 137 } else { |
138 SkASSERT(kRaster_Backend == this->fBackend); | 138 SkASSERT(kRaster_Backend == this->fBackend); |
139 if (this->fDecompress) { | 139 if (this->fDecompress) { |
140 return "etc1bitmap_render_raster_decompressed"; | 140 return "etc1bitmap_render_raster_decompressed"; |
141 } else { | 141 } else { |
142 return "etc1bitmap_render_raster_compressed"; | 142 return "etc1bitmap_render_raster_compressed"; |
143 } | 143 } |
144 } | 144 } |
145 } | 145 } |
146 | 146 |
147 void onPreDraw() override { | 147 void onDelayedSetup() override { |
148 if (nullptr == fPKMData) { | 148 if (nullptr == fPKMData) { |
149 SkDebugf("Failed to load PKM data!\n"); | 149 SkDebugf("Failed to load PKM data!\n"); |
150 return; | 150 return; |
151 } | 151 } |
152 | 152 |
153 if (fDecompress) { | 153 if (fDecompress) { |
154 SkAutoTDelete<SkImageGenerator> gen(SkImageGenerator::NewFromEncoded
(fPKMData)); | 154 SkAutoTDelete<SkImageGenerator> gen(SkImageGenerator::NewFromEncoded
(fPKMData)); |
155 gen->generateBitmap(&fBitmap); | 155 gen->generateBitmap(&fBitmap); |
156 } else { | 156 } else { |
157 fImage.reset(SkImage::NewFromEncoded(fPKMData)); | 157 fImage.reset(SkImage::NewFromEncoded(fPKMData)); |
(...skipping 68 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 |