Cleanup: Mark some overridden methods with 'SK_OVERRIDE'.
This fixes errors like this:
../../include/gpu/effects/GrPorterDuffXferProcessor.h:27:25: error:
'name' overrides a member function but is not marked 'override'
[-Werror,-Winconsistent-missing-override]
BUG=skia:3075
TEST=ninja -C out/Debug skia_lib
TBR=bsalomon@google.com
Review URL: https://codereview.chromium.org/804813002
diff --git a/include/effects/SkLayerRasterizer.h b/include/effects/SkLayerRasterizer.h
index 1d66383..02dfc35 100644
--- a/include/effects/SkLayerRasterizer.h
+++ b/include/effects/SkLayerRasterizer.h
@@ -74,7 +74,7 @@
// override from SkRasterizer
virtual bool onRasterize(const SkPath& path, const SkMatrix& matrix,
const SkIRect* clipBounds,
- SkMask* mask, SkMask::CreateMode mode) const;
+ SkMask* mask, SkMask::CreateMode mode) const SK_OVERRIDE;
private:
const SkDeque* const fLayers;
diff --git a/include/effects/SkPixelXorXfermode.h b/include/effects/SkPixelXorXfermode.h
index 758a5e9..275bc17 100644
--- a/include/effects/SkPixelXorXfermode.h
+++ b/include/effects/SkPixelXorXfermode.h
@@ -29,7 +29,7 @@
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
// override from SkXfermode
- virtual SkPMColor xferColor(SkPMColor src, SkPMColor dst) const;
+ virtual SkPMColor xferColor(SkPMColor src, SkPMColor dst) const SK_OVERRIDE;
private:
SkColor fOpColor;
diff --git a/include/gpu/effects/GrPorterDuffXferProcessor.h b/include/gpu/effects/GrPorterDuffXferProcessor.h
index 5949974..6c860b9 100644
--- a/include/gpu/effects/GrPorterDuffXferProcessor.h
+++ b/include/gpu/effects/GrPorterDuffXferProcessor.h
@@ -24,7 +24,7 @@
virtual ~GrPorterDuffXferProcessor();
- virtual const char* name() const { return "Porter Duff"; }
+ virtual const char* name() const SK_OVERRIDE { return "Porter Duff"; }
void getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const SK_OVERRIDE;
diff --git a/include/utils/SkDeferredCanvas.h b/include/utils/SkDeferredCanvas.h
index fca4dcd..e128707 100644
--- a/include/utils/SkDeferredCanvas.h
+++ b/include/utils/SkDeferredCanvas.h
@@ -235,7 +235,7 @@
};
protected:
- virtual SkCanvas* canvasForDrawIter();
+ virtual SkCanvas* canvasForDrawIter() SK_OVERRIDE;
SkDeferredDevice* getDeferredDevice() const;
private:
diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp
index 32f94d9..2fa9e5d 100644
--- a/src/effects/SkColorMatrixFilter.cpp
+++ b/src/effects/SkColorMatrixFilter.cpp
@@ -416,7 +416,7 @@
this->initClassID<ColorMatrixEffect>();
}
- virtual bool onIsEqual(const GrFragmentProcessor& s) const {
+ virtual bool onIsEqual(const GrFragmentProcessor& s) const SK_OVERRIDE {
const ColorMatrixEffect& cme = s.cast<ColorMatrixEffect>();
return cme.fMatrix == fMatrix;
}
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index e53cb02..8acd7fd 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -590,7 +590,7 @@
return fDirection;
};
SkPoint3 lightColor(const SkPoint3&) const { return color(); }
- virtual LightType type() const { return kDistant_LightType; }
+ virtual LightType type() const SK_OVERRIDE { return kDistant_LightType; }
const SkPoint3& direction() const { return fDirection; }
virtual GrGLLight* createGLLight() const SK_OVERRIDE {
#if SK_SUPPORT_GPU
@@ -620,7 +620,7 @@
SkDistantLight(const SkPoint3& direction, const SkPoint3& color)
: INHERITED(color), fDirection(direction) {
}
- virtual SkLight* transform(const SkMatrix& matrix) const {
+ virtual SkLight* transform(const SkMatrix& matrix) const SK_OVERRIDE {
return new SkDistantLight(direction(), color());
}
virtual void onFlattenLight(SkWriteBuffer& buffer) const SK_OVERRIDE {
@@ -647,7 +647,7 @@
return direction;
};
SkPoint3 lightColor(const SkPoint3&) const { return color(); }
- virtual LightType type() const { return kPoint_LightType; }
+ virtual LightType type() const SK_OVERRIDE { return kPoint_LightType; }
const SkPoint3& location() const { return fLocation; }
virtual GrGLLight* createGLLight() const SK_OVERRIDE {
#if SK_SUPPORT_GPU
@@ -666,7 +666,7 @@
return INHERITED::isEqual(other) &&
fLocation == o.fLocation;
}
- virtual SkLight* transform(const SkMatrix& matrix) const {
+ virtual SkLight* transform(const SkMatrix& matrix) const SK_OVERRIDE {
SkPoint location2 = SkPoint::Make(fLocation.fX, fLocation.fY);
matrix.mapPoints(&location2, 1);
// Use X scale and Y scale on Z and average the result
@@ -710,7 +710,7 @@
fConeScale = SkScalarInvert(antiAliasThreshold);
}
- virtual SkLight* transform(const SkMatrix& matrix) const {
+ virtual SkLight* transform(const SkMatrix& matrix) const SK_OVERRIDE {
SkPoint location2 = SkPoint::Make(fLocation.fX, fLocation.fY);
matrix.mapPoints(&location2, 1);
// Use X scale and Y scale on Z and average the result
@@ -755,7 +755,7 @@
#endif
}
virtual bool requiresFragmentPosition() const SK_OVERRIDE { return true; }
- virtual LightType type() const { return kSpot_LightType; }
+ virtual LightType type() const SK_OVERRIDE { return kSpot_LightType; }
const SkPoint3& location() const { return fLocation; }
const SkPoint3& target() const { return fTarget; }
SkScalar specularExponent() const { return fSpecularExponent; }
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp
index 6bd5d83..1da8c7a 100644
--- a/src/effects/gradients/SkLinearGradient.cpp
+++ b/src/effects/gradients/SkLinearGradient.cpp
@@ -493,7 +493,7 @@
virtual ~GrLinearGradient() { }
- virtual const char* name() const { return "Linear Gradient"; }
+ virtual const char* name() const SK_OVERRIDE { return "Linear Gradient"; }
virtual void getGLProcessorKey(const GrGLCaps& caps,
GrProcessorKeyBuilder* b) const SK_OVERRIDE {
diff --git a/src/effects/gradients/SkTwoPointConicalGradient.h b/src/effects/gradients/SkTwoPointConicalGradient.h
index 941d12b..3537791 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient.h
+++ b/src/effects/gradients/SkTwoPointConicalGradient.h
@@ -60,7 +60,7 @@
virtual BitmapType asABitmap(SkBitmap* bitmap,
SkMatrix* matrix,
- TileMode* xy) const;
+ TileMode* xy) const SK_OVERRIDE;
virtual SkShader::GradientType asAGradient(GradientInfo* info) const SK_OVERRIDE;
virtual bool asFragmentProcessor(GrContext*, const SkPaint&, const SkMatrix*, GrColor*,
GrFragmentProcessor**) const SK_OVERRIDE;
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index 770e885..26de867 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -844,7 +844,7 @@
GrClipMaskManager fClipMaskManager;
private:
- GrClipMaskManager* clipMaskManager() { return &fClipMaskManager; }
+ GrClipMaskManager* clipMaskManager() SK_OVERRIDE { return &fClipMaskManager; }
virtual bool setupClip(const SkRect* devBounds,
GrDrawState::AutoRestoreEffects* are,
diff --git a/src/gpu/GrGeometryProcessor.h b/src/gpu/GrGeometryProcessor.h
index 50ecac4..7481515 100644
--- a/src/gpu/GrGeometryProcessor.h
+++ b/src/gpu/GrGeometryProcessor.h
@@ -80,8 +80,6 @@
, fHasVertexCoverage(false)
, fHasLocalCoords(false) {}
- virtual const char* name() const = 0;
-
/**
* Sets a unique key on the GrProcessorKeyBuilder that is directly associated with this geometry
* processor's GL backend implementation.
@@ -161,7 +159,7 @@
virtual void initBatchTracker(GrBatchTracker*, const InitBT&) const {}
GrColor color() const { return fColor; }
- uint8_t coverage() const { return fCoverage; }
+ uint8_t coverage() const SK_OVERRIDE { return fCoverage; }
// TODO this is a total hack until the gp can own whether or not it uses uniform
// color / coverage
diff --git a/src/gpu/GrInOrderDrawBuffer.h b/src/gpu/GrInOrderDrawBuffer.h
index 9b850a7..060e42e 100644
--- a/src/gpu/GrInOrderDrawBuffer.h
+++ b/src/gpu/GrInOrderDrawBuffer.h
@@ -42,7 +42,7 @@
~GrInOrderDrawBuffer() SK_OVERRIDE;
// tracking for draws
- DrawToken getCurrentDrawToken() { return DrawToken(this, fDrawID); }
+ DrawToken getCurrentDrawToken() SK_OVERRIDE { return DrawToken(this, fDrawID); }
void clearStencilClip(const SkIRect& rect,
bool insideClip,
@@ -250,7 +250,7 @@
// Records any trace markers for a command after adding it to the buffer.
void recordTraceMarkersIfNecessary();
- virtual bool isIssued(uint32_t drawID) { return drawID != fDrawID; }
+ virtual bool isIssued(uint32_t drawID) SK_OVERRIDE { return drawID != fDrawID; }
// TODO: Use a single allocator for commands and records
enum {
diff --git a/src/gpu/SkGpuDevice.h b/src/gpu/SkGpuDevice.h
index 9023a63..b600f99 100644
--- a/src/gpu/SkGpuDevice.h
+++ b/src/gpu/SkGpuDevice.h
@@ -95,7 +95,7 @@
const SkPaint& paint,
SkCanvas::DrawBitmapRectFlags flags) SK_OVERRIDE;
virtual void drawSprite(const SkDraw&, const SkBitmap& bitmap,
- int x, int y, const SkPaint& paint);
+ int x, int y, const SkPaint& paint) SK_OVERRIDE;
virtual void drawText(const SkDraw&, const void* text, size_t len,
SkScalar x, SkScalar y, const SkPaint&) SK_OVERRIDE;
virtual void drawPosText(const SkDraw&, const void* text, size_t len,
diff --git a/src/gpu/effects/GrConvolutionEffect.h b/src/gpu/effects/GrConvolutionEffect.h
index 1d0950b..0d1226b 100644
--- a/src/gpu/effects/GrConvolutionEffect.h
+++ b/src/gpu/effects/GrConvolutionEffect.h
@@ -96,7 +96,7 @@
virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE;
- virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const {
+ virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVERRIDE {
// If the texture was opaque we could know that the output color if we knew the sum of the
// kernel values.
inout->mulByUnknownFourComponents();
diff --git a/src/gpu/effects/GrYUVtoRGBEffect.cpp b/src/gpu/effects/GrYUVtoRGBEffect.cpp
index 50d0e52..e8c7ff7 100644
--- a/src/gpu/effects/GrYUVtoRGBEffect.cpp
+++ b/src/gpu/effects/GrYUVtoRGBEffect.cpp
@@ -104,7 +104,7 @@
this->addTextureAccess(&fVAccess);
}
- virtual bool onIsEqual(const GrFragmentProcessor& sBase) const {
+ virtual bool onIsEqual(const GrFragmentProcessor& sBase) const SK_OVERRIDE {
const YUVtoRGBEffect& s = sBase.cast<YUVtoRGBEffect>();
return fColorSpace == s.getColorSpace();
}
diff --git a/src/gpu/gl/GrGLPathRange.h b/src/gpu/gl/GrGLPathRange.h
index 8fde666..5fbfb1f 100644
--- a/src/gpu/gl/GrGLPathRange.h
+++ b/src/gpu/gl/GrGLPathRange.h
@@ -42,7 +42,7 @@
GrGLuint basePathID() const { return fBasePathID; }
protected:
- virtual void onInitPath(int index, const SkPath&) const;
+ virtual void onInitPath(int index, const SkPath&) const SK_OVERRIDE;
virtual void onRelease() SK_OVERRIDE;
virtual void onAbandon() SK_OVERRIDE;
diff --git a/src/gpu/gl/GrGLRenderTarget.h b/src/gpu/gl/GrGLRenderTarget.h
index e66475d..079e9d5 100644
--- a/src/gpu/gl/GrGLRenderTarget.h
+++ b/src/gpu/gl/GrGLRenderTarget.h
@@ -42,9 +42,9 @@
GrGLuint textureFBOID() const { return fTexFBOID; }
// override of GrRenderTarget
- virtual GrBackendObject getRenderTargetHandle() const { return this->renderFBOID(); }
- virtual GrBackendObject getRenderTargetResolvedHandle() const { return this->textureFBOID(); }
- virtual ResolveType getResolveType() const {
+ virtual GrBackendObject getRenderTargetHandle() const SK_OVERRIDE { return this->renderFBOID(); }
+ virtual GrBackendObject getRenderTargetResolvedHandle() const SK_OVERRIDE { return this->textureFBOID(); }
+ virtual ResolveType getResolveType() const SK_OVERRIDE {
if (!this->isMultisampled() ||
fRTFBOID == fTexFBOID) {
// catches FBO 0 and non MSAA case
diff --git a/src/gpu/gl/builders/GrGLLegacyNvprProgramBuilder.h b/src/gpu/gl/builders/GrGLLegacyNvprProgramBuilder.h
index b25759e..7f7b0fc 100644
--- a/src/gpu/gl/builders/GrGLLegacyNvprProgramBuilder.h
+++ b/src/gpu/gl/builders/GrGLLegacyNvprProgramBuilder.h
@@ -14,7 +14,7 @@
public:
GrGLLegacyNvprProgramBuilder(GrGpuGL*, const GrOptDrawState&);
- virtual GrGLProgram* createProgram(GrGLuint programID);
+ virtual GrGLProgram* createProgram(GrGLuint programID) SK_OVERRIDE;
private:
int addTexCoordSets(int count);
diff --git a/src/gpu/gl/builders/GrGLNvprProgramBuilder.h b/src/gpu/gl/builders/GrGLNvprProgramBuilder.h
index 48fa96c..5f23905 100644
--- a/src/gpu/gl/builders/GrGLNvprProgramBuilder.h
+++ b/src/gpu/gl/builders/GrGLNvprProgramBuilder.h
@@ -25,7 +25,7 @@
typedef GrTAllocator<SeparableVaryingInfo> SeparableVaryingInfoArray;
- virtual GrGLProgram* createProgram(GrGLuint programID);
+ virtual GrGLProgram* createProgram(GrGLuint programID) SK_OVERRIDE;
private:
virtual void emitTransforms(const GrPendingFragmentStage&,
diff --git a/src/images/SkImageDecoder_libjpeg.cpp b/src/images/SkImageDecoder_libjpeg.cpp
index 77d1c5f..18e71fa 100644
--- a/src/images/SkImageDecoder_libjpeg.cpp
+++ b/src/images/SkImageDecoder_libjpeg.cpp
@@ -229,7 +229,7 @@
}
#endif
- virtual Format getFormat() const {
+ virtual Format getFormat() const SK_OVERRIDE {
return kJPEG_Format;
}
diff --git a/src/utils/SkTextureCompressor_Blitter.h b/src/utils/SkTextureCompressor_Blitter.h
index 0c26a7a..cdf2fb6 100644
--- a/src/utils/SkTextureCompressor_Blitter.h
+++ b/src/utils/SkTextureCompressor_Blitter.h
@@ -378,7 +378,7 @@
* to preserve semantics if blitAntiH doesn't get called in too many
* weird ways...
*/
- virtual int requestRowsPreserved() const { return BlockDim; }
+ virtual int requestRowsPreserved() const SK_OVERRIDE { return BlockDim; }
private:
static const int kPixelsPerBlock = BlockDim * BlockDim;