d416a5b10f
Improves the GPU measuring accuracy of nanobench by using fence syncs. Fence syncs are very widely supported and available on almost every platform. NO_MERGE_BUILDS BUG=skia: Review URL: https://codereview.chromium.org/1194783003
33 lines
796 B
C
33 lines
796 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(int* frameLag) const override;
|
|
|
|
bool init(SkImageInfo info, Benchmark* bench) override;
|
|
bool capturePixels(SkBitmap* bmp) override;
|
|
};
|
|
|
|
#endif // nanobenchAndroid_DEFINED
|