skia2/bench/nanobenchAndroid.h
tomhudson 573ae01295 Move HWUI boilerplate into utils/android
Duplicate code from the HWUI backends for DM and nanobench
moves into a single place, saving a hundred lines or more of
cut-and-paste.

There's some indication that this increases the incidence of
SkCanvas "Unable to find device for layer." warnings, but no
clear degradation in test results.

R=djsollen@google.com,mtklein@google.com
BUG=skia:3589

Review URL: https://codereview.chromium.org/1036303002
2015-03-27 12:22:01 -07:00

33 lines
783 B
C

/*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef nanobenchAndroid_DEFINED
#define nanobenchAndroid_DEFINED
#include "SkAndroidSDKCanvas.h"
#include "SkHwuiRenderer.h"
#include "nanobench.h"
struct HWUITarget : public Target {
explicit HWUITarget(const Config& c, Benchmark* bench);
SkHwuiRenderer renderer;
SkAndroidSDKCanvas fc;
void setup() override;
SkCanvas* beginTiming(SkCanvas* canvas) override;
void endTiming() override;
void fence() override;
bool needsFrameTiming() const override;
bool init(SkImageInfo info, Benchmark* bench) override;
bool capturePixels(SkBitmap* bmp) override;
};
#endif // nanobenchAndroid_DEFINED