gm: simplify several onName
Change-Id: I9c470c2cf5d546626c279ce65626f767292a94e6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228354
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
diff --git a/gm/blurroundrect.cpp b/gm/blurroundrect.cpp
index 8c99b8a..976b5ae 100644
--- a/gm/blurroundrect.cpp
+++ b/gm/blurroundrect.cpp
@@ -33,18 +33,14 @@
// This GM mimics a blurred RR seen in the wild.
class BlurRoundRectGM : public skiagm::GM {
public:
- BlurRoundRectGM(int width, int height)
- : fName("blurroundrect"), fWidth(width), fHeight(height) {
- fName.appendf("-WH-%ix%i-unevenCorners", width, height);
- }
+ BlurRoundRectGM(int w, int h) : fWidth(w), fHeight(h) {}
+private:
SkString onShortName() override {
- return fName;
+ return SkStringPrintf("blurroundrect-WH-%ix%i-unevenCorners", fWidth, fHeight);
}
- SkISize onISize() override {
- return SkISize::Make(fWidth, fHeight);
- }
+ SkISize onISize() override { return {fWidth, fHeight}; }
void onOnceBeforeDraw() override {
SkVector radii[4];
@@ -86,12 +82,8 @@
canvas->drawRRect(fRRect, paint);
}
-private:
- SkString fName;
- SkRRect fRRect;
- int fWidth, fHeight;
-
- typedef skiagm::GM INHERITED;
+ SkRRect fRRect;
+ int fWidth, fHeight;
};
// Rounded rect with two opposite corners with large radii, the other two
// small.
@@ -125,20 +117,9 @@
// Simpler blurred RR test cases where all the radii are the same.
class SimpleBlurRoundRectGM : public skiagm::GM {
-public:
- SimpleBlurRoundRectGM()
- : fName("simpleblurroundrect") {
- }
+ SkString onShortName() override { return SkString("simpleblurroundrect"); }
-protected:
-
- SkString onShortName() override {
- return fName;
- }
-
- SkISize onISize() override {
- return SkISize::Make(1000, 500);
- }
+ SkISize onISize() override { return {1000, 500}; }
void onDraw(SkCanvas* canvas) override {
canvas->scale(1.5f, 1.5f);
@@ -171,10 +152,6 @@
}
}
}
-private:
- const SkString fName;
-
- typedef skiagm::GM INHERITED;
};
// Create one with dimensions/rounded corners based on the skp