Fix clang 12 Wsuggest-override and Wsuggest-destructor-override

Change-Id: Ic44e24057b95bb014504f02a736fb4341afc8971
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304856
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This commit is contained in:
Brian Salomon 2020-07-21 17:03:56 -04:00 committed by Skia Commit-Bot
parent 67fd3b8257
commit d007281c9a
64 changed files with 93 additions and 131 deletions

View File

@ -41,8 +41,8 @@ public:
}
protected:
virtual const char* onGetName() { return fName.c_str(); }
virtual void onDraw(int loops, SkCanvas* canvas) {
const char* onGetName() override { return fName.c_str(); }
void onDraw(int loops, SkCanvas* canvas) override {
SkPaint paint;
this->setupPaint(&paint);
@ -111,7 +111,7 @@ public:
}
protected:
virtual const char* onGetName() { return fName.c_str(); }
const char* onGetName() override { return fName.c_str(); }
void recurse(SkCanvas* canvas,
@ -156,7 +156,7 @@ protected:
canvas->restore();
}
virtual void onDraw(int loops, SkCanvas* canvas) {
void onDraw(int loops, SkCanvas* canvas) override {
for (int i = 0; i < loops; ++i) {
SkPoint offset = SkPoint::Make(0, 0);
@ -192,8 +192,8 @@ public:
}
protected:
virtual const char* onGetName() { return fName.c_str(); }
virtual void onDraw(int loops, SkCanvas*) {
const char* onGetName() override { return fName.c_str(); }
void onDraw(int loops, SkCanvas*) override {
SkPaint paint;
this->setupPaint(&paint);
@ -227,8 +227,8 @@ public:
}
protected:
virtual const char* onGetName() { return "aaclip_setregion"; }
virtual void onDraw(int loops, SkCanvas*) {
const char* onGetName() override { return "aaclip_setregion"; }
void onDraw(int loops, SkCanvas*) override {
for (int i = 0; i < loops; ++i) {
SkAAClip clip;
clip.setRegion(fRegion);

View File

@ -75,11 +75,11 @@ public:
}
protected:
virtual const char* onGetName() {
const char* onGetName() override {
return fName.c_str();
}
virtual void onDraw(int loops, SkCanvas* canvas) {
void onDraw(int loops, SkCanvas* canvas) override {
fRec.fCanvas = canvas;
this->setupPaint(&fRec.fPaint);
fRec.fPaint.setStyle(SkPaint::kStroke_Style);

View File

@ -39,7 +39,7 @@ public:
}
protected:
virtual const char* onGetName() {
const char* onGetName() override {
return fName.c_str();
}
@ -51,7 +51,7 @@ protected:
fName = name;
}
virtual void onDraw(int loops, SkCanvas*) {
void onDraw(int loops, SkCanvas*) override {
SkPaint paint;
this->setupPaint(&paint);

View File

@ -460,8 +460,8 @@ public:
protected:
virtual const char* onGetName() { return "chrome_scrollGmail"; }
virtual void onDraw(int loops, SkCanvas* canvas) {
const char* onGetName() override { return "chrome_scrollGmail"; }
void onDraw(int loops, SkCanvas* canvas) override {
SkDEBUGCODE(this->validateBounds(canvas));
SkPaint paint;
this->setupPaint(&paint);
@ -473,7 +473,7 @@ protected:
}
}
}
virtual SkIPoint onGetSize() { return SkIPoint::Make(W, H); }
SkIPoint onGetSize() override { return SkIPoint::Make(W, H); }
void setRectangle(SkRect& current, int i) {
current.setWH(SkIntToScalar(gmailScrollingRectSpec[i*3+1]),

View File

@ -46,7 +46,7 @@ public:
protected:
SkRect fRects[2048];
virtual void onDelayedSetup() {
void onDelayedSetup() override {
const SkScalar min = -100;
const SkScalar max = 100;
SkRandom rand;

View File

@ -319,11 +319,11 @@ public:
}
protected:
virtual const char* onGetName() {
const char* onGetName() override {
return fName.c_str();
}
virtual void onDraw(int loops, SkCanvas* canvas) {
void onDraw(int loops, SkCanvas* canvas) override {
SkPaint paint;
this->setupPaint(&paint);

View File

@ -46,10 +46,10 @@ public:
, fZoomPeriodMs(zoomPeriodMs) {
}
virtual const char* getTag() { return "zoom"; }
const char* getTag() override { return "zoom"; }
virtual void preConcatFrameMatrix(double animationTimeMs, const SkIRect& devBounds,
SkMatrix* drawMatrix) {
void preConcatFrameMatrix(double animationTimeMs, const SkIRect& devBounds,
SkMatrix* drawMatrix) override {
double t = fmod(animationTimeMs / fZoomPeriodMs, 1.0); // t is in [0, 1).
t = fabs(2 * t - 1); // Make t ping-pong between 0 and 1
SkScalar zoom = static_cast<SkScalar>(pow(fZoomMax, t));

View File

@ -23,7 +23,6 @@ public:
virtual const char* getTag() = 0;
virtual void preConcatFrameMatrix(double animationTimeMs, const SkIRect& devBounds,
SkMatrix* drawMatrix) = 0;
virtual ~Animation() {}
};
SKPAnimationBench(const char* name, const SkPicture*, const SkIRect& devClip, sk_sp<Animation>,

View File

@ -56,8 +56,8 @@ public:
init9(fArray);
}
protected:
virtual int mulLoopCount() const { return 4; }
virtual void performTest() {
int mulLoopCount() const override { return 4; }
void performTest() override {
// xoring into a volatile prevents the compiler from optimizing these checks away.
volatile bool junk = false;
junk ^= (fArray[6] != 0.0f || fArray[7] != 0.0f || fArray[8] != 1.0f);
@ -75,8 +75,8 @@ public:
init9(fArray);
}
protected:
virtual int mulLoopCount() const { return 4; }
virtual void performTest() {
int mulLoopCount() const override { return 4; }
void performTest() override {
// xoring into a volatile prevents the compiler from optimizing these checks away.
volatile int32_t junk = 0;
junk ^= (SkScalarAs2sCompliment(fArray[6]) |

View File

@ -29,11 +29,11 @@ public:
static const int kNumCols = 32;
protected:
virtual const char* onGetName() {
const char* onGetName() override {
return "tablebench";
}
virtual void onDraw(int loops, SkCanvas* canvas) {
void onDraw(int loops, SkCanvas* canvas) override {
SkPaint cellPaint;
cellPaint.setColor(0xFFFFFFF);

View File

@ -73,11 +73,11 @@ public:
}
protected:
virtual const char* onGetName() {
const char* onGetName() override {
return fName.c_str();
}
virtual void onDraw(int loops, SkCanvas* canvas) {
void onDraw(int loops, SkCanvas* canvas) override {
SkPaint paint(fPaint);
this->setupPaint(&paint);
paint.setFilterQuality(fDoFilter ? kLow_SkFilterQuality

View File

@ -13,13 +13,10 @@
class SkSVGClipPath final : public SkSVGHiddenContainer {
public:
virtual ~SkSVGClipPath() = default;
static sk_sp<SkSVGClipPath> Make() {
return sk_sp<SkSVGClipPath>(new SkSVGClipPath());
}
protected:
private:
SkSVGClipPath();

View File

@ -21,7 +21,6 @@ class SkSVGNode;
class SkSVGDOM : public SkRefCnt {
public:
SkSVGDOM();
~SkSVGDOM() = default;
static sk_sp<SkSVGDOM> MakeFromDOM(const SkDOM&);
static sk_sp<SkSVGDOM> MakeFromStream(SkStream&);

View File

@ -12,7 +12,6 @@
class SkSVGDefs : public SkSVGHiddenContainer {
public:
virtual ~SkSVGDefs() = default;
static sk_sp<SkSVGDefs> Make() { return sk_sp<SkSVGDefs>(new SkSVGDefs()); }
private:

View File

@ -12,8 +12,6 @@
class SkSVGG : public SkSVGContainer {
public:
virtual ~SkSVGG() = default;
static sk_sp<SkSVGG> Make() { return sk_sp<SkSVGG>(new SkSVGG()); }
private:

View File

@ -11,9 +11,6 @@
#include "experimental/svg/model/SkSVGContainer.h"
class SkSVGHiddenContainer : public SkSVGContainer {
public:
virtual ~SkSVGHiddenContainer() = default;
protected:
explicit SkSVGHiddenContainer(SkSVGTag t) : INHERITED(t) {}

View File

@ -40,7 +40,7 @@ enum class SkSVGTag {
class SkSVGNode : public SkRefCnt {
public:
virtual ~SkSVGNode();
~SkSVGNode() override;
SkSVGTag tag() const { return fTag; }

View File

@ -36,15 +36,15 @@ public:
protected:
SkString onShortName() {
SkString onShortName() override {
SkString str;
str.printf("complexclip3_%s", fDoSimpleClipFirst ? "simple" : "complex");
return str;
}
SkISize onISize() { return SkISize::Make(400, 950); }
SkISize onISize() override { return SkISize::Make(400, 950); }
virtual void onDraw(SkCanvas* canvas) {
void onDraw(SkCanvas* canvas) override {
SkPath clipSimple;
clipSimple.addCircle(SkIntToScalar(70), SkIntToScalar(50), SkIntToScalar(20));

View File

@ -29,16 +29,14 @@ public:
}
protected:
SkString onShortName() {
SkString onShortName() override {
SkString str;
str.printf("complexclip4_%s",
fDoAAClip ? "aa" : "bw");
return str;
}
SkISize onISize() { return SkISize::Make(970, 780); }
SkISize onISize() override { return SkISize::Make(970, 780); }
// Android Framework will still support the legacy kReplace SkClipOp on older devices, so
// this represents how to do so while also respecting the device restriction using the newer
@ -71,7 +69,7 @@ protected:
canvas->clipPath(path, SkClipOp::kIntersect, aa);
}
virtual void onDraw(SkCanvas* canvas) {
void onDraw(SkCanvas* canvas) override {
SkPaint p;
p.setAntiAlias(fDoAAClip);
p.setColor(SK_ColorYELLOW);

View File

@ -199,8 +199,6 @@ static void draw_text(SkCanvas* canvas, const char* text) {
class ClipTileRenderer : public SkRefCntBase {
public:
virtual ~ClipTileRenderer() {}
// Draw the base rect, possibly clipped by 'clip' if that is not null. The edges to antialias
// are specified in 'edgeAA' (to make manipulation easier than an unsigned bitfield). 'tileID'
// represents the location of rect within the tile grid, 'quadID' is the unique ID of the clip

View File

@ -16,7 +16,6 @@
class SkBBoxHierarchy : public SkRefCnt {
public:
SkBBoxHierarchy() {}
virtual ~SkBBoxHierarchy() {}
struct Metadata {
bool isDraw; // The corresponding SkRect bounds a draw command, not a pure state change.

View File

@ -108,7 +108,7 @@ private:
SkDataTable(const void* array, size_t elemSize, int count,
FreeProc, void* context);
SkDataTable(const Dir*, int count, FreeProc, void* context);
virtual ~SkDataTable();
~SkDataTable() override;
friend class SkDataTableBuilder; // access to Dir

View File

@ -64,7 +64,7 @@ protected:
// note: subclasses must call close() in their destructor, as the base class
// cannot do this for them.
virtual ~SkDocument();
~SkDocument() override;
virtual SkCanvas* onBeginPage(SkScalar width, SkScalar height) = 0;
virtual void onEndPage() = 0;

View File

@ -59,7 +59,7 @@ public:
private:
SkROBuffer(const SkBufferHead* head, size_t available, const SkBufferBlock* fTail);
virtual ~SkROBuffer();
~SkROBuffer() override;
const SkBufferHead* fHead;
const size_t fAvailable;

View File

@ -345,7 +345,7 @@ protected:
/** uniqueID must be unique and non-zero
*/
SkTypeface(const SkFontStyle& style, bool isFixedPitch = false);
virtual ~SkTypeface();
~SkTypeface() override;
virtual sk_sp<SkTypeface> onMakeClone(const SkFontArguments&) const = 0;

View File

@ -131,7 +131,7 @@ public:
bool usesSampleCoords() const { return fMainFunctionHasSampleCoords; }
static void RegisterFlattenables();
~SkRuntimeEffect();
~SkRuntimeEffect() override;
private:
SkRuntimeEffect(SkString sksl,

View File

@ -22,7 +22,7 @@ class GrRecordingContext;
class GrContext_Base : public SkRefCnt {
public:
virtual ~GrContext_Base();
~GrContext_Base() override;
/*
* Safely downcast to a GrDirectContext.

View File

@ -706,7 +706,7 @@ DEF_TEST(Skottie_Image_Loading, reporter) {
private:
sk_sp<ImageAsset> loadImageAsset(const char path[],
const char name[],
const char id[]) const {
const char id[]) const override {
return strcmp(id, "single_frame")
? fMultiFrameAsset
: fSingleFrameAsset;

View File

@ -28,8 +28,6 @@ class KeyframeAnimatorBuilder;
class Animator : public SkRefCnt {
public:
virtual ~Animator() = default;
using StateChanged = bool;
StateChanged seek(float t) { return this->onSeek(t); }

View File

@ -144,7 +144,7 @@ sk_sp<sksg::RenderNode> AnimationBuilder::attachExternalPrecompLayer(
, fFps(fps) {}
private:
StateChanged onSeek(float t) {
StateChanged onSeek(float t) override {
fSGAdapter->setT(t / fFps);
return true;

View File

@ -19,8 +19,6 @@ class FontCollection : public SkRefCnt {
public:
FontCollection();
~FontCollection() = default;
size_t getFontManagersCount() const;
void setAssetFontManager(sk_sp<SkFontMgr> fontManager);

View File

@ -107,8 +107,6 @@ public:
this->disableFontFallback();
}
~ResourceFontCollection() = default;
size_t resolvedFonts() const { return fResolvedFonts; }
// TODO: temp solution until we check in fonts

View File

@ -8,7 +8,6 @@ namespace textlayout {
class TestFontCollection : public FontCollection {
public:
TestFontCollection(const std::string& resourceDir, bool testOnly = false, bool loadFonts = true);
~TestFontCollection() = default;
size_t fontsFound() const { return fFontsFound; }
bool addFontFromFile(const std::string& path, const std::string& familyName = "");

View File

@ -14,9 +14,9 @@ public:
TwoPtConicalView() {}
protected:
virtual SkString name() { return SkString("2PtConical"); }
SkString name() override { return SkString("2PtConical"); }
virtual void onDrawContent(SkCanvas* canvas) {
void onDrawContent(SkCanvas* canvas) override {
canvas->translate(SkIntToScalar(10), SkIntToScalar(20));
SkColor colors[] = { SK_ColorRED, SK_ColorBLUE };

View File

@ -541,9 +541,7 @@ struct BiControl : public UniControl {
, fValHi(fMax) {
}
virtual ~BiControl() {}
virtual void draw(SkCanvas* canvas, const ControlPaints& paints) {
void draw(SkCanvas* canvas, const ControlPaints& paints) override {
UniControl::draw(canvas, paints);
if (!fVisible || fValHi == fValLo) {
return;

View File

@ -86,9 +86,9 @@ public:
}
protected:
virtual SkString name() { return SkString("Effects"); }
SkString name() override { return SkString("Effects"); }
virtual void onDrawContent(SkCanvas* canvas) {
void onDrawContent(SkCanvas* canvas) override {
canvas->scale(3, 3);
canvas->translate(10, 30);
for (size_t i = 0; i < SK_ARRAY_COUNT(fPaint); i++) {

View File

@ -33,9 +33,9 @@ public:
}
protected:
virtual SkString name() { return SkString("Emboss"); }
SkString name() override { return SkString("Emboss"); }
virtual void onDrawContent(SkCanvas* canvas) {
void onDrawContent(SkCanvas* canvas) override {
SkPaint paint;
paint.setAntiAlias(true);

View File

@ -25,7 +25,7 @@ public:
}
protected:
virtual SkString name() { return SkString("FillType"); }
SkString name() override{ return SkString("FillType"); }
void showPath(SkCanvas* canvas, int x, int y, SkPathFillType ft,
SkScalar scale, const SkPaint& paint) {
@ -55,7 +55,7 @@ protected:
scale, paint);
}
virtual void onDrawContent(SkCanvas* canvas) {
void onDrawContent(SkCanvas* canvas) override {
canvas->translate(SkIntToScalar(20), SkIntToScalar(20));
SkPaint paint;

View File

@ -20,7 +20,7 @@ public:
}
protected:
virtual SkString name() { return SkString("LayerMask"); }
SkString name() override { return SkString("LayerMask"); }
void drawMask(SkCanvas* canvas, const SkRect& r) {
SkPaint paint;
@ -48,7 +48,7 @@ protected:
}
}
virtual void onDrawContent(SkCanvas* canvas) {
void onDrawContent(SkCanvas* canvas) override {
SkRect r;
r.setLTRB(20, 20, 120, 120);
canvas->saveLayer(&r, nullptr);

View File

@ -69,7 +69,7 @@ public:
}
protected:
virtual SkString name() { return SkString("PolyToPolyView"); }
SkString name() override { return SkString("PolyToPolyView"); }
static void doDraw(SkCanvas* canvas, SkPaint* paint, const SkFont& font, const int isrc[],
const int idst[], int count) {
@ -105,7 +105,7 @@ protected:
canvas->restore();
}
virtual void onDrawContent(SkCanvas* canvas) {
void onDrawContent(SkCanvas* canvas) override {
SkPaint paint;
paint.setAntiAlias(true);
paint.setStrokeWidth(SkIntToScalar(4));

View File

@ -13,9 +13,9 @@ public:
StrokeRectSample() {}
protected:
virtual SkString name() { return SkString("Stroke Rects"); }
SkString name() override { return SkString("Stroke Rects"); }
virtual void onDrawContent(SkCanvas* canvas) {
void onDrawContent(SkCanvas* canvas) override {
SkPaint paint;
paint.setAntiAlias(true);
paint.setStyle(SkPaint::kStroke_Style);

View File

@ -21,8 +21,6 @@ public:
static constexpr SkScalar kTileWidth = 20.f;
static constexpr SkScalar kTileHeight = 20.f;
virtual ~ShapeRenderer() {}
// Draw the shape, limited to kTileWidth x kTileHeight. It must apply the local subpixel (tx,
// ty) translation and rotation by angle. Prior to these transform adjustments, the SkCanvas
// will only have pixel aligned translations (these are separated to make super-sampling

View File

@ -32,9 +32,9 @@ public:
WritePixelsView() {}
protected:
virtual SkString name() { return SkString("WritePixels"); }
SkString name() override { return SkString("WritePixels"); }
virtual void onDrawContent(SkCanvas* canvas) {
void onDrawContent(SkCanvas* canvas) override {
SkBitmap bitmap;
create_bitmap(&bitmap);
int x = bitmap.width() / 2;

View File

@ -73,9 +73,9 @@ public:
}
protected:
virtual SkString name() { return SkString("XfermodesBlur"); }
SkString name() override { return SkString("XfermodesBlur"); }
virtual void onDrawContent(SkCanvas* canvas) {
void onDrawContent(SkCanvas* canvas) override {
canvas->translate(SkIntToScalar(10), SkIntToScalar(20));
const SkBlendMode gModes[] = {

View File

@ -35,7 +35,7 @@ public:
*/
SkShaderBlitter(const SkPixmap& device, const SkPaint& paint,
SkShaderBase::Context* shaderContext);
virtual ~SkShaderBlitter();
~SkShaderBlitter() override;
protected:
uint32_t fShaderFlags;

View File

@ -55,7 +55,7 @@ public:
enum { kDefaultTransientSize = 32 * 1024 * 1024 };
virtual ~SkImageFilterCache() {}
~SkImageFilterCache() override {}
static SkImageFilterCache* Create(size_t maxBytes);
static SkImageFilterCache* Get();

View File

@ -127,12 +127,12 @@ private:
*/
class SkRefCntSet : public SkTPtrSet<SkRefCnt*> {
public:
virtual ~SkRefCntSet();
~SkRefCntSet() override;
protected:
// overrides
virtual void incPtr(void*);
virtual void decPtr(void*);
virtual void incPtr(void*) override ;
virtual void decPtr(void*) override ;
};
class SkFactorySet : public SkTPtrSet<SkFlattenable::Factory> {};

View File

@ -28,7 +28,7 @@
class SkRecord : public SkRefCnt {
public:
SkRecord() = default;
~SkRecord();
~SkRecord() override;
// Returns the number of canvas commands in this SkRecord.
int count() const { return fCount; }

View File

@ -18,8 +18,6 @@ public:
, fCanvas(nullptr) {
}
virtual ~SkSpecialSurface_Base() { }
// reset is called after an SkSpecialImage has been snapped
void reset() { fCanvas.reset(); }

View File

@ -726,7 +726,7 @@ class SkBlockMemoryRefCnt : public SkRefCnt {
public:
explicit SkBlockMemoryRefCnt(SkDynamicMemoryWStream::Block* head) : fHead(head) { }
virtual ~SkBlockMemoryRefCnt() {
~SkBlockMemoryRefCnt() override {
SkDynamicMemoryWStream::Block* block = fHead;
while (block != nullptr) {
SkDynamicMemoryWStream::Block* next = block->fNext;

View File

@ -31,7 +31,6 @@ public:
// Because of this, size needs to be a power of two.
SkASSERT(SkIsPow2(size));
}
virtual ~GrRingBuffer() = default;
struct Slice {
sk_sp<GrGpuBuffer> fBuffer;

View File

@ -63,7 +63,7 @@ public:
int vertexStride,
int instanceStride);
~GrGLProgram();
~GrGLProgram() override;
/**
* Call to abandon GL objects owned by this program.

View File

@ -34,7 +34,7 @@ enum {
class SkImage_Base : public SkImage {
public:
virtual ~SkImage_Base();
~SkImage_Base() override;
virtual SkIRect onGetSubset() const {
return { 0, 0, this->width(), this->height() };

View File

@ -18,7 +18,7 @@ class SkSurface_Base : public SkSurface {
public:
SkSurface_Base(int width, int height, const SkSurfaceProps*);
SkSurface_Base(const SkImageInfo&, const SkSurfaceProps*);
virtual ~SkSurface_Base();
~SkSurface_Base() override;
virtual GrContext* onGetContext_deprecated();
virtual GrRecordingContext* onGetRecordingContext();

View File

@ -27,8 +27,6 @@
*/
class SkDiscardableMemoryPool : public SkDiscardableMemory::Factory {
public:
virtual ~SkDiscardableMemoryPool() { }
virtual size_t getRAMUsed() = 0;
virtual void setRAMBudget(size_t budget) = 0;
virtual size_t getRAMBudget() = 0;

View File

@ -55,7 +55,7 @@ namespace {
struct FooRefCnt : public SkRefCnt {
FooRefCnt() : x(-2), y(-3.0f) { created++; }
FooRefCnt(int X, float Y) : x(X), y(Y) { created++; }
~FooRefCnt() { destroyed++; }
~FooRefCnt() override { destroyed++; }
int x;
float y;

View File

@ -482,7 +482,7 @@ public:
LifeLineCanvas(int w, int h, bool* lifeline) : SkCanvas(w, h), fLifeLine(lifeline) {
*fLifeLine = true;
}
~LifeLineCanvas() {
~LifeLineCanvas() override {
*fLifeLine = false;
}
};

View File

@ -66,15 +66,14 @@ std::unique_ptr<GrMemoryPool> A::gPool;
class B : public A {
public:
B() {}
virtual void setValues(int v) {
void setValues(int v) override {
fDouble = static_cast<double>(v);
this->INHERITED::setValues(v);
}
virtual bool checkValues(int v) {
bool checkValues(int v) override {
return fDouble == static_cast<double>(v) &&
this->INHERITED::checkValues(v);
}
virtual ~B() {}
private:
double fDouble;
@ -85,15 +84,14 @@ private:
class C : public A {
public:
C() {}
virtual void setValues(int v) {
void setValues(int v) override {
fInt64 = static_cast<int64_t>(v);
this->INHERITED::setValues(v);
}
virtual bool checkValues(int v) {
bool checkValues(int v) override {
return fInt64 == static_cast<int64_t>(v) &&
this->INHERITED::checkValues(v);
}
virtual ~C() {}
private:
int64_t fInt64;
@ -107,17 +105,17 @@ public:
D() {
fB = new B();
}
virtual void setValues(int v) {
void setValues(int v) override {
fVoidStar = reinterpret_cast<void*>(static_cast<intptr_t>(v));
this->INHERITED::setValues(v);
fB->setValues(v);
}
virtual bool checkValues(int v) {
bool checkValues(int v) override {
return fVoidStar == reinterpret_cast<void*>(static_cast<intptr_t>(v)) &&
fB->checkValues(v) &&
this->INHERITED::checkValues(v);
}
virtual ~D() {
~D() override {
delete fB;
}
private:
@ -130,13 +128,13 @@ private:
class E : public A {
public:
E() {}
virtual void setValues(int v) {
void setValues(int v) override {
for (size_t i = 0; i < SK_ARRAY_COUNT(fIntArray); ++i) {
fIntArray[i] = v;
}
this->INHERITED::setValues(v);
}
virtual bool checkValues(int v) {
bool checkValues(int v) override {
bool ok = true;
for (size_t i = 0; ok && i < SK_ARRAY_COUNT(fIntArray); ++i) {
if (fIntArray[i] != v) {
@ -145,7 +143,6 @@ public:
}
return ok && this->INHERITED::checkValues(v);
}
virtual ~E() {}
private:
int fIntArray[20];

View File

@ -728,12 +728,12 @@ public:
, fCurrIndex(0)
{}
~TestAnnotationCanvas() {
~TestAnnotationCanvas() override {
REPORTER_ASSERT(fReporter, fCount == fCurrIndex);
}
protected:
void onDrawAnnotation(const SkRect& rect, const char key[], SkData* value) {
void onDrawAnnotation(const SkRect& rect, const char key[], SkData* value) override {
REPORTER_ASSERT(fReporter, fCurrIndex < fCount);
REPORTER_ASSERT(fReporter, rect == fRec[fCurrIndex].fRect);
REPORTER_ASSERT(fReporter, !strcmp(key, fRec[fCurrIndex].fKey));

View File

@ -38,7 +38,7 @@ public:
: fContext(direct)
, fBackendFormat(backendFormat) {}
~PromiseImageCallbackContext();
~PromiseImageCallbackContext() override;
const GrBackendFormat& backendFormat() const { return fBackendFormat; }

View File

@ -47,7 +47,7 @@ struct SkTestFontData {
class SkTestFont : public SkRefCnt {
public:
SkTestFont(const SkTestFontData&);
virtual ~SkTestFont();
~SkTestFont() override;
SkGlyphID glyphForUnichar(SkUnichar charCode) const;
void init(const SkScalar* pts, const unsigned char* verbs);

View File

@ -77,8 +77,8 @@ void BaseOption::Init(const std::vector<BaseOption*> &option_list,
}
struct DoubleOption : Option<double> {
virtual void set(std::string _value) { value = atof(_value.c_str()); }
virtual std::string valueToString() {
void set(std::string _value) override { value = atof(_value.c_str()); }
std::string valueToString() override {
std::ostringstream stm;
stm << value;
return stm.str();
@ -90,8 +90,8 @@ struct DoubleOption : Option<double> {
};
struct StringOption : Option<std::string> {
virtual void set(std::string _value) { value = _value; }
virtual std::string valueToString() { return value; }
void set(std::string _value) override { value = _value; }
std::string valueToString() override { return value; }
StringOption(std::string _selector,
std::string _description,
std::string defaultValue)

View File

@ -18,8 +18,6 @@ class SkMetaData;
class Slide : public SkRefCnt {
public:
virtual ~Slide() {}
virtual SkISize getDimensions() const = 0;
virtual void gpuTeardown() { }

View File

@ -26,7 +26,6 @@
class SlideDir::Animator : public SkRefCnt {
public:
virtual ~Animator() = default;
Animator(const Animator&) = delete;
Animator& operator=(const Animator&) = delete;
@ -195,7 +194,7 @@ public:
}
protected:
void onTick(float t) {
void onTick(float t) override {
if (!this->isAnimating())
return;