Spin off GM::runAsBench() from flags.
This will let us kill flags. BUG=skia: Review URL: https://codereview.chromium.org/873753002
This commit is contained in:
parent
7a2c8f3f28
commit
cf5d9c993d
@ -503,7 +503,7 @@ public:
|
||||
while (fGMs) {
|
||||
SkAutoTDelete<skiagm::GM> gm(fGMs->factory()(NULL));
|
||||
fGMs = fGMs->next();
|
||||
if (gm->getFlags() & skiagm::GM::kAsBench_Flag) {
|
||||
if (gm->runAsBench()) {
|
||||
fSourceType = "gm";
|
||||
fBenchType = "micro";
|
||||
return SkNEW_ARGS(GMBench, (gm.detach()));
|
||||
|
@ -26,9 +26,11 @@ public:
|
||||
|
||||
protected:
|
||||
uint32_t onGetFlags() const SK_OVERRIDE {
|
||||
return kSkipTiled_Flag | kAsBench_Flag;
|
||||
return kSkipTiled_Flag;
|
||||
}
|
||||
|
||||
bool runAsBench() const SK_OVERRIDE { return true; }
|
||||
|
||||
SkString onShortName() SK_OVERRIDE {
|
||||
return SkString("circular-clips");
|
||||
}
|
||||
|
@ -215,9 +215,11 @@ protected:
|
||||
}
|
||||
|
||||
virtual uint32_t onGetFlags() const {
|
||||
return kAsBench_Flag | kSkipTiled_Flag;
|
||||
return kSkipTiled_Flag;
|
||||
}
|
||||
|
||||
bool runAsBench() const SK_OVERRIDE { return true; }
|
||||
|
||||
private:
|
||||
class Clip {
|
||||
public:
|
||||
|
@ -414,7 +414,9 @@ public:
|
||||
Dashing5GM(bool doAA) : fDoAA(doAA) {}
|
||||
|
||||
protected:
|
||||
uint32_t onGetFlags() const SK_OVERRIDE { return kAsBench_Flag | kSkipTiled_Flag; }
|
||||
uint32_t onGetFlags() const SK_OVERRIDE { return kSkipTiled_Flag; }
|
||||
|
||||
bool runAsBench() const SK_OVERRIDE { return true; }
|
||||
|
||||
SkString onShortName() SK_OVERRIDE {
|
||||
if (fDoAA) {
|
||||
|
4
gm/gm.h
4
gm/gm.h
@ -53,8 +53,6 @@ namespace skiagm {
|
||||
|
||||
kGPUOnly_Flag = 1 << 9,
|
||||
|
||||
kAsBench_Flag = 1 << 10, // Run the GM as a benchmark in the bench tool
|
||||
|
||||
kNoBBH_Flag = 1 << 11, // May draw wrong using a bounding-box hierarchy
|
||||
};
|
||||
|
||||
@ -74,6 +72,8 @@ namespace skiagm {
|
||||
SkISize getISize() { return this->onISize(); }
|
||||
const char* getName();
|
||||
|
||||
virtual bool runAsBench() const { return false; }
|
||||
|
||||
uint32_t getFlags() const {
|
||||
return this->onGetFlags();
|
||||
}
|
||||
|
@ -534,7 +534,8 @@ namespace skiagm {
|
||||
return name;
|
||||
}
|
||||
|
||||
uint32_t onGetFlags() const SK_OVERRIDE { return kAsBench_Flag | kSkipTiled_Flag; }
|
||||
uint32_t onGetFlags() const SK_OVERRIDE { return kSkipTiled_Flag; }
|
||||
bool runAsBench() const SK_OVERRIDE { return true; }
|
||||
|
||||
private:
|
||||
typedef GM INHERITED;
|
||||
|
@ -139,8 +139,9 @@ protected:
|
||||
uint32_t onGetFlags() const SK_OVERRIDE {
|
||||
// The aa hairline stroked rects used to visualize the clip draw slightly differently in
|
||||
// quilt mode in dm.
|
||||
return kAsBench_Flag | kSkipTiled_Flag;
|
||||
return kSkipTiled_Flag;
|
||||
}
|
||||
bool runAsBench() const SK_OVERRIDE { return true; }
|
||||
|
||||
private:
|
||||
static const int kCnt = 30;
|
||||
|
Loading…
Reference in New Issue
Block a user