Samples: clean up cruft
- replace virtual with override.
- remove default constructor.
- use default field initializers
- move work from constructor into onOnceBeforeDraw
- mark everything private
- enum { N = 100 }; constants to constexpr
- remove unused variables
Change-Id: I8c7a19bc24fec416a6b88d634ee948d3e842b986
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228056
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
diff --git a/samplecode/SampleArc.cpp b/samplecode/SampleArc.cpp
index d6b6170..2d5892d 100644
--- a/samplecode/SampleArc.cpp
+++ b/samplecode/SampleArc.cpp
@@ -78,14 +78,10 @@
}
};
-public:
- SkRect fRect;
+ SkRect fRect = {20, 20, 220, 220};
sk_sp<MyDrawable> fAnimatingDrawable;
sk_sp<SkDrawable> fRootDrawable;
- ArcsView() { }
-
-protected:
SkString name() override { return SkString("Arcs"); }
static void DrawRectWithLines(SkCanvas* canvas, const SkRect& r, const SkPaint& p) {
@@ -164,11 +160,8 @@
void onOnceBeforeDraw() override {
testparse();
- fSweep = SkIntToScalar(100);
this->setBGColor(0xFFDDDDDD);
- fRect.set(0, 0, SkIntToScalar(200), SkIntToScalar(200));
- fRect.offset(SkIntToScalar(20), SkIntToScalar(20));
fAnimatingDrawable = sk_make_sp<MyDrawable>(fRect);
SkPictureRecorder recorder;
@@ -187,13 +180,6 @@
}
return true;
}
-
-private:
- SkScalar fSweep;
-
- typedef Sample INHERITED;
};
-//////////////////////////////////////////////////////////////////////////////
-
DEF_SAMPLE( return new ArcsView(); )