gm: virtual->override
Change-Id: I7782f1d08a03c725bed76078adfb9b84aad34a5f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228347
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
diff --git a/gm/copy_to_4444.cpp b/gm/copy_to_4444.cpp
index e7dcc89..9e259de 100644
--- a/gm/copy_to_4444.cpp
+++ b/gm/copy_to_4444.cpp
@@ -18,25 +18,16 @@
#include "tools/Resources.h"
#include "tools/ToolUtils.h"
-namespace skiagm {
-
+namespace {
/**
* Test copying an image from 8888 to 4444.
*/
-class CopyTo4444GM : public GM {
-public:
- CopyTo4444GM() {}
+class CopyTo4444GM : public skiagm::GM {
+ SkString onShortName() override { return SkString("copyTo4444"); }
-protected:
- virtual SkString onShortName() {
- return SkString("copyTo4444");
- }
+ SkISize onISize() override { return {360, 180}; }
- virtual SkISize onISize() {
- return SkISize::Make(360, 180);
- }
-
- DrawResult onDraw(SkCanvas* canvas, SkString* errorMsg) {
+ DrawResult onDraw(SkCanvas* canvas, SkString* errorMsg) override {
SkBitmap bm, bm4444;
if (!GetResourceAsBitmap("images/dog.jpg", &bm)) {
*errorMsg = "Could not decode the file. Did you forget to set the resourcePath?";
@@ -49,16 +40,12 @@
canvas->drawBitmap(bm4444, SkIntToScalar(bm.width()), 0);
return DrawResult::kOk;
}
-
-private:
- typedef GM INHERITED;
};
-
-//////////////////////////////////////////////////////////////////////////////
+} // namespace
DEF_GM( return new CopyTo4444GM; )
-}
+//////////////////////////////////////////////////////////////////////////////
DEF_SIMPLE_GM(format4444, canvas, 64, 64) {
canvas->scale(16, 16);