Remove dead code from Benchmark

Spotted the VisualBench hooks the other day, then found some more dead
code when I went to remove them.

Change-Id: Ia07f0556faf33cc69e3ec590f7a8f47f2c1f298a
Reviewed-on: https://skia-review.googlesource.com/146360
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
Brian Osman 2018-08-08 14:27:25 -04:00 committed by Skia Commit-Bot
parent 8af4c40014
commit 1e4a4daebe
6 changed files with 1 additions and 76 deletions

View File

@ -11,15 +11,9 @@
#include "SkPaint.h"
#include "SkParse.h"
const char* SkTriState::Name[] = { "default", "true", "false" };
template BenchRegistry* BenchRegistry::gHead;
Benchmark::Benchmark() {
fForceAlpha = 0xFF;
fDither = SkTriState::kDefault;
fOrMask = fClearMask = 0;
}
Benchmark::Benchmark() {}
const char* Benchmark::getName() {
return this->onGetName();
@ -59,15 +53,7 @@ void Benchmark::draw(int loops, SkCanvas* canvas) {
}
void Benchmark::setupPaint(SkPaint* paint) {
paint->setAlpha(fForceAlpha);
paint->setAntiAlias(true);
paint->setFilterQuality(kNone_SkFilterQuality);
paint->setFlags((paint->getFlags() & ~fClearMask) | fOrMask);
if (SkTriState::kDefault != fDither) {
paint->setDither(SkTriState::kTrue == fDither);
}
}
SkIPoint Benchmark::onGetSize() {

View File

@ -31,16 +31,6 @@ struct GrContextOptions;
class SkCanvas;
class SkPaint;
class SkTriState {
public:
enum State {
kDefault,
kTrue,
kFalse
};
static const char* Name[];
};
class Benchmark : public SkRefCnt {
public:
Benchmark();
@ -87,46 +77,6 @@ public:
// Bench framework can tune loops to be large enough for stable timing.
void draw(int loops, SkCanvas*);
void setForceAlpha(int alpha) {
fForceAlpha = alpha;
}
void setDither(SkTriState::State state) {
fDither = state;
}
/** Assign masks for paint-flags. These will be applied when setupPaint()
* is called.
*
* Performs the following on the paint:
* uint32_t flags = paint.getFlags();
* flags &= ~clearMask;
* flags |= orMask;
* paint.setFlags(flags);
*/
void setPaintMasks(uint32_t orMask, uint32_t clearMask) {
fOrMask = orMask;
fClearMask = clearMask;
}
/*
* Benches which support running in a visual mode can advertise this functionality
*/
virtual bool isVisual() { return false; }
/*
* VisualBench frequently resets the canvas. As a result we need to bulk call all of the hooks
*/
void preTimingHooks(SkCanvas* canvas) {
this->perCanvasPreDraw(canvas);
this->preDraw(canvas);
}
void postTimingHooks(SkCanvas* canvas) {
this->postDraw(canvas);
this->perCanvasPostDraw(canvas);
}
virtual void getGpuStats(SkCanvas*, SkTArray<SkString>* keys, SkTArray<double>* values) {}
protected:
@ -146,10 +96,6 @@ protected:
virtual SkIPoint onGetSize();
private:
int fForceAlpha;
SkTriState::State fDither;
uint32_t fOrMask, fClearMask;
typedef SkRefCnt INHERITED;
};

View File

@ -30,7 +30,6 @@ static_assert(52 == kNumGlyphs, "expected 52 glyphs");
class PathTextBench : public Benchmark {
public:
PathTextBench(bool clipped, bool uncached) : fClipped(clipped), fUncached(uncached) {}
bool isVisual() override { return true; }
private:
const char* onGetName() override {

View File

@ -39,8 +39,6 @@ public:
return fBaseName.c_str();
}
bool isVisual() override { return true; }
protected:
virtual void drawThisRect(SkCanvas* c, const SkRect& r, const SkPaint& p) {

View File

@ -22,8 +22,6 @@ public:
computeName("shadows");
}
bool isVisual() override { return true; }
protected:
enum {
kWidth = 640,

View File

@ -97,8 +97,6 @@ public:
}
#endif
bool isVisual() override { return true; }
private:
void clampShapeSize() {
float maxDiagonal = static_cast<float>(SkTMin(kBenchWidth, kBenchHeight));