| 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 "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkChecksum.h" | 10 #include "SkChecksum.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 static void dump_array(const uint16_t array[], int count) { | 92 static void dump_array(const uint16_t array[], int count) { |
| 93 for (int i = 0; i < count; ++i) { | 93 for (int i = 0; i < count; ++i) { |
| 94 SkDebugf(" %d,", array[i]); | 94 SkDebugf(" %d,", array[i]); |
| 95 } | 95 } |
| 96 SkDebugf("\n"); | 96 SkDebugf("\n"); |
| 97 } | 97 } |
| 98 | 98 |
| 99 class FontCacheEfficiency : public Benchmark { | 99 class FontCacheEfficiency : public Benchmark { |
| 100 public: | 100 public: |
| 101 FontCacheEfficiency() { | 101 FontCacheEfficiency() { |
| 102 if (false) dump_array(NULL, 0); | 102 if (false) dump_array(nullptr, 0); |
| 103 if (false) rotr(0, 0); | 103 if (false) rotr(0, 0); |
| 104 } | 104 } |
| 105 | 105 |
| 106 protected: | 106 protected: |
| 107 const char* onGetName() override { | 107 const char* onGetName() override { |
| 108 return "fontefficiency"; | 108 return "fontefficiency"; |
| 109 } | 109 } |
| 110 | 110 |
| 111 void onDraw(const int loops, SkCanvas* canvas) override { | 111 void onDraw(const int loops, SkCanvas* canvas) override { |
| 112 static bool gDone; | 112 static bool gDone; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 138 private: | 138 private: |
| 139 typedef Benchmark INHERITED; | 139 typedef Benchmark INHERITED; |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 /////////////////////////////////////////////////////////////////////////////// | 142 /////////////////////////////////////////////////////////////////////////////// |
| 143 | 143 |
| 144 DEF_BENCH( return new FontCacheBench(); ) | 144 DEF_BENCH( return new FontCacheBench(); ) |
| 145 | 145 |
| 146 // undefine this to run the efficiency test | 146 // undefine this to run the efficiency test |
| 147 //DEF_BENCH( return new FontCacheEfficiency(); ) | 147 //DEF_BENCH( return new FontCacheEfficiency(); ) |
| OLD | NEW |