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
This commit is contained in:
tfarina 2014-12-14 15:20:10 -08:00 committed by Commit bot
parent 451e822705
commit 912ed6ebb8
20 changed files with 28 additions and 30 deletions

View File

@ -74,7 +74,7 @@ protected:
// 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;

View File

@ -29,7 +29,7 @@ protected:
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;

View File

@ -24,7 +24,7 @@ public:
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;

View File

@ -235,7 +235,7 @@ public:
};
protected:
virtual SkCanvas* canvasForDrawIter();
virtual SkCanvas* canvasForDrawIter() SK_OVERRIDE;
SkDeferredDevice* getDeferredDevice() const;
private:

View File

@ -416,7 +416,7 @@ private:
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;
}

View File

@ -590,7 +590,7 @@ public:
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 @@ protected:
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 @@ public:
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 @@ public:
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 @@ public:
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 @@ public:
#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; }

View File

@ -493,7 +493,7 @@ public:
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 {

View File

@ -60,7 +60,7 @@ public:
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;

View File

@ -844,7 +844,7 @@ protected:
GrClipMaskManager fClipMaskManager;
private:
GrClipMaskManager* clipMaskManager() { return &fClipMaskManager; }
GrClipMaskManager* clipMaskManager() SK_OVERRIDE { return &fClipMaskManager; }
virtual bool setupClip(const SkRect* devBounds,
GrDrawState::AutoRestoreEffects* are,

View File

@ -80,8 +80,6 @@ public:
, 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 @@ public:
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

View File

@ -42,7 +42,7 @@ public:
~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 @@ private:
// 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 {

View File

@ -95,7 +95,7 @@ public:
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,

View File

@ -96,7 +96,7 @@ private:
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();

View File

@ -104,7 +104,7 @@ private:
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();
}

View File

@ -42,7 +42,7 @@ public:
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;

View File

@ -42,9 +42,9 @@ public:
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

View File

@ -14,7 +14,7 @@ class GrGLLegacyNvprProgramBuilder : public GrGLProgramBuilder {
public:
GrGLLegacyNvprProgramBuilder(GrGpuGL*, const GrOptDrawState&);
virtual GrGLProgram* createProgram(GrGLuint programID);
virtual GrGLProgram* createProgram(GrGLuint programID) SK_OVERRIDE;
private:
int addTexCoordSets(int count);

View File

@ -25,7 +25,7 @@ public:
typedef GrTAllocator<SeparableVaryingInfo> SeparableVaryingInfoArray;
virtual GrGLProgram* createProgram(GrGLuint programID);
virtual GrGLProgram* createProgram(GrGLuint programID) SK_OVERRIDE;
private:
virtual void emitTransforms(const GrPendingFragmentStage&,

View File

@ -229,7 +229,7 @@ public:
}
#endif
virtual Format getFormat() const {
virtual Format getFormat() const SK_OVERRIDE {
return kJPEG_Format;
}

View File

@ -378,7 +378,7 @@ public:
* 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;