blob: 16a81cfe5e6433af9c6a0069fcc4d80038130318 [file] [log] [blame]
tomhudsond968a6f2015-03-26 11:28:06 -07001/*
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
tomhudsond968a6f2015-03-26 11:28:06 -070011#include "SkAndroidSDKCanvas.h"
tomhudson573ae012015-03-27 12:22:01 -070012#include "SkHwuiRenderer.h"
tomhudsond968a6f2015-03-26 11:28:06 -070013
14#include "nanobench.h"
15
16struct HWUITarget : public Target {
17 explicit HWUITarget(const Config& c, Benchmark* bench);
18
tomhudson573ae012015-03-27 12:22:01 -070019 SkHwuiRenderer renderer;
tomhudsond968a6f2015-03-26 11:28:06 -070020 SkAndroidSDKCanvas fc;
21
22 void setup() override;
23 SkCanvas* beginTiming(SkCanvas* canvas) override;
24 void endTiming() override;
25 void fence() override;
cdaltond416a5b2015-06-23 13:23:44 -070026 bool needsFrameTiming(int* frameLag) const override;
tomhudsond968a6f2015-03-26 11:28:06 -070027
tomhudsond968a6f2015-03-26 11:28:06 -070028 bool init(SkImageInfo info, Benchmark* bench) override;
29 bool capturePixels(SkBitmap* bmp) override;
30};
31
tomhudsond968a6f2015-03-26 11:28:06 -070032#endif // nanobenchAndroid_DEFINED