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

Unified Diff: src/utils/debugger/SkDrawCommand.h

Issue 708333002: Revert of Revert of SkDrawCommand scrubbing (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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 | « src/utils/debugger/SkDebugCanvas.cpp ('k') | src/utils/debugger/SkDrawCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/debugger/SkDrawCommand.h
diff --git a/src/utils/debugger/SkDrawCommand.h b/src/utils/debugger/SkDrawCommand.h
index 1d3d373ac8e9839fa3edb689a130fe68a750ff14..cae0e145f2ad768611296c6c4fc3c63b5234471a 100644
--- a/src/utils/debugger/SkDrawCommand.h
+++ b/src/utils/debugger/SkDrawCommand.h
@@ -15,18 +15,16 @@
class SK_API SkDrawCommand {
public:
- /* TODO(chudy): Remove subclasses. */
SkDrawCommand(DrawType drawType);
- SkDrawCommand();
virtual ~SkDrawCommand();
- virtual SkString toString();
+ virtual SkString toString() const;
void setOffset(size_t offset) { fOffset = offset; }
- virtual size_t offset() { return fOffset; }
-
- virtual const char* toCString() {
+ size_t offset() const { return fOffset; }
+
+ virtual const char* toCString() const {
return GetCommandString(fDrawType);
}
@@ -38,15 +36,15 @@
fVisible = toggle;
}
- SkTDArray<SkString*>* Info() {return &fInfo; };
- virtual void execute(SkCanvas* canvas) = 0;
- virtual void vizExecute(SkCanvas* canvas) { };
-
- virtual void setUserMatrix(const SkMatrix& userMtx) { };
+ const SkTDArray<SkString*>* Info() const { return &fInfo; }
+ virtual void execute(SkCanvas*) const = 0;
+ virtual void vizExecute(SkCanvas*) const {}
+
+ virtual void setUserMatrix(const SkMatrix&) {}
/** Does nothing by default, but used by save() and restore()-type
subclasses to track unresolved save() calls. */
- virtual void trackSaveState(int* state) { };
+ virtual void trackSaveState(int* state) {}
// The next "active" system is only used by save, saveLayer, restore,
// pushCull and popCull. It is used in two ways:
@@ -70,7 +68,7 @@
virtual void setActive(bool active) {}
virtual bool active() const { return false; }
- DrawType getType() { return fDrawType; };
+ DrawType getType() const { return fDrawType; }
virtual bool render(SkCanvas* canvas) const { return false; }
@@ -88,7 +86,7 @@
class SkRestoreCommand : public SkDrawCommand {
public:
SkRestoreCommand();
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
virtual void trackSaveState(int* state) SK_OVERRIDE;
virtual Action action() const SK_OVERRIDE { return kPopLayer_Action; }
@@ -99,7 +97,7 @@
class SkClearCommand : public SkDrawCommand {
public:
SkClearCommand(SkColor color);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
private:
SkColor fColor;
@@ -109,7 +107,7 @@
class SkClipPathCommand : public SkDrawCommand {
public:
SkClipPathCommand(const SkPath& path, SkRegion::Op op, bool doAA);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
virtual bool render(SkCanvas* canvas) const SK_OVERRIDE;
private:
SkPath fPath;
@@ -122,7 +120,7 @@
class SkClipRegionCommand : public SkDrawCommand {
public:
SkClipRegionCommand(const SkRegion& region, SkRegion::Op op);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
private:
SkRegion fRegion;
SkRegion::Op fOp;
@@ -133,7 +131,7 @@
class SkClipRectCommand : public SkDrawCommand {
public:
SkClipRectCommand(const SkRect& rect, SkRegion::Op op, bool doAA);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
const SkRect& rect() const { return fRect; }
SkRegion::Op op() const { return fOp; }
@@ -150,7 +148,7 @@
class SkClipRRectCommand : public SkDrawCommand {
public:
SkClipRRectCommand(const SkRRect& rrect, SkRegion::Op op, bool doAA);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
virtual bool render(SkCanvas* canvas) const SK_OVERRIDE;
const SkRRect& rrect() const { return fRRect; }
@@ -168,7 +166,7 @@
class SkConcatCommand : public SkDrawCommand {
public:
SkConcatCommand(const SkMatrix& matrix);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
private:
SkMatrix fMatrix;
@@ -179,7 +177,7 @@
public:
SkDrawBitmapCommand(const SkBitmap& bitmap, SkScalar left, SkScalar top,
const SkPaint* paint);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
virtual bool render(SkCanvas* canvas) const SK_OVERRIDE;
private:
SkBitmap fBitmap;
@@ -195,7 +193,7 @@
public:
SkDrawBitmapMatrixCommand(const SkBitmap& bitmap, const SkMatrix& matrix,
const SkPaint* paint);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
virtual bool render(SkCanvas* canvas) const SK_OVERRIDE;
private:
SkBitmap fBitmap;
@@ -210,7 +208,7 @@
public:
SkDrawBitmapNineCommand(const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst, const SkPaint* paint);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
virtual bool render(SkCanvas* canvas) const SK_OVERRIDE;
private:
SkBitmap fBitmap;
@@ -227,7 +225,7 @@
SkDrawBitmapRectCommand(const SkBitmap& bitmap, const SkRect* src,
const SkRect& dst, const SkPaint* paint,
SkCanvas::DrawBitmapRectFlags flags);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
virtual bool render(SkCanvas* canvas) const SK_OVERRIDE;
const SkBitmap& bitmap() const { return fBitmap; }
@@ -265,7 +263,7 @@
public:
SkDrawDataCommand(const void* data, size_t length);
virtual ~SkDrawDataCommand() { delete [] fData; }
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
private:
char* fData;
size_t fLength;
@@ -276,7 +274,7 @@
class SkBeginCommentGroupCommand : public SkDrawCommand {
public:
SkBeginCommentGroupCommand(const char* description);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE {
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE {
canvas->beginCommentGroup(fDescription.c_str());
};
private:
@@ -288,7 +286,7 @@
class SkCommentCommand : public SkDrawCommand {
public:
SkCommentCommand(const char* kywd, const char* value);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE {
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE {
canvas->addComment(fKywd.c_str(), fValue.c_str());
};
private:
@@ -301,7 +299,7 @@
class SkEndCommentGroupCommand : public SkDrawCommand {
public:
SkEndCommentGroupCommand();
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE {
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE {
canvas->endCommentGroup();
};
private:
@@ -311,7 +309,7 @@
class SkDrawOvalCommand : public SkDrawCommand {
public:
SkDrawOvalCommand(const SkRect& oval, const SkPaint& paint);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
virtual bool render(SkCanvas* canvas) const SK_OVERRIDE;
private:
SkRect fOval;
@@ -323,7 +321,7 @@
class SkDrawPaintCommand : public SkDrawCommand {
public:
SkDrawPaintCommand(const SkPaint& paint);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
virtual bool render(SkCanvas* canvas) const SK_OVERRIDE;
private:
SkPaint fPaint;
@@ -334,7 +332,7 @@
class SkDrawPathCommand : public SkDrawCommand {
public:
SkDrawPathCommand(const SkPath& path, const SkPaint& paint);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
virtual bool render(SkCanvas* canvas) const SK_OVERRIDE;
private:
@@ -347,7 +345,7 @@
class SkDrawPictureCommand : public SkDrawCommand {
public:
SkDrawPictureCommand(const SkPicture* picture, const SkMatrix* matrix, const SkPaint* paint);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
virtual bool render(SkCanvas* canvas) const SK_OVERRIDE;
private:
@@ -365,7 +363,7 @@
SkDrawPointsCommand(SkCanvas::PointMode mode, size_t count, const SkPoint pts[],
const SkPaint& paint);
virtual ~SkDrawPointsCommand() { delete [] fPts; }
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
virtual bool render(SkCanvas* canvas) const SK_OVERRIDE;
private:
SkCanvas::PointMode fMode;
@@ -381,7 +379,7 @@
SkDrawTextCommand(const void* text, size_t byteLength, SkScalar x, SkScalar y,
const SkPaint& paint);
virtual ~SkDrawTextCommand() { delete [] fText; }
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
private:
char* fText;
size_t fByteLength;
@@ -397,7 +395,7 @@
SkDrawPosTextCommand(const void* text, size_t byteLength, const SkPoint pos[],
const SkPaint& paint);
virtual ~SkDrawPosTextCommand() { delete [] fPos; delete [] fText; }
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
private:
char* fText;
size_t fByteLength;
@@ -412,7 +410,7 @@
SkDrawTextOnPathCommand(const void* text, size_t byteLength, const SkPath& path,
const SkMatrix* matrix, const SkPaint& paint);
virtual ~SkDrawTextOnPathCommand() { delete [] fText; }
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
private:
char* fText;
size_t fByteLength;
@@ -428,7 +426,7 @@
SkDrawPosTextHCommand(const void* text, size_t byteLength, const SkScalar xpos[],
SkScalar constY, const SkPaint& paint);
virtual ~SkDrawPosTextHCommand() { delete [] fXpos; delete [] fText; }
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
private:
SkScalar* fXpos;
char* fText;
@@ -443,7 +441,7 @@
public:
SkDrawTextBlobCommand(const SkTextBlob* blob, SkScalar x, SkScalar y, const SkPaint& paint);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
virtual bool render(SkCanvas* canvas) const SK_OVERRIDE;
private:
@@ -458,7 +456,7 @@
class SkDrawRectCommand : public SkDrawCommand {
public:
SkDrawRectCommand(const SkRect& rect, const SkPaint& paint);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
const SkRect& rect() const { return fRect; }
const SkPaint& paint() const { return fPaint; }
@@ -472,7 +470,7 @@
class SkDrawRRectCommand : public SkDrawCommand {
public:
SkDrawRRectCommand(const SkRRect& rrect, const SkPaint& paint);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
virtual bool render(SkCanvas* canvas) const SK_OVERRIDE;
private:
SkRRect fRRect;
@@ -485,7 +483,7 @@
public:
SkDrawDRRectCommand(const SkRRect& outer, const SkRRect& inner,
const SkPaint& paint);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
virtual bool render(SkCanvas* canvas) const SK_OVERRIDE;
private:
SkRRect fOuter;
@@ -498,7 +496,7 @@
class SkDrawSpriteCommand : public SkDrawCommand {
public:
SkDrawSpriteCommand(const SkBitmap& bitmap, int left, int top, const SkPaint* paint);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
virtual bool render(SkCanvas* canvas) const SK_OVERRIDE;
private:
SkBitmap fBitmap;
@@ -518,7 +516,7 @@
const uint16_t indices[], int indexCount,
const SkPaint& paint);
virtual ~SkDrawVerticesCommand();
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
private:
SkCanvas::VertexMode fVmode;
int fVertexCount;
@@ -536,7 +534,7 @@
class SkRotateCommand : public SkDrawCommand {
public:
SkRotateCommand(SkScalar degrees);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
private:
SkScalar fDegrees;
@@ -546,7 +544,7 @@
class SkSaveCommand : public SkDrawCommand {
public:
SkSaveCommand();
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
virtual void trackSaveState(int* state) SK_OVERRIDE;
virtual Action action() const SK_OVERRIDE { return kPushLayer_Action; }
private:
@@ -557,8 +555,8 @@
public:
SkSaveLayerCommand(const SkRect* bounds, const SkPaint* paint,
SkCanvas::SaveFlags flags);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
- virtual void vizExecute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
+ virtual void vizExecute(SkCanvas* canvas) const SK_OVERRIDE;
virtual void trackSaveState(int* state) SK_OVERRIDE;
virtual Action action() const SK_OVERRIDE{ return kPushLayer_Action; }
virtual void setActive(bool active) SK_OVERRIDE { fActive = active; }
@@ -580,7 +578,7 @@
class SkScaleCommand : public SkDrawCommand {
public:
SkScaleCommand(SkScalar sx, SkScalar sy);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
SkScalar x() const { return fSx; }
SkScalar y() const { return fSy; }
@@ -596,7 +594,7 @@
public:
SkSetMatrixCommand(const SkMatrix& matrix);
virtual void setUserMatrix(const SkMatrix&) SK_OVERRIDE;
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
private:
SkMatrix fUserMatrix;
SkMatrix fMatrix;
@@ -607,7 +605,7 @@
class SkSkewCommand : public SkDrawCommand {
public:
SkSkewCommand(SkScalar sx, SkScalar sy);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
private:
SkScalar fSx;
SkScalar fSy;
@@ -618,7 +616,7 @@
class SkTranslateCommand : public SkDrawCommand {
public:
SkTranslateCommand(SkScalar dx, SkScalar dy);
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
SkScalar x() const { return fDx; }
SkScalar y() const { return fDy; }
@@ -633,8 +631,8 @@
class SkPushCullCommand : public SkDrawCommand {
public:
SkPushCullCommand(const SkRect&);
- virtual void execute(SkCanvas*) SK_OVERRIDE;
- virtual void vizExecute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas*) const SK_OVERRIDE;
+ virtual void vizExecute(SkCanvas* canvas) const SK_OVERRIDE;
virtual Action action() const { return kPushCull_Action; }
virtual void setActive(bool active) { fActive = active; }
virtual bool active() const { return fActive; }
@@ -648,7 +646,7 @@
class SkPopCullCommand : public SkDrawCommand {
public:
SkPopCullCommand();
- virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
virtual Action action() const { return kPopCull_Action; }
private:
typedef SkDrawCommand INHERITED;
« no previous file with comments | « src/utils/debugger/SkDebugCanvas.cpp ('k') | src/utils/debugger/SkDrawCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698