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 11 #include "SkAndroidSDKCanvas.h" 12 #include "SkHwuiRenderer.h" 13 14 #include "nanobench.h" 15 16 struct HWUITarget : public Target { 17 explicit HWUITarget(const Config& c, Benchmark* bench); 18 19 SkHwuiRenderer renderer; 20 SkAndroidSDKCanvas fc; 21 22 void setup() override; 23 SkCanvas* beginTiming(SkCanvas* canvas) override; 24 void endTiming() override; 25 void fence() override; 26 bool needsFrameTiming() const override; 27 28 bool init(SkImageInfo info, Benchmark* bench) override; 29 bool capturePixels(SkBitmap* bmp) override; 30 }; 31 32 #endif // nanobenchAndroid_DEFINED 33