| 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 "Benchmark.h" | 8 #include "Benchmark.h" |
| 9 #include "Resources.h" | 9 #include "Resources.h" |
| 10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
| 11 #include "SkData.h" | 11 #include "SkData.h" |
| 12 #include "SkForceLinking.h" | |
| 13 #include "SkImageDecoder.h" | 12 #include "SkImageDecoder.h" |
| 14 #include "SkOSFile.h" | 13 #include "SkOSFile.h" |
| 15 #include "SkStream.h" | 14 #include "SkStream.h" |
| 16 #include "SkString.h" | 15 #include "SkString.h" |
| 17 | 16 |
| 18 __SK_FORCE_IMAGE_DECODER_LINKING; | |
| 19 | |
| 20 class SkCanvas; | 17 class SkCanvas; |
| 21 | 18 |
| 22 class SkipZeroesBench : public Benchmark { | 19 class SkipZeroesBench : public Benchmark { |
| 23 public: | 20 public: |
| 24 SkipZeroesBench(const char* filename, bool skipZeroes) | 21 SkipZeroesBench(const char* filename, bool skipZeroes) |
| 25 : fName("SkipZeroes_") | 22 : fName("SkipZeroes_") |
| 26 , fDecoder(NULL) | 23 , fDecoder(NULL) |
| 27 , fFilename(filename) | 24 , fFilename(filename) |
| 28 , fStream() | 25 , fStream() |
| 29 , fSkipZeroes(skipZeroes) | 26 , fSkipZeroes(skipZeroes) |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 SkMemoryStream fStream; | 105 SkMemoryStream fStream; |
| 109 bool fSkipZeroes; | 106 bool fSkipZeroes; |
| 110 bool fValid; | 107 bool fValid; |
| 111 | 108 |
| 112 typedef Benchmark INHERITED; | 109 typedef Benchmark INHERITED; |
| 113 }; | 110 }; |
| 114 | 111 |
| 115 // Enable the true version once the feature is checked in. | 112 // Enable the true version once the feature is checked in. |
| 116 DEF_BENCH( return SkNEW_ARGS(SkipZeroesBench, ("arrow.png", true))); | 113 DEF_BENCH( return SkNEW_ARGS(SkipZeroesBench, ("arrow.png", true))); |
| 117 DEF_BENCH( return SkNEW_ARGS(SkipZeroesBench, ("arrow.png", false))); | 114 DEF_BENCH( return SkNEW_ARGS(SkipZeroesBench, ("arrow.png", false))); |
| OLD | NEW |