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

Side by Side Diff: bench/ETCBitmapBench.cpp

Issue 1409993003: Misc: Don't run etc1 bench with invalid image and fix VS2015 build warning (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | tools/sk_tool_utils.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"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 }; 116 };
117 117
118 // This is the rendering benchmark. Prior to rendering the data, create a 118 // This is the rendering benchmark. Prior to rendering the data, create a
119 // bitmap using the etc1 data. 119 // bitmap using the etc1 data.
120 class ETCBitmapBench : public ETCBitmapBenchBase { 120 class ETCBitmapBench : public ETCBitmapBenchBase {
121 public: 121 public:
122 ETCBitmapBench(bool decompress, Backend backend) 122 ETCBitmapBench(bool decompress, Backend backend)
123 : fDecompress(decompress), fBackend(backend) { } 123 : fDecompress(decompress), fBackend(backend) { }
124 124
125 bool isSuitableFor(Backend backend) override { 125 bool isSuitableFor(Backend backend) override {
126 return backend == this->fBackend; 126 return SkToBool(fImage) && backend == this->fBackend;
127 } 127 }
128 128
129 protected: 129 protected:
130 const char* onGetName() override { 130 const char* onGetName() override {
131 if (kGPU_Backend == this->fBackend) { 131 if (kGPU_Backend == this->fBackend) {
132 if (this->fDecompress) { 132 if (this->fDecompress) {
133 return "etc1bitmap_render_gpu_decompressed"; 133 return "etc1bitmap_render_gpu_decompressed";
134 } else { 134 } else {
135 return "etc1bitmap_render_gpu_compressed"; 135 return "etc1bitmap_render_gpu_compressed";
136 } 136 }
(...skipping 89 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 | « no previous file | tools/sk_tool_utils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698