tomhudson | d968a6f | 2015-03-26 11:28:06 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef nanobenchAndroid_DEFINED |
| 9 | #define nanobenchAndroid_DEFINED |
| 10 | |
tomhudson | d968a6f | 2015-03-26 11:28:06 -0700 | [diff] [blame] | 11 | #include "SkAndroidSDKCanvas.h" |
tomhudson | 573ae01 | 2015-03-27 12:22:01 -0700 | [diff] [blame] | 12 | #include "SkHwuiRenderer.h" |
tomhudson | d968a6f | 2015-03-26 11:28:06 -0700 | [diff] [blame] | 13 | |
| 14 | #include "nanobench.h" |
| 15 | |
| 16 | struct HWUITarget : public Target { |
| 17 | explicit HWUITarget(const Config& c, Benchmark* bench); |
| 18 | |
tomhudson | 573ae01 | 2015-03-27 12:22:01 -0700 | [diff] [blame] | 19 | SkHwuiRenderer renderer; |
tomhudson | d968a6f | 2015-03-26 11:28:06 -0700 | [diff] [blame] | 20 | SkAndroidSDKCanvas fc; |
| 21 | |
| 22 | void setup() override; |
| 23 | SkCanvas* beginTiming(SkCanvas* canvas) override; |
| 24 | void endTiming() override; |
| 25 | void fence() override; |
cdalton | d416a5b | 2015-06-23 13:23:44 -0700 | [diff] [blame] | 26 | bool needsFrameTiming(int* frameLag) const override; |
tomhudson | d968a6f | 2015-03-26 11:28:06 -0700 | [diff] [blame] | 27 | |
tomhudson | d968a6f | 2015-03-26 11:28:06 -0700 | [diff] [blame] | 28 | bool init(SkImageInfo info, Benchmark* bench) override; |
| 29 | bool capturePixels(SkBitmap* bmp) override; |
| 30 | }; |
| 31 | |
tomhudson | d968a6f | 2015-03-26 11:28:06 -0700 | [diff] [blame] | 32 | #endif // nanobenchAndroid_DEFINED |