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

Side by Side Diff: bench/ETCBitmapBench.cpp

Issue 321723002: Reland "Clean up Test's resourcePath code." (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: ETCBitmapBench fix Created 6 years, 6 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 | bench/SkBenchmark.h » ('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 "SkBenchmark.h" 8 #include "SkBenchmark.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 if (NULL == fPKMData) { 82 if (NULL == fPKMData) {
83 SkDebugf("Could not load PKM data!"); 83 SkDebugf("Could not load PKM data!");
84 } 84 }
85 } 85 }
86 86
87 protected: 87 protected:
88 SkAutoDataUnref fPKMData; 88 SkAutoDataUnref fPKMData;
89 89
90 private: 90 private:
91 SkData *loadPKM() { 91 SkData *loadPKM() {
92 SkString filename = SkOSPath::SkPathJoin( 92 SkString resourcePath = GetResourcePath();
93 INHERITED::GetResourcePath().c_str(), "mandrill_128.pkm"); 93 SkString filename = SkOSPath::SkPathJoin(resourcePath.c_str(),
94 "mandrill_128.pkm");
94 95
95 // Expand the data 96 // Expand the data
96 SkAutoDataUnref fileData(SkData::NewFromFileName(filename.c_str())); 97 SkAutoDataUnref fileData(SkData::NewFromFileName(filename.c_str()));
97 if (NULL == fileData) { 98 if (NULL == fileData) {
98 SkDebugf("Could not open the file. Did you forget to set the resourc ePath?\n"); 99 SkDebugf("Could not open the file. Did you forget to set the resourc ePath?\n");
99 return NULL; 100 return NULL;
100 } 101 }
101 102
102 const etc1_uint32 kExpansionFactor = 8; 103 const etc1_uint32 kExpansionFactor = 8;
103 etc1_byte* expandedETC1 = 104 etc1_byte* expandedETC1 =
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 DEF_BENCH(return new ETCBitmapBench(false, SkBenchmark::kGPU_Backend);) 225 DEF_BENCH(return new ETCBitmapBench(false, SkBenchmark::kGPU_Backend);)
225 DEF_BENCH(return new ETCBitmapBench(true, SkBenchmark::kGPU_Backend);) 226 DEF_BENCH(return new ETCBitmapBench(true, SkBenchmark::kGPU_Backend);)
226 227
227 DEF_BENCH(return new ETCBitmapUploadBench(false, SkBenchmark::kRaster_Backend);) 228 DEF_BENCH(return new ETCBitmapUploadBench(false, SkBenchmark::kRaster_Backend);)
228 DEF_BENCH(return new ETCBitmapUploadBench(true, SkBenchmark::kRaster_Backend);) 229 DEF_BENCH(return new ETCBitmapUploadBench(true, SkBenchmark::kRaster_Backend);)
229 230
230 DEF_BENCH(return new ETCBitmapUploadBench(false, SkBenchmark::kGPU_Backend);) 231 DEF_BENCH(return new ETCBitmapUploadBench(false, SkBenchmark::kGPU_Backend);)
231 DEF_BENCH(return new ETCBitmapUploadBench(true, SkBenchmark::kGPU_Backend);) 232 DEF_BENCH(return new ETCBitmapUploadBench(true, SkBenchmark::kGPU_Backend);)
232 233
233 #endif // SK_IGNORE_ETC1_SUPPORT 234 #endif // SK_IGNORE_ETC1_SUPPORT
OLDNEW
« no previous file with comments | « no previous file | bench/SkBenchmark.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698