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

Unified Diff: debugger/SkDrawCommand.h

Issue 12979004: More SkDrawCommand cleanup (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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 | « debugger/SkDebugCanvas.cpp ('k') | debugger/SkDrawCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: debugger/SkDrawCommand.h
===================================================================
--- debugger/SkDrawCommand.h (revision 8298)
+++ debugger/SkDrawCommand.h (working copy)
@@ -95,14 +95,16 @@
ClipRect(const SkRect& rect, SkRegion::Op op, bool doAA);
virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
- const SkRect& rect() const { return *fRect; }
+ const SkRect& rect() const { return fRect; }
SkRegion::Op op() const { return fOp; }
bool doAA() const { return fDoAA; }
private:
- const SkRect* fRect;
+ SkRect fRect;
SkRegion::Op fOp;
- bool fDoAA;
+ bool fDoAA;
+
+ typedef SkDrawCommand INHERITED;
};
class ClipRRect : public SkDrawCommand {
@@ -115,9 +117,11 @@
bool doAA() const { return fDoAA; }
private:
- SkRRect fRRect;
+ SkRRect fRRect;
SkRegion::Op fOp;
- bool fDoAA;
+ bool fDoAA;
+
+ typedef SkDrawCommand INHERITED;
};
class Concat : public SkDrawCommand {
@@ -214,8 +218,10 @@
DrawOval(const SkRect& oval, const SkPaint& paint);
virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
private:
- const SkRect* fOval;
- const SkPaint* fPaint;
+ SkRect fOval;
+ SkPaint fPaint;
+
+ typedef SkDrawCommand INHERITED;
};
class DrawPaint : public SkDrawCommand {
@@ -223,7 +229,9 @@
DrawPaint(const SkPaint& paint);
virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
private:
- const SkPaint* fPaint;
+ SkPaint fPaint;
+
+ typedef SkDrawCommand INHERITED;
};
class DrawPath : public SkDrawCommand {
@@ -251,13 +259,17 @@
class DrawPoints : public SkDrawCommand {
public:
DrawPoints(SkCanvas::PointMode mode, size_t count, const SkPoint pts[],
- const SkPaint& paint);
+ const SkPaint& paint);
+ virtual ~DrawPoints() { delete [] fPts; }
virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+
private:
- const SkPoint* fPts;
SkCanvas::PointMode fMode;
- size_t fCount;
- const SkPaint* fPaint;
+ size_t fCount;
+ SkPoint* fPts;
+ SkPaint fPaint;
+
+ typedef SkDrawCommand INHERITED;
};
/* TODO(chudy): DrawText is a predefined macro and was breaking something
@@ -279,19 +291,20 @@
class DrawPosText : public SkDrawCommand {
public:
DrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
- const SkPaint& paint);
+ const SkPaint& paint);
+ virtual ~DrawPosText() { delete [] fPos; delete [] fText; }
virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
private:
- const SkPoint* fPos;
- const void* fText;
+ SkPoint* fPos;
+ char* fText;
size_t fByteLength;
- const SkPaint* fPaint;
+ SkPaint fPaint;
};
class DrawTextOnPath : public SkDrawCommand {
public:
DrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
- const SkMatrix* matrix, const SkPaint& paint);
+ const SkMatrix* matrix, const SkPaint& paint);
virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
private:
const SkMatrix* fMatrix;
@@ -305,10 +318,11 @@
public:
DrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
SkScalar constY, const SkPaint& paint);
+ virtual ~DrawPosTextH() { delete [] fXpos; delete [] fText; }
virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
private:
- const SkScalar* fXpos;
- const void* fText;
+ SkScalar* fXpos;
+ char* fText;
size_t fByteLength;
SkScalar fConstY;
SkPaint fPaint;
« no previous file with comments | « debugger/SkDebugCanvas.cpp ('k') | debugger/SkDrawCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698