| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkBitmap.h" | 9 #include "SkBitmap.h" |
| 10 #include "SkData.h" | 10 #include "SkData.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 , fFilename(filename) | 26 , fFilename(filename) |
| 27 , fStream() | 27 , fStream() |
| 28 , fSkipZeroes(skipZeroes) | 28 , fSkipZeroes(skipZeroes) |
| 29 , fValid(false) { | 29 , fValid(false) { |
| 30 fName.append(filename); | 30 fName.append(filename); |
| 31 if (skipZeroes) { | 31 if (skipZeroes) { |
| 32 fName.append("_skip_zeroes"); | 32 fName.append("_skip_zeroes"); |
| 33 } else { | 33 } else { |
| 34 fName.append("_write_zeroes"); | 34 fName.append("_write_zeroes"); |
| 35 } | 35 } |
| 36 fIsRendering = false; | 36 } |
| 37 |
| 38 virtual bool isSuitableFor(Backend backend) SK_OVERRIDE { |
| 39 return backend == kNonRendering_Backend; |
| 37 } | 40 } |
| 38 | 41 |
| 39 protected: | 42 protected: |
| 40 virtual const char* onGetName() SK_OVERRIDE { | 43 virtual const char* onGetName() SK_OVERRIDE { |
| 41 return fName.c_str(); | 44 return fName.c_str(); |
| 42 } | 45 } |
| 43 | 46 |
| 44 virtual void onPreDraw() SK_OVERRIDE { | 47 virtual void onPreDraw() SK_OVERRIDE { |
| 45 const char* resPath = GetResourcePath().c_str(); | 48 const char* resPath = GetResourcePath().c_str(); |
| 46 if (NULL == resPath) { | 49 if (NULL == resPath) { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 SkMemoryStream fStream; | 107 SkMemoryStream fStream; |
| 105 bool fSkipZeroes; | 108 bool fSkipZeroes; |
| 106 bool fValid; | 109 bool fValid; |
| 107 | 110 |
| 108 typedef SkBenchmark INHERITED; | 111 typedef SkBenchmark INHERITED; |
| 109 }; | 112 }; |
| 110 | 113 |
| 111 // Enable the true version once the feature is checked in. | 114 // Enable the true version once the feature is checked in. |
| 112 DEF_BENCH( return SkNEW_ARGS(SkipZeroesBench, ("arrow.png", true))); | 115 DEF_BENCH( return SkNEW_ARGS(SkipZeroesBench, ("arrow.png", true))); |
| 113 DEF_BENCH( return SkNEW_ARGS(SkipZeroesBench, ("arrow.png", false))); | 116 DEF_BENCH( return SkNEW_ARGS(SkipZeroesBench, ("arrow.png", false))); |
| OLD | NEW |