| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 #ifndef nanobench_DEFINED | 8 #ifndef nanobench_DEFINED |
| 9 #define nanobench_DEFINED | 9 #define nanobench_DEFINED |
| 10 | 10 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 virtual void endTiming() { } | 56 virtual void endTiming() { } |
| 57 | 57 |
| 58 /** Called between benchmarks (or between calibration and measured | 58 /** Called between benchmarks (or between calibration and measured |
| 59 runs) to make sure all pending work in drivers / threads is | 59 runs) to make sure all pending work in drivers / threads is |
| 60 complete. */ | 60 complete. */ |
| 61 virtual void fence() { } | 61 virtual void fence() { } |
| 62 | 62 |
| 63 /** CPU-like targets can just be timed, but GPU-like | 63 /** CPU-like targets can just be timed, but GPU-like |
| 64 targets need to pay attention to frame boundaries | 64 targets need to pay attention to frame boundaries |
| 65 or other similar details. */ | 65 or other similar details. */ |
| 66 virtual bool needsFrameTiming() const { return false; } | 66 virtual bool needsFrameTiming(int* frameLag) const { return false; } |
| 67 | 67 |
| 68 /** Called once per target, during program initialization. | 68 /** Called once per target, during program initialization. |
| 69 Returns false if initialization fails. */ | 69 Returns false if initialization fails. */ |
| 70 virtual bool init(SkImageInfo info, Benchmark* bench); | 70 virtual bool init(SkImageInfo info, Benchmark* bench); |
| 71 | 71 |
| 72 /** Stores any pixels drawn to the screen in the bitmap. | 72 /** Stores any pixels drawn to the screen in the bitmap. |
| 73 Returns false on error. */ | 73 Returns false on error. */ |
| 74 virtual bool capturePixels(SkBitmap* bmp); | 74 virtual bool capturePixels(SkBitmap* bmp); |
| 75 | 75 |
| 76 /** Writes any config-specific data to the log. */ | 76 /** Writes any config-specific data to the log. */ |
| 77 virtual void fillOptions(ResultsWriter*) { } | 77 virtual void fillOptions(ResultsWriter*) { } |
| 78 | 78 |
| 79 SkCanvas* getCanvas() const { | 79 SkCanvas* getCanvas() const { |
| 80 if (!surface.get()) { | 80 if (!surface.get()) { |
| 81 return NULL; | 81 return NULL; |
| 82 } | 82 } |
| 83 return surface->getCanvas(); | 83 return surface->getCanvas(); |
| 84 } | 84 } |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 #endif // nanobench_DEFINED | 87 #endif // nanobench_DEFINED |
| OLD | NEW |