aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/nanobenchAndroid.h
blob: ef28751acaeb6fc2d8fae81bb577d6420ac07949 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * 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 <utils/TestWindowContext.h>

#include "nanobench.h"

struct HWUITarget : public Target {
    explicit HWUITarget(const Config& c, Benchmark* bench);

    android::uirenderer::TestWindowContext 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