Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(337)

Unified Diff: gm/shadows.cpp

Issue 1232463006: Fix up -Winconsistent-missing-override (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: llvm_coverage_build Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/dcshader.cpp ('k') | gm/simpleaaclip.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/shadows.cpp
diff --git a/gm/shadows.cpp b/gm/shadows.cpp
index 5c0e1e123a9d917c66d0b3885d13b092a162e85a..729104c980ea69abe32a511a1748fbfca95dcc8b 100644
--- a/gm/shadows.cpp
+++ b/gm/shadows.cpp
@@ -36,84 +36,84 @@ protected:
SkIntToScalar(30), SkIntToScalar(30));
}
- virtual SkString onShortName() {
+ SkString onShortName() override {
return SkString("shadows");
}
- virtual SkISize onISize() {
+ SkISize onISize() override {
return SkISize::Make(200, 120);
}
- virtual void onDraw(SkCanvas* canvas) {
- SkBlurDrawLooper* shadowLoopers[5];
- shadowLoopers[0] =
- SkBlurDrawLooper::Create(SK_ColorBLUE,
- SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(10)),
- SkIntToScalar(5), SkIntToScalar(10),
- SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
- SkBlurDrawLooper::kOverrideColor_BlurFlag |
- SkBlurDrawLooper::kHighQuality_BlurFlag);
- SkAutoUnref aurL0(shadowLoopers[0]);
- shadowLoopers[1] =
- SkBlurDrawLooper::Create(SK_ColorBLUE,
- SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(10)),
- SkIntToScalar(5), SkIntToScalar(10),
- SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
- SkBlurDrawLooper::kOverrideColor_BlurFlag);
- SkAutoUnref aurL1(shadowLoopers[1]);
- shadowLoopers[2] =
- SkBlurDrawLooper::Create(SK_ColorBLACK,
- SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)),
- SkIntToScalar(5),
- SkIntToScalar(10),
- SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
- SkBlurDrawLooper::kHighQuality_BlurFlag);
- SkAutoUnref aurL2(shadowLoopers[2]);
- shadowLoopers[3] =
- SkBlurDrawLooper::Create(0x7FFF0000,
- SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)),
- SkIntToScalar(-5), SkIntToScalar(-10),
- SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
- SkBlurDrawLooper::kOverrideColor_BlurFlag |
- SkBlurDrawLooper::kHighQuality_BlurFlag);
- SkAutoUnref aurL3(shadowLoopers[3]);
- shadowLoopers[4] =
- SkBlurDrawLooper::Create(SK_ColorBLACK, SkIntToScalar(0),
- SkIntToScalar(5), SkIntToScalar(5),
- SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
- SkBlurDrawLooper::kOverrideColor_BlurFlag |
- SkBlurDrawLooper::kHighQuality_BlurFlag);
- SkAutoUnref aurL4(shadowLoopers[4]);
-
- static const struct {
- SkColor fColor;
- SkScalar fStrokeWidth;
- } gRec[] = {
- { SK_ColorRED, -SK_Scalar1 },
- { SK_ColorGREEN, SkIntToScalar(4) },
- { SK_ColorBLUE, SkIntToScalar(0)},
- };
-
- SkPaint paint;
- paint.setAntiAlias(true);
- for (size_t i = 0; i < SK_ARRAY_COUNT(shadowLoopers); ++i) {
- SkAutoCanvasRestore acr(canvas, true);
-
- paint.setLooper(shadowLoopers[i]);
-
- canvas->translate(SkIntToScalar((unsigned int)i*40), SkIntToScalar(0));
- setup(&paint, gRec[0].fColor, gRec[0].fStrokeWidth);
- canvas->drawRect(fRect, paint);
-
- canvas->translate(SkIntToScalar(0), SkIntToScalar(40));
- setup(&paint, gRec[1].fColor, gRec[1].fStrokeWidth);
- canvas->drawPath(fCirclePath, paint);
-
- canvas->translate(SkIntToScalar(0), SkIntToScalar(40));
- setup(&paint, gRec[2].fColor, gRec[2].fStrokeWidth);
- canvas->drawPath(fCirclePath, paint);
+ void onDraw(SkCanvas* canvas) override {
+ SkBlurDrawLooper* shadowLoopers[5];
+ shadowLoopers[0] =
+ SkBlurDrawLooper::Create(SK_ColorBLUE,
+ SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(10)),
+ SkIntToScalar(5), SkIntToScalar(10),
+ SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
+ SkBlurDrawLooper::kOverrideColor_BlurFlag |
+ SkBlurDrawLooper::kHighQuality_BlurFlag);
+ SkAutoUnref aurL0(shadowLoopers[0]);
+ shadowLoopers[1] =
+ SkBlurDrawLooper::Create(SK_ColorBLUE,
+ SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(10)),
+ SkIntToScalar(5), SkIntToScalar(10),
+ SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
+ SkBlurDrawLooper::kOverrideColor_BlurFlag);
+ SkAutoUnref aurL1(shadowLoopers[1]);
+ shadowLoopers[2] =
+ SkBlurDrawLooper::Create(SK_ColorBLACK,
+ SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)),
+ SkIntToScalar(5),
+ SkIntToScalar(10),
+ SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
+ SkBlurDrawLooper::kHighQuality_BlurFlag);
+ SkAutoUnref aurL2(shadowLoopers[2]);
+ shadowLoopers[3] =
+ SkBlurDrawLooper::Create(0x7FFF0000,
+ SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)),
+ SkIntToScalar(-5), SkIntToScalar(-10),
+ SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
+ SkBlurDrawLooper::kOverrideColor_BlurFlag |
+ SkBlurDrawLooper::kHighQuality_BlurFlag);
+ SkAutoUnref aurL3(shadowLoopers[3]);
+ shadowLoopers[4] =
+ SkBlurDrawLooper::Create(SK_ColorBLACK, SkIntToScalar(0),
+ SkIntToScalar(5), SkIntToScalar(5),
+ SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
+ SkBlurDrawLooper::kOverrideColor_BlurFlag |
+ SkBlurDrawLooper::kHighQuality_BlurFlag);
+ SkAutoUnref aurL4(shadowLoopers[4]);
+
+ static const struct {
+ SkColor fColor;
+ SkScalar fStrokeWidth;
+ } gRec[] = {
+ { SK_ColorRED, -SK_Scalar1 },
+ { SK_ColorGREEN, SkIntToScalar(4) },
+ { SK_ColorBLUE, SkIntToScalar(0)},
+ };
+
+ SkPaint paint;
+ paint.setAntiAlias(true);
+ for (size_t i = 0; i < SK_ARRAY_COUNT(shadowLoopers); ++i) {
+ SkAutoCanvasRestore acr(canvas, true);
+
+ paint.setLooper(shadowLoopers[i]);
+
+ canvas->translate(SkIntToScalar((unsigned int)i*40), SkIntToScalar(0));
+ setup(&paint, gRec[0].fColor, gRec[0].fStrokeWidth);
+ canvas->drawRect(fRect, paint);
+
+ canvas->translate(SkIntToScalar(0), SkIntToScalar(40));
+ setup(&paint, gRec[1].fColor, gRec[1].fStrokeWidth);
+ canvas->drawPath(fCirclePath, paint);
+
+ canvas->translate(SkIntToScalar(0), SkIntToScalar(40));
+ setup(&paint, gRec[2].fColor, gRec[2].fStrokeWidth);
+ canvas->drawPath(fCirclePath, paint);
+ }
}
-}
private:
typedef GM INHERITED;
« no previous file with comments | « gm/dcshader.cpp ('k') | gm/simpleaaclip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698