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:
|
2017-03-01 20:33:23 +00:00
|
|
|
std::unique_ptr<SkLiteDL> fDL;
|
2014-09-10 19:19:30 +00:00
|
|
|
bool fUseBBH;
|
|
|
|
|
2016-10-21 14:43:36 +00:00
|
|
|
typedef PictureCentricBench INHERITED;
|
|
|
|
};
|
|
|
|
|
2017-12-06 15:47:03 +00:00
|
|
|
class DeserializePictureBench : public Benchmark {
|
|
|
|
public:
|
|
|
|
DeserializePictureBench(const char* name, sk_sp<SkData> encodedPicture);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
const char* onGetName() override;
|
|
|
|
bool isSuitableFor(Backend) override;
|
|
|
|
SkIPoint onGetSize() override;
|
|
|
|
void onDraw(int loops, SkCanvas*) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
SkString fName;
|
|
|
|
sk_sp<SkData> fEncodedPicture;
|
|
|
|
|
|
|
|
typedef Benchmark INHERITED;
|
|
|
|
};
|
|
|
|
|
2014-09-10 19:19:30 +00:00
|
|
|
#endif//RecordingBench_DEFINED
|