2014-09-10 19:19:30 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2014 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef RecordingBench_DEFINED
|
|
|
|
#define RecordingBench_DEFINED
|
|
|
|
|
|
|
|
#include "Benchmark.h"
|
|
|
|
#include "SkPicture.h"
|
2016-08-10 19:09:34 +00:00
|
|
|
#include "SkLiteDL.h"
|
2014-09-10 19:19:30 +00:00
|
|
|
|
2016-10-21 14:43:36 +00:00
|
|
|
class PictureCentricBench : public Benchmark {
|
2014-09-10 19:19:30 +00:00
|
|
|
public:
|
2016-10-21 14:43:36 +00:00
|
|
|
PictureCentricBench(const char* name, const SkPicture*);
|
2014-09-10 19:19:30 +00:00
|
|
|
|
|
|
|
protected:
|
2015-03-26 01:17:31 +00:00
|
|
|
const char* onGetName() override;
|
|
|
|
bool isSuitableFor(Backend) override;
|
|
|
|
SkIPoint onGetSize() override;
|
2014-09-10 19:19:30 +00:00
|
|
|
|
2016-10-21 14:43:36 +00:00
|
|
|
protected:
|
2016-08-08 13:56:22 +00:00
|
|
|
sk_sp<const SkPicture> fSrc;
|
2014-09-10 19:19:30 +00:00
|
|
|
SkString fName;
|
2016-10-21 14:43:36 +00:00
|
|
|
|
|
|
|
typedef Benchmark INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
class RecordingBench : public PictureCentricBench {
|
|
|
|
public:
|
|
|
|
RecordingBench(const char* name, const SkPicture*, bool useBBH, bool lite);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void onDraw(int loops, SkCanvas*) override;
|
|
|
|
|
|
|
|
private:
|
2016-08-10 19:09:34 +00:00
|
|
|
sk_sp<SkLiteDL> fDL;
|
2014-09-10 19:19:30 +00:00
|
|
|
bool fUseBBH;
|
|
|
|
|
2016-10-21 14:43:36 +00:00
|
|
|
typedef PictureCentricBench INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
class PipingBench : public PictureCentricBench {
|
|
|
|
public:
|
|
|
|
PipingBench(const char* name, const SkPicture*);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void onDraw(int loops, SkCanvas*) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
typedef PictureCentricBench INHERITED;
|
2014-09-10 19:19:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif//RecordingBench_DEFINED
|