diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp index 619aa0ac92..c8ef58b5a5 100644 --- a/debugger/QT/SkDebuggerGUI.cpp +++ b/debugger/QT/SkDebuggerGUI.cpp @@ -34,6 +34,7 @@ SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) : , fToolBar(this) , fActionOpen(this) , fActionBreakpoint(this) + , fActionToggleIndexStyle(this) , fActionProfile(this) , fActionCancel(this) , fActionClearBreakpoints(this) @@ -65,6 +66,7 @@ SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) : , fMenuNavigate(this) , fMenuView(this) , fBreakpointsActivated(false) + , fIndexStyleToggle(false) , fDeletesActivated(false) , fPause(false) , fLoading(false) @@ -82,6 +84,7 @@ SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) : connect(&fActionStepBack, SIGNAL(triggered()), this, SLOT(actionStepBack())); connect(&fActionStepForward, SIGNAL(triggered()), this, SLOT(actionStepForward())); connect(&fActionBreakpoint, SIGNAL(triggered()), this, SLOT(actionBreakpoints())); + connect(&fActionToggleIndexStyle, SIGNAL(triggered()), this, SLOT(actionToggleIndexStyle())); connect(&fActionInspector, SIGNAL(triggered()), this, SLOT(actionInspector())); connect(&fActionSettings, SIGNAL(triggered()), this, SLOT(actionSettings())); connect(&fFilter, SIGNAL(activated(QString)), this, SLOT(toggleFilter(QString))); @@ -135,12 +138,19 @@ void SkDebuggerGUI::actionBreakpoints() { } } +void SkDebuggerGUI::actionToggleIndexStyle() { + fIndexStyleToggle = !fIndexStyleToggle; + SkListWidget* list = (SkListWidget*) fListWidget.itemDelegate(); + list->setIndexStyle(fIndexStyleToggle ? SkListWidget::kIndex_IndexStyle : + SkListWidget::kOffset_IndexStyle); + fListWidget.update(); +} + void SkDebuggerGUI::showDeletes() { fDeletesActivated = !fDeletesActivated; for (int row = 0; row < fListWidget.count(); row++) { QListWidgetItem *item = fListWidget.item(row); - item->setHidden(fDebugger.isCommandVisible(row) - && fDeletesActivated); + item->setHidden(fDebugger.isCommandVisible(row) && fDeletesActivated); } } @@ -709,6 +719,9 @@ void SkDebuggerGUI::setupUi(QMainWindow *SkDebuggerGUI) { fActionBreakpoint.setIcon(breakpoint); fActionBreakpoint.setText("Breakpoints"); + fActionToggleIndexStyle.setShortcut(QKeySequence(tr("Ctrl+T"))); + fActionToggleIndexStyle.setText("Toggle Index Style"); + QIcon cancel; cancel.addFile(QString::fromUtf8(":/reload.png"), QSize(), QIcon::Normal, QIcon::Off); @@ -906,6 +919,7 @@ void SkDebuggerGUI::setupUi(QMainWindow *SkDebuggerGUI) { fMenuView.setTitle("View"); fMenuView.addAction(&fActionBreakpoint); fMenuView.addAction(&fActionShowDeletes); + fMenuView.addAction(&fActionToggleIndexStyle); fMenuView.addAction(&fActionZoomIn); fMenuView.addAction(&fActionZoomOut); @@ -966,6 +980,8 @@ void SkDebuggerGUI::loadPicture(const SkString& fileName) { // Will this automatically clear out due to nature of refcnt? SkTArray* commands = fDebugger.getDrawCommandsAsStrings(); + SkTDArray* offsets = fDebugger.getDrawCommandOffsets(); + SkASSERT(commands->count() == offsets->count()); fActionProfile.setDisabled(false); @@ -976,9 +992,9 @@ void SkDebuggerGUI::loadPicture(const SkString& fileName) { * */ fDebugger.highlightCurrentCommand(fSettingsWidget.getVisibilityFilter()); - setupListWidget(commands); - setupComboBox(commands); - setupOverviewText(NULL, 0.0, 1); + this->setupListWidget(commands, offsets); + this->setupComboBox(commands); + this->setupOverviewText(NULL, 0.0, 1); fInspectorWidget.setDisabled(false); fSettingsWidget.setDisabled(false); fMenuEdit.setDisabled(false); @@ -990,31 +1006,33 @@ void SkDebuggerGUI::loadPicture(const SkString& fileName) { actionPlay(); } -void SkDebuggerGUI::setupListWidget(SkTArray* command) { +void SkDebuggerGUI::setupListWidget(SkTArray* commands, SkTDArray* offsets) { + SkASSERT(commands->count() == offsets->count()); fListWidget.clear(); int counter = 0; int indent = 0; - for (int i = 0; i < command->count(); i++) { + for (int i = 0; i < commands->count(); i++) { QListWidgetItem *item = new QListWidgetItem(); - item->setData(Qt::DisplayRole, (*command)[i].c_str()); + item->setData(Qt::DisplayRole, (*commands)[i].c_str()); item->setData(Qt::UserRole + 1, counter++); - if (0 == strcmp("Restore", (*command)[i].c_str()) || - 0 == strcmp("EndCommentGroup", (*command)[i].c_str()) || - 0 == strcmp("PopCull", (*command)[i].c_str())) { + if (0 == strcmp("Restore", (*commands)[i].c_str()) || + 0 == strcmp("EndCommentGroup", (*commands)[i].c_str()) || + 0 == strcmp("PopCull", (*commands)[i].c_str())) { indent -= 10; } item->setData(Qt::UserRole + 3, indent); - if (0 == strcmp("Save", (*command)[i].c_str()) || - 0 == strcmp("Save Layer", (*command)[i].c_str()) || - 0 == strcmp("BeginCommentGroup", (*command)[i].c_str()) || - 0 == strcmp("PushCull", (*command)[i].c_str())) { + if (0 == strcmp("Save", (*commands)[i].c_str()) || + 0 == strcmp("Save Layer", (*commands)[i].c_str()) || + 0 == strcmp("BeginCommentGroup", (*commands)[i].c_str()) || + 0 == strcmp("PushCull", (*commands)[i].c_str())) { indent += 10; } - item->setData(Qt::UserRole + 4, -1.0); + item->setData(Qt::UserRole + 4, -1); + item->setData(Qt::UserRole + 5, (int)(*offsets)[i]); fListWidget.addItem(item); } diff --git a/debugger/QT/SkDebuggerGUI.h b/debugger/QT/SkDebuggerGUI.h index 50ebfc2259..41c5e242e2 100644 --- a/debugger/QT/SkDebuggerGUI.h +++ b/debugger/QT/SkDebuggerGUI.h @@ -78,6 +78,11 @@ private slots: */ void actionBreakpoints(); + /** + Toggles between count and offset style of command indexing in GUI + */ + void actionToggleIndexStyle(); + /** Profile the commands */ @@ -246,6 +251,7 @@ private: QAction fActionOpen; QAction fActionBreakpoint; + QAction fActionToggleIndexStyle; QAction fActionProfile; QAction fActionCancel; QAction fActionClearBreakpoints; @@ -300,6 +306,7 @@ private: QMenu fMenuWindows; bool fBreakpointsActivated; + bool fIndexStyleToggle; bool fDeletesActivated; bool fPause; bool fLoading; @@ -324,7 +331,7 @@ private: /** Populates the list widget with the vector of strings passed in. */ - void setupListWidget(SkTArray* command); + void setupListWidget(SkTArray* commands, SkTDArray* offsets); /** Populates the combo box widget with the vector of strings passed in. diff --git a/debugger/QT/SkListWidget.cpp b/debugger/QT/SkListWidget.cpp index cc94ff8111..b5f9038d69 100644 --- a/debugger/QT/SkListWidget.cpp +++ b/debugger/QT/SkListWidget.cpp @@ -9,13 +9,9 @@ #include "SkListWidget.h" -SkListWidget::SkListWidget(QObject *parent) {} - -SkListWidget::~SkListWidget() {} - void SkListWidget::paint (QPainter *painter, - const QStyleOptionViewItem &option, - const QModelIndex &index) const { + const QStyleOptionViewItem &option, + const QModelIndex &index) const { /* We adjust the initial position of the list item so that * we don't have overlapping top and bottom borders of concurrent * widget items. */ @@ -64,7 +60,12 @@ void SkListWidget::paint (QPainter *painter, int indent = index.data(Qt::UserRole + 3).toInt(); QString drawCommandText = index.data(Qt::DisplayRole).toString(); - QString drawCommandNumber = index.data(Qt::UserRole + 1).toString(); + QString drawCommandNumber; + if (kIndex_IndexStyle == fIndexStyle) { + drawCommandNumber = index.data(Qt::UserRole + 1).toString(); + } else { + drawCommandNumber = index.data(Qt::UserRole + 5).toString(); + } float time = index.data(Qt::UserRole + 4).toFloat(); QString drawTime; drawTime.setNum(time, 'f', 2); @@ -104,17 +105,17 @@ void SkListWidget::paint (QPainter *painter, // Draw Command Number r = option.rect.adjusted(kImageSpace, 0, -10, -7); painter->drawText(r.left(), r.top(), r.width(), r.height(), - Qt::AlignBottom|Qt::AlignLeft, drawCommandNumber, &r); + Qt::AlignBottom|Qt::AlignLeft, drawCommandNumber, &r); if (time >= 0.0) { // Draw time r = option.rect.adjusted(kImageSpace+kCommandNumberSpace, 0, -10, -7); painter->drawText(r.left(), r.top(), r.width(), r.height(), - Qt::AlignBottom|Qt::AlignLeft, drawTime, &r); + Qt::AlignBottom|Qt::AlignLeft, drawTime, &r); } } -QSize SkListWidget::sizeHint ( const QStyleOptionViewItem & option, - const QModelIndex & index ) const{ +QSize SkListWidget::sizeHint (const QStyleOptionViewItem& option, + const QModelIndex& index) const{ return QSize(200, 30); } diff --git a/debugger/QT/SkListWidget.h b/debugger/QT/SkListWidget.h index 12a2120d9d..d6e797ae9b 100644 --- a/debugger/QT/SkListWidget.h +++ b/debugger/QT/SkListWidget.h @@ -19,25 +19,38 @@ */ class SkListWidget : public QAbstractItemDelegate { public: + enum IndexStyle { + kIndex_IndexStyle, + kOffset_IndexStyle, + }; + /** Constructs the list widget with the specified parent for layout purposes. @param parent The parent container of this widget */ - SkListWidget(QObject* parent = NULL); + SkListWidget(QObject* parent = NULL) : fIndexStyle(kIndex_IndexStyle) {} - ~SkListWidget(); + virtual ~SkListWidget() {} /** Draws the current state of the widget. Overriden from QWidget. */ - void paint (QPainter* painter, const QStyleOptionViewItem& option, - const QModelIndex& index ) const; + void paint(QPainter* painter, const QStyleOptionViewItem& option, + const QModelIndex& index ) const; /** Returns the default size of the widget. Overriden from QWidget. */ - QSize sizeHint (const QStyleOptionViewItem& option, - const QModelIndex& index) const; + QSize sizeHint(const QStyleOptionViewItem& option, + const QModelIndex& index) const; + + + void setIndexStyle(IndexStyle indexStyle) { + fIndexStyle = indexStyle; + } + +protected: + IndexStyle fIndexStyle; }; #endif diff --git a/debugger/SkDebugger.cpp b/debugger/SkDebugger.cpp index f684dd8603..82b26a1270 100644 --- a/debugger/SkDebugger.cpp +++ b/debugger/SkDebugger.cpp @@ -31,7 +31,9 @@ void SkDebugger::loadPicture(SkPicture* picture) { delete fDebugCanvas; fDebugCanvas = new SkDebugCanvas(fPictureWidth, fPictureHeight); fDebugCanvas->setBounds(fPictureWidth, fPictureHeight); + fDebugCanvas->setPicture(picture); picture->draw(fDebugCanvas); + fDebugCanvas->setPicture(NULL); fIndex = fDebugCanvas->getSize() - 1; SkRefCnt_SafeAssign(fPicture, picture); } @@ -41,7 +43,25 @@ SkPicture* SkDebugger::copyPicture() { // commands. Playing back will strip those out. SkPicture* newPicture = new SkPicture; SkCanvas* canvas = newPicture->beginRecording(fPictureWidth, fPictureHeight); + + bool vizMode = fDebugCanvas->getMegaVizMode(); + fDebugCanvas->setMegaVizMode(false); + bool overDraw = fDebugCanvas->getOverdrawViz(); + fDebugCanvas->setOverdrawViz(false); + int saveCount = fDebugCanvas->getOutstandingSaveCount(); + fDebugCanvas->setOutstandingSaveCount(0); + fDebugCanvas->draw(canvas); + + int temp = fDebugCanvas->getOutstandingSaveCount(); + for (int i = 0; i < temp; ++i) { + canvas->restore(); + } + + fDebugCanvas->setMegaVizMode(vizMode); + fDebugCanvas->setOverdrawViz(overDraw); + fDebugCanvas->setOutstandingSaveCount(saveCount); + newPicture->endRecording(); return newPicture; } diff --git a/debugger/SkDebugger.h b/debugger/SkDebugger.h index 20c4a7871d..94300d8365 100644 --- a/debugger/SkDebugger.h +++ b/debugger/SkDebugger.h @@ -48,6 +48,10 @@ public: return fDebugCanvas->getDrawCommandsAsStrings(); } + SkTDArray* getDrawCommandOffsets() { + return fDebugCanvas->getDrawCommandOffsets(); + } + const SkTDArray& getDrawCommands() const { return fDebugCanvas->getDrawCommands(); } diff --git a/src/utils/debugger/SkDebugCanvas.cpp b/src/utils/debugger/SkDebugCanvas.cpp index b4813e4103..0f2b9e0f05 100644 --- a/src/utils/debugger/SkDebugCanvas.cpp +++ b/src/utils/debugger/SkDebugCanvas.cpp @@ -16,6 +16,7 @@ SkDebugCanvas::SkDebugCanvas(int width, int height) : INHERITED(width, height) + , fPicture(NULL) , fWidth(width) , fHeight(height) , fFilter(false) @@ -55,12 +56,13 @@ SkDebugCanvas::~SkDebugCanvas() { } void SkDebugCanvas::addDrawCommand(SkDrawCommand* command) { + command->setOffset(this->getOpID()); fCommandVector.push(command); } void SkDebugCanvas::draw(SkCanvas* canvas) { if (!fCommandVector.isEmpty()) { - drawTo(canvas, fCommandVector.count() - 1); + this->drawTo(canvas, fCommandVector.count() - 1); } } @@ -380,6 +382,16 @@ SkTArray* SkDebugCanvas::getDrawCommandsAsStrings() const { return commandString; } +SkTDArray* SkDebugCanvas::getDrawCommandOffsets() const { + SkTDArray* commandOffsets = new SkTDArray; + if (!fCommandVector.isEmpty()) { + for (int i = 0; i < fCommandVector.count(); i ++) { + *commandOffsets->push() = fCommandVector[i]->offset(); + } + } + return commandOffsets; +} + void SkDebugCanvas::overrideTexFiltering(bool overrideTexFiltering, SkPaint::FilterLevel level) { if (NULL == fTexOverrideFilter) { fTexOverrideFilter = new SkTexOverrideFilter; @@ -390,7 +402,7 @@ void SkDebugCanvas::overrideTexFiltering(bool overrideTexFiltering, SkPaint::Fil } void SkDebugCanvas::clear(SkColor color) { - addDrawCommand(new SkClearCommand(color)); + this->addDrawCommand(new SkClearCommand(color)); } void SkDebugCanvas::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edgeStyle) { @@ -429,71 +441,71 @@ void SkDebugCanvas::didConcat(const SkMatrix& matrix) { void SkDebugCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, const SkPaint* paint = NULL) { - addDrawCommand(new SkDrawBitmapCommand(bitmap, left, top, paint)); + this->addDrawCommand(new SkDrawBitmapCommand(bitmap, left, top, paint)); } void SkDebugCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, const SkPaint* paint, SkCanvas::DrawBitmapRectFlags flags) { - addDrawCommand(new SkDrawBitmapRectCommand(bitmap, src, dst, paint, flags)); + this->addDrawCommand(new SkDrawBitmapRectCommand(bitmap, src, dst, paint, flags)); } void SkDebugCanvas::drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& matrix, const SkPaint* paint) { - addDrawCommand(new SkDrawBitmapMatrixCommand(bitmap, matrix, paint)); + this->addDrawCommand(new SkDrawBitmapMatrixCommand(bitmap, matrix, paint)); } void SkDebugCanvas::drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, const SkRect& dst, const SkPaint* paint) { - addDrawCommand(new SkDrawBitmapNineCommand(bitmap, center, dst, paint)); + this->addDrawCommand(new SkDrawBitmapNineCommand(bitmap, center, dst, paint)); } void SkDebugCanvas::drawData(const void* data, size_t length) { - addDrawCommand(new SkDrawDataCommand(data, length)); + this->addDrawCommand(new SkDrawDataCommand(data, length)); } void SkDebugCanvas::beginCommentGroup(const char* description) { - addDrawCommand(new SkBeginCommentGroupCommand(description)); + this->addDrawCommand(new SkBeginCommentGroupCommand(description)); } void SkDebugCanvas::addComment(const char* kywd, const char* value) { - addDrawCommand(new SkCommentCommand(kywd, value)); + this->addDrawCommand(new SkCommentCommand(kywd, value)); } void SkDebugCanvas::endCommentGroup() { - addDrawCommand(new SkEndCommentGroupCommand()); + this->addDrawCommand(new SkEndCommentGroupCommand()); } void SkDebugCanvas::drawOval(const SkRect& oval, const SkPaint& paint) { - addDrawCommand(new SkDrawOvalCommand(oval, paint)); + this->addDrawCommand(new SkDrawOvalCommand(oval, paint)); } void SkDebugCanvas::drawPaint(const SkPaint& paint) { - addDrawCommand(new SkDrawPaintCommand(paint)); + this->addDrawCommand(new SkDrawPaintCommand(paint)); } void SkDebugCanvas::drawPath(const SkPath& path, const SkPaint& paint) { - addDrawCommand(new SkDrawPathCommand(path, paint)); + this->addDrawCommand(new SkDrawPathCommand(path, paint)); } void SkDebugCanvas::drawPicture(SkPicture& picture) { - addDrawCommand(new SkDrawPictureCommand(picture)); + this->addDrawCommand(new SkDrawPictureCommand(picture)); } void SkDebugCanvas::drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint& paint) { - addDrawCommand(new SkDrawPointsCommand(mode, count, pts, paint)); + this->addDrawCommand(new SkDrawPointsCommand(mode, count, pts, paint)); } void SkDebugCanvas::drawPosText(const void* text, size_t byteLength, const SkPoint pos[], const SkPaint& paint) { - addDrawCommand(new SkDrawPosTextCommand(text, byteLength, pos, paint)); + this->addDrawCommand(new SkDrawPosTextCommand(text, byteLength, pos, paint)); } void SkDebugCanvas::drawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[], SkScalar constY, const SkPaint& paint) { - addDrawCommand( + this->addDrawCommand( new SkDrawPosTextHCommand(text, byteLength, xpos, constY, paint)); } @@ -503,7 +515,7 @@ void SkDebugCanvas::drawRect(const SkRect& rect, const SkPaint& paint) { } void SkDebugCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) { - addDrawCommand(new SkDrawRRectCommand(rrect, paint)); + this->addDrawCommand(new SkDrawRRectCommand(rrect, paint)); } void SkDebugCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, @@ -513,17 +525,17 @@ void SkDebugCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, void SkDebugCanvas::drawSprite(const SkBitmap& bitmap, int left, int top, const SkPaint* paint = NULL) { - addDrawCommand(new SkDrawSpriteCommand(bitmap, left, top, paint)); + this->addDrawCommand(new SkDrawSpriteCommand(bitmap, left, top, paint)); } void SkDebugCanvas::drawText(const void* text, size_t byteLength, SkScalar x, SkScalar y, const SkPaint& paint) { - addDrawCommand(new SkDrawTextCommand(text, byteLength, x, y, paint)); + this->addDrawCommand(new SkDrawTextCommand(text, byteLength, x, y, paint)); } void SkDebugCanvas::drawTextOnPath(const void* text, size_t byteLength, const SkPath& path, const SkMatrix* matrix, const SkPaint& paint) { - addDrawCommand( + this->addDrawCommand( new SkDrawTextOnPathCommand(text, byteLength, path, matrix, paint)); } @@ -531,8 +543,8 @@ void SkDebugCanvas::drawVertices(VertexMode vmode, int vertexCount, const SkPoint vertices[], const SkPoint texs[], const SkColor colors[], SkXfermode*, const uint16_t indices[], int indexCount, const SkPaint& paint) { - addDrawCommand(new SkDrawVerticesCommand(vmode, vertexCount, vertices, - texs, colors, NULL, indices, indexCount, paint)); + this->addDrawCommand(new SkDrawVerticesCommand(vmode, vertexCount, vertices, + texs, colors, NULL, indices, indexCount, paint)); } void SkDebugCanvas::onPushCull(const SkRect& cullRect) { @@ -562,7 +574,7 @@ SkCanvas::SaveLayerStrategy SkDebugCanvas::willSaveLayer(const SkRect* bounds, c } void SkDebugCanvas::didSetMatrix(const SkMatrix& matrix) { - addDrawCommand(new SkSetMatrixCommand(matrix)); + this->addDrawCommand(new SkSetMatrixCommand(matrix)); this->INHERITED::didSetMatrix(matrix); } diff --git a/src/utils/debugger/SkDebugCanvas.h b/src/utils/debugger/SkDebugCanvas.h index ac3083e49b..d89cf9491f 100644 --- a/src/utils/debugger/SkDebugCanvas.h +++ b/src/utils/debugger/SkDebugCanvas.h @@ -26,11 +26,18 @@ public: void toggleFilter(bool toggle) { fFilter = toggle; } void setMegaVizMode(bool megaVizMode) { fMegaVizMode = megaVizMode; } + bool getMegaVizMode() const { return fMegaVizMode; } /** * Enable or disable overdraw visualization */ void setOverdrawViz(bool overdrawViz) { fOverdrawViz = overdrawViz; } + bool getOverdrawViz() const { return fOverdrawViz; } + + void setOutstandingSaveCount(int saveCount) { fOutstandingSaveCount = saveCount; } + int getOutstandingSaveCount() const { return fOutstandingSaveCount; } + + void setPicture(SkPicture* picture) { fPicture = picture; } /** * Enable or disable texure filtering override @@ -117,6 +124,11 @@ public: */ SkTArray* getDrawCommandsAsStrings() const; + /** + * Returns an array containing an offset (in the SkPicture) for each command + */ + SkTDArray* getDrawCommandOffsets() const; + /** Returns length of draw command vector. */ @@ -250,6 +262,7 @@ protected: private: SkTDArray fCommandVector; + SkPicture* fPicture; int fWidth; int fHeight; bool fFilter; @@ -297,6 +310,13 @@ private: */ void applyUserTransform(SkCanvas* canvas); + size_t getOpID() const { + if (NULL != fPicture) { + return fPicture->EXPERIMENTAL_curOpID(); + } + return 0; + } + typedef SkCanvas INHERITED; }; diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp index 7e6b22b7c7..f10f1e8bc1 100644 --- a/src/utils/debugger/SkDrawCommand.cpp +++ b/src/utils/debugger/SkDrawCommand.cpp @@ -14,10 +14,12 @@ SkDrawCommand::SkDrawCommand(DrawType type) : fDrawType(type) + , fOffset(0) , fVisible(true) { } SkDrawCommand::SkDrawCommand() { + fOffset = 0; fVisible = true; } @@ -80,9 +82,8 @@ SkString SkDrawCommand::toString() { return SkString(GetCommandString(fDrawType)); } -SkClearCommand::SkClearCommand(SkColor color) { +SkClearCommand::SkClearCommand(SkColor color) : INHERITED(DRAW_CLEAR) { fColor = color; - fDrawType = DRAW_CLEAR; fInfo.push(SkObjectParser::CustomTextToString("No Parameters")); } @@ -192,11 +193,11 @@ void render_drrect(SkCanvas* canvas, const SkRRect& outer, const SkRRect& inner) }; -SkClipPathCommand::SkClipPathCommand(const SkPath& path, SkRegion::Op op, bool doAA) { +SkClipPathCommand::SkClipPathCommand(const SkPath& path, SkRegion::Op op, bool doAA) + : INHERITED(CLIP_PATH) { fPath = path; fOp = op; fDoAA = doAA; - fDrawType = CLIP_PATH; fInfo.push(SkObjectParser::PathToString(path)); fInfo.push(SkObjectParser::RegionOpToString(op)); @@ -212,10 +213,10 @@ bool SkClipPathCommand::render(SkCanvas* canvas) const { return true; } -SkClipRegionCommand::SkClipRegionCommand(const SkRegion& region, SkRegion::Op op) { +SkClipRegionCommand::SkClipRegionCommand(const SkRegion& region, SkRegion::Op op) + : INHERITED(CLIP_REGION) { fRegion = region; fOp = op; - fDrawType = CLIP_REGION; fInfo.push(SkObjectParser::RegionToString(region)); fInfo.push(SkObjectParser::RegionOpToString(op)); @@ -225,11 +226,11 @@ void SkClipRegionCommand::execute(SkCanvas* canvas) { canvas->clipRegion(fRegion, fOp); } -SkClipRectCommand::SkClipRectCommand(const SkRect& rect, SkRegion::Op op, bool doAA) { +SkClipRectCommand::SkClipRectCommand(const SkRect& rect, SkRegion::Op op, bool doAA) + : INHERITED(CLIP_RECT) { fRect = rect; fOp = op; fDoAA = doAA; - fDrawType = CLIP_RECT; fInfo.push(SkObjectParser::RectToString(rect)); fInfo.push(SkObjectParser::RegionOpToString(op)); @@ -240,11 +241,11 @@ void SkClipRectCommand::execute(SkCanvas* canvas) { canvas->clipRect(fRect, fOp, fDoAA); } -SkClipRRectCommand::SkClipRRectCommand(const SkRRect& rrect, SkRegion::Op op, bool doAA) { +SkClipRRectCommand::SkClipRRectCommand(const SkRRect& rrect, SkRegion::Op op, bool doAA) + : INHERITED(CLIP_RRECT) { fRRect = rrect; fOp = op; fDoAA = doAA; - fDrawType = CLIP_RRECT; fInfo.push(SkObjectParser::RRectToString(rrect)); fInfo.push(SkObjectParser::RegionOpToString(op)); @@ -260,9 +261,9 @@ bool SkClipRRectCommand::render(SkCanvas* canvas) const { return true; } -SkConcatCommand::SkConcatCommand(const SkMatrix& matrix) { +SkConcatCommand::SkConcatCommand(const SkMatrix& matrix) + : INHERITED(CONCAT) { fMatrix = matrix; - fDrawType = CONCAT; fInfo.push(SkObjectParser::MatrixToString(matrix)); } @@ -272,7 +273,8 @@ void SkConcatCommand::execute(SkCanvas* canvas) { } SkDrawBitmapCommand::SkDrawBitmapCommand(const SkBitmap& bitmap, SkScalar left, SkScalar top, - const SkPaint* paint) { + const SkPaint* paint) + : INHERITED(DRAW_BITMAP) { fBitmap = bitmap; fLeft = left; fTop = top; @@ -282,7 +284,6 @@ SkDrawBitmapCommand::SkDrawBitmapCommand(const SkBitmap& bitmap, SkScalar left, } else { fPaintPtr = NULL; } - fDrawType = DRAW_BITMAP; fInfo.push(SkObjectParser::BitmapToString(bitmap)); fInfo.push(SkObjectParser::ScalarToString(left, "SkScalar left: ")); @@ -303,7 +304,8 @@ bool SkDrawBitmapCommand::render(SkCanvas* canvas) const { SkDrawBitmapMatrixCommand::SkDrawBitmapMatrixCommand(const SkBitmap& bitmap, const SkMatrix& matrix, - const SkPaint* paint) { + const SkPaint* paint) + : INHERITED(DRAW_BITMAP_MATRIX) { fBitmap = bitmap; fMatrix = matrix; if (NULL != paint) { @@ -312,7 +314,6 @@ SkDrawBitmapMatrixCommand::SkDrawBitmapMatrixCommand(const SkBitmap& bitmap, } else { fPaintPtr = NULL; } - fDrawType = DRAW_BITMAP_MATRIX; fInfo.push(SkObjectParser::BitmapToString(bitmap)); fInfo.push(SkObjectParser::MatrixToString(matrix)); @@ -331,7 +332,8 @@ bool SkDrawBitmapMatrixCommand::render(SkCanvas* canvas) const { } SkDrawBitmapNineCommand::SkDrawBitmapNineCommand(const SkBitmap& bitmap, const SkIRect& center, - const SkRect& dst, const SkPaint* paint) { + const SkRect& dst, const SkPaint* paint) + : INHERITED(DRAW_BITMAP_NINE) { fBitmap = bitmap; fCenter = center; fDst = dst; @@ -341,7 +343,6 @@ SkDrawBitmapNineCommand::SkDrawBitmapNineCommand(const SkBitmap& bitmap, const S } else { fPaintPtr = NULL; } - fDrawType = DRAW_BITMAP_NINE; fInfo.push(SkObjectParser::BitmapToString(bitmap)); fInfo.push(SkObjectParser::IRectToString(center)); @@ -362,7 +363,8 @@ bool SkDrawBitmapNineCommand::render(SkCanvas* canvas) const { SkDrawBitmapRectCommand::SkDrawBitmapRectCommand(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, const SkPaint* paint, - SkCanvas::DrawBitmapRectFlags flags) { + SkCanvas::DrawBitmapRectFlags flags) + : INHERITED(DRAW_BITMAP_RECT_TO_RECT) { fBitmap = bitmap; if (NULL != src) { fSrc = *src; @@ -379,8 +381,6 @@ SkDrawBitmapRectCommand::SkDrawBitmapRectCommand(const SkBitmap& bitmap, const S } fFlags = flags; - fDrawType = DRAW_BITMAP_RECT_TO_RECT; - fInfo.push(SkObjectParser::BitmapToString(bitmap)); if (NULL != src) { fInfo.push(SkObjectParser::RectToString(*src, "Src: ")); @@ -401,11 +401,11 @@ bool SkDrawBitmapRectCommand::render(SkCanvas* canvas) const { return true; } -SkDrawDataCommand::SkDrawDataCommand(const void* data, size_t length) { +SkDrawDataCommand::SkDrawDataCommand(const void* data, size_t length) + : INHERITED(DRAW_DATA) { fData = new char[length]; memcpy(fData, data, length); fLength = length; - fDrawType = DRAW_DATA; // TODO: add display of actual data? SkString* str = new SkString; @@ -434,13 +434,14 @@ SkCommentCommand::SkCommentCommand(const char* kywd, const char* value) fInfo.push(temp); } -SkEndCommentGroupCommand::SkEndCommentGroupCommand() : INHERITED(END_COMMENT_GROUP) { +SkEndCommentGroupCommand::SkEndCommentGroupCommand() + : INHERITED(END_COMMENT_GROUP) { } -SkDrawOvalCommand::SkDrawOvalCommand(const SkRect& oval, const SkPaint& paint) { +SkDrawOvalCommand::SkDrawOvalCommand(const SkRect& oval, const SkPaint& paint) + : INHERITED(DRAW_OVAL) { fOval = oval; fPaint = paint; - fDrawType = DRAW_OVAL; fInfo.push(SkObjectParser::RectToString(oval)); fInfo.push(SkObjectParser::PaintToString(paint)); @@ -466,9 +467,9 @@ bool SkDrawOvalCommand::render(SkCanvas* canvas) const { return true; } -SkDrawPaintCommand::SkDrawPaintCommand(const SkPaint& paint) { +SkDrawPaintCommand::SkDrawPaintCommand(const SkPaint& paint) + : INHERITED(DRAW_PAINT) { fPaint = paint; - fDrawType = DRAW_PAINT; fInfo.push(SkObjectParser::PaintToString(paint)); } @@ -483,10 +484,10 @@ bool SkDrawPaintCommand::render(SkCanvas* canvas) const { return true; } -SkDrawPathCommand::SkDrawPathCommand(const SkPath& path, const SkPaint& paint) { +SkDrawPathCommand::SkDrawPathCommand(const SkPath& path, const SkPaint& paint) + : INHERITED(DRAW_PATH) { fPath = path; fPaint = paint; - fDrawType = DRAW_PATH; fInfo.push(SkObjectParser::PathToString(path)); fInfo.push(SkObjectParser::PaintToString(paint)); @@ -501,9 +502,9 @@ bool SkDrawPathCommand::render(SkCanvas* canvas) const { return true; } -SkDrawPictureCommand::SkDrawPictureCommand(SkPicture& picture) : - fPicture(picture) { - fDrawType = DRAW_PICTURE; +SkDrawPictureCommand::SkDrawPictureCommand(SkPicture& picture) + : INHERITED(DRAW_PICTURE) + , fPicture(picture) { SkString* temp = new SkString; temp->appendf("SkPicture: W: %d H: %d", picture.width(), picture.height()); fInfo.push(temp); @@ -529,13 +530,13 @@ bool SkDrawPictureCommand::render(SkCanvas* canvas) const { } SkDrawPointsCommand::SkDrawPointsCommand(SkCanvas::PointMode mode, size_t count, - const SkPoint pts[], const SkPaint& paint) { + const SkPoint pts[], const SkPaint& paint) + : INHERITED(DRAW_POINTS) { fMode = mode; fCount = count; fPts = new SkPoint[count]; memcpy(fPts, pts, count * sizeof(SkPoint)); fPaint = paint; - fDrawType = DRAW_POINTS; fInfo.push(SkObjectParser::PointsToString(pts, count)); fInfo.push(SkObjectParser::ScalarToString(SkIntToScalar((unsigned int)count), @@ -572,7 +573,8 @@ bool SkDrawPointsCommand::render(SkCanvas* canvas) const { } SkDrawPosTextCommand::SkDrawPosTextCommand(const void* text, size_t byteLength, - const SkPoint pos[], const SkPaint& paint) { + const SkPoint pos[], const SkPaint& paint) + : INHERITED(DRAW_POS_TEXT) { size_t numPts = paint.countText(text, byteLength); fText = new char[byteLength]; @@ -583,7 +585,6 @@ SkDrawPosTextCommand::SkDrawPosTextCommand(const void* text, size_t byteLength, memcpy(fPos, pos, numPts * sizeof(SkPoint)); fPaint = paint; - fDrawType = DRAW_POS_TEXT; fInfo.push(SkObjectParser::TextToString(text, byteLength, paint.getTextEncoding())); // TODO(chudy): Test that this works. @@ -598,7 +599,8 @@ void SkDrawPosTextCommand::execute(SkCanvas* canvas) { SkDrawPosTextHCommand::SkDrawPosTextHCommand(const void* text, size_t byteLength, const SkScalar xpos[], SkScalar constY, - const SkPaint& paint) { + const SkPaint& paint) + : INHERITED(DRAW_POS_TEXT_H) { size_t numPts = paint.countText(text, byteLength); fText = new char[byteLength]; @@ -610,7 +612,6 @@ SkDrawPosTextHCommand::SkDrawPosTextHCommand(const void* text, size_t byteLength fConstY = constY; fPaint = paint; - fDrawType = DRAW_POS_TEXT_H; fInfo.push(SkObjectParser::TextToString(text, byteLength, paint.getTextEncoding())); fInfo.push(SkObjectParser::ScalarToString(xpos[0], "XPOS: ")); @@ -622,10 +623,10 @@ void SkDrawPosTextHCommand::execute(SkCanvas* canvas) { canvas->drawPosTextH(fText, fByteLength, fXpos, fConstY, fPaint); } -SkDrawRectCommand::SkDrawRectCommand(const SkRect& rect, const SkPaint& paint) { +SkDrawRectCommand::SkDrawRectCommand(const SkRect& rect, const SkPaint& paint) + : INHERITED(DRAW_RECT) { fRect = rect; fPaint = paint; - fDrawType = DRAW_RECT; fInfo.push(SkObjectParser::RectToString(rect)); fInfo.push(SkObjectParser::PaintToString(paint)); @@ -635,10 +636,10 @@ void SkDrawRectCommand::execute(SkCanvas* canvas) { canvas->drawRect(fRect, fPaint); } -SkDrawRRectCommand::SkDrawRRectCommand(const SkRRect& rrect, const SkPaint& paint) { +SkDrawRRectCommand::SkDrawRRectCommand(const SkRRect& rrect, const SkPaint& paint) + : INHERITED(DRAW_RRECT) { fRRect = rrect; fPaint = paint; - fDrawType = DRAW_RRECT; fInfo.push(SkObjectParser::RRectToString(rrect)); fInfo.push(SkObjectParser::PaintToString(paint)); @@ -655,11 +656,11 @@ bool SkDrawRRectCommand::render(SkCanvas* canvas) const { SkDrawDRRectCommand::SkDrawDRRectCommand(const SkRRect& outer, const SkRRect& inner, - const SkPaint& paint) { + const SkPaint& paint) + : INHERITED(DRAW_DRRECT) { fOuter = outer; fInner = inner; fPaint = paint; - fDrawType = DRAW_DRRECT; fInfo.push(SkObjectParser::RRectToString(outer)); fInfo.push(SkObjectParser::RRectToString(inner)); @@ -676,7 +677,8 @@ bool SkDrawDRRectCommand::render(SkCanvas* canvas) const { } SkDrawSpriteCommand::SkDrawSpriteCommand(const SkBitmap& bitmap, int left, int top, - const SkPaint* paint) { + const SkPaint* paint) + : INHERITED(DRAW_SPRITE) { fBitmap = bitmap; fLeft = left; fTop = top; @@ -686,7 +688,6 @@ SkDrawSpriteCommand::SkDrawSpriteCommand(const SkBitmap& bitmap, int left, int t } else { fPaintPtr = NULL; } - fDrawType = DRAW_SPRITE; fInfo.push(SkObjectParser::BitmapToString(bitmap)); fInfo.push(SkObjectParser::IntToString(left, "Left: ")); @@ -706,14 +707,14 @@ bool SkDrawSpriteCommand::render(SkCanvas* canvas) const { } SkDrawTextCommand::SkDrawTextCommand(const void* text, size_t byteLength, SkScalar x, SkScalar y, - const SkPaint& paint) { + const SkPaint& paint) + : INHERITED(DRAW_TEXT) { fText = new char[byteLength]; memcpy(fText, text, byteLength); fByteLength = byteLength; fX = x; fY = y; fPaint = paint; - fDrawType = DRAW_TEXT; fInfo.push(SkObjectParser::TextToString(text, byteLength, paint.getTextEncoding())); fInfo.push(SkObjectParser::ScalarToString(x, "SkScalar x: ")); @@ -727,7 +728,8 @@ void SkDrawTextCommand::execute(SkCanvas* canvas) { SkDrawTextOnPathCommand::SkDrawTextOnPathCommand(const void* text, size_t byteLength, const SkPath& path, const SkMatrix* matrix, - const SkPaint& paint) { + const SkPaint& paint) + : INHERITED(DRAW_TEXT_ON_PATH) { fText = new char[byteLength]; memcpy(fText, text, byteLength); fByteLength = byteLength; @@ -738,7 +740,6 @@ SkDrawTextOnPathCommand::SkDrawTextOnPathCommand(const void* text, size_t byteLe fMatrix.setIdentity(); } fPaint = paint; - fDrawType = DRAW_TEXT_ON_PATH; fInfo.push(SkObjectParser::TextToString(text, byteLength, paint.getTextEncoding())); fInfo.push(SkObjectParser::PathToString(path)); @@ -758,7 +759,8 @@ SkDrawVerticesCommand::SkDrawVerticesCommand(SkCanvas::VertexMode vmode, int ver const SkPoint vertices[], const SkPoint texs[], const SkColor colors[], SkXfermode* xfermode, const uint16_t indices[], int indexCount, - const SkPaint& paint) { + const SkPaint& paint) + : INHERITED(DRAW_VERTICES) { fVmode = vmode; fVertexCount = vertexCount; @@ -794,7 +796,6 @@ SkDrawVerticesCommand::SkDrawVerticesCommand(SkCanvas::VertexMode vmode, int ver fIndexCount = indexCount; fPaint = paint; - fDrawType = DRAW_VERTICES; // TODO(chudy) fInfo.push(SkObjectParser::CustomTextToString("To be implemented.")); @@ -815,8 +816,8 @@ void SkDrawVerticesCommand::execute(SkCanvas* canvas) { fIndexCount, fPaint); } -SkRestoreCommand::SkRestoreCommand() { - fDrawType = RESTORE; +SkRestoreCommand::SkRestoreCommand() + : INHERITED(RESTORE) { fInfo.push(SkObjectParser::CustomTextToString("No Parameters")); } @@ -828,9 +829,9 @@ void SkRestoreCommand::trackSaveState(int* state) { (*state)--; } -SkRotateCommand::SkRotateCommand(SkScalar degrees) { +SkRotateCommand::SkRotateCommand(SkScalar degrees) + : INHERITED(ROTATE) { fDegrees = degrees; - fDrawType = ROTATE; fInfo.push(SkObjectParser::ScalarToString(degrees, "SkScalar degrees: ")); } @@ -839,9 +840,9 @@ void SkRotateCommand::execute(SkCanvas* canvas) { canvas->rotate(fDegrees); } -SkSaveCommand::SkSaveCommand(SkCanvas::SaveFlags flags) { +SkSaveCommand::SkSaveCommand(SkCanvas::SaveFlags flags) + : INHERITED(SAVE) { fFlags = flags; - fDrawType = SAVE; fInfo.push(SkObjectParser::SaveFlagsToString(flags)); } @@ -854,7 +855,8 @@ void SkSaveCommand::trackSaveState(int* state) { } SkSaveLayerCommand::SkSaveLayerCommand(const SkRect* bounds, const SkPaint* paint, - SkCanvas::SaveFlags flags) { + SkCanvas::SaveFlags flags) + : INHERITED(SAVE_LAYER) { if (NULL != bounds) { fBounds = *bounds; } else { @@ -868,7 +870,6 @@ SkSaveLayerCommand::SkSaveLayerCommand(const SkRect* bounds, const SkPaint* pain fPaintPtr = NULL; } fFlags = flags; - fDrawType = SAVE_LAYER; if (NULL != bounds) { fInfo.push(SkObjectParser::RectToString(*bounds, "Bounds: ")); @@ -893,10 +894,10 @@ void SkSaveLayerCommand::trackSaveState(int* state) { (*state)++; } -SkScaleCommand::SkScaleCommand(SkScalar sx, SkScalar sy) { +SkScaleCommand::SkScaleCommand(SkScalar sx, SkScalar sy) + : INHERITED(SCALE) { fSx = sx; fSy = sy; - fDrawType = SCALE; fInfo.push(SkObjectParser::ScalarToString(sx, "SkScalar sx: ")); fInfo.push(SkObjectParser::ScalarToString(sy, "SkScalar sy: ")); @@ -906,9 +907,9 @@ void SkScaleCommand::execute(SkCanvas* canvas) { canvas->scale(fSx, fSy); } -SkSetMatrixCommand::SkSetMatrixCommand(const SkMatrix& matrix) { +SkSetMatrixCommand::SkSetMatrixCommand(const SkMatrix& matrix) + : INHERITED(SET_MATRIX) { fMatrix = matrix; - fDrawType = SET_MATRIX; fInfo.push(SkObjectParser::MatrixToString(matrix)); } @@ -917,10 +918,10 @@ void SkSetMatrixCommand::execute(SkCanvas* canvas) { canvas->setMatrix(fMatrix); } -SkSkewCommand::SkSkewCommand(SkScalar sx, SkScalar sy) { +SkSkewCommand::SkSkewCommand(SkScalar sx, SkScalar sy) + : INHERITED(SKEW) { fSx = sx; fSy = sy; - fDrawType = SKEW; fInfo.push(SkObjectParser::ScalarToString(sx, "SkScalar sx: ")); fInfo.push(SkObjectParser::ScalarToString(sy, "SkScalar sy: ")); @@ -930,10 +931,10 @@ void SkSkewCommand::execute(SkCanvas* canvas) { canvas->skew(fSx, fSy); } -SkTranslateCommand::SkTranslateCommand(SkScalar dx, SkScalar dy) { +SkTranslateCommand::SkTranslateCommand(SkScalar dx, SkScalar dy) + : INHERITED(TRANSLATE) { fDx = dx; fDy = dy; - fDrawType = TRANSLATE; fInfo.push(SkObjectParser::ScalarToString(dx, "SkScalar dx: ")); fInfo.push(SkObjectParser::ScalarToString(dy, "SkScalar dy: ")); @@ -944,8 +945,8 @@ void SkTranslateCommand::execute(SkCanvas* canvas) { } SkPushCullCommand::SkPushCullCommand(const SkRect& cullRect) - : fCullRect(cullRect) { - fDrawType = PUSH_CULL; + : INHERITED(PUSH_CULL) + , fCullRect(cullRect) { fInfo.push(SkObjectParser::RectToString(cullRect)); } @@ -962,9 +963,7 @@ void SkPushCullCommand::vizExecute(SkCanvas* canvas) { canvas->drawRect(fCullRect, p); } -SkPopCullCommand::SkPopCullCommand() { - fDrawType = POP_CULL; -} +SkPopCullCommand::SkPopCullCommand() : INHERITED(POP_CULL) { } void SkPopCullCommand::execute(SkCanvas* canvas) { canvas->popCull(); diff --git a/src/utils/debugger/SkDrawCommand.h b/src/utils/debugger/SkDrawCommand.h index 3c40393fe7..f2e151ae4f 100644 --- a/src/utils/debugger/SkDrawCommand.h +++ b/src/utils/debugger/SkDrawCommand.h @@ -23,6 +23,9 @@ public: virtual SkString toString(); + void setOffset(size_t offset) { fOffset = offset; } + virtual size_t offset() { return fOffset; } + virtual const char* toCString() { return GetCommandString(fDrawType); } @@ -46,13 +49,13 @@ public: // pushCull and popCull. It is used in two ways: // To determine which saveLayers are currently active (at a // given point in the rendering). - // save just return a kPushLayer action but don't track active state - // restore just return a kPopLayer action + // saves just return a kPushLayer action but don't track active state + // restores just return a kPopLayer action // saveLayers return kPushLayer but also track the active state // To determine which culls are currently active (at a given point) // in the rendering). - // pushCull returns a kPushCull action - // popCull returns a kPopCull action + // pushCulls return a kPushCull action + // popCulls return a kPopCull action enum Action { kNone_Action, kPopLayer_Action, @@ -71,11 +74,12 @@ public: static const char* GetCommandString(DrawType type); protected: - DrawType fDrawType; SkTDArray fInfo; private: - bool fVisible; + DrawType fDrawType; + size_t fOffset; + bool fVisible; }; class SkRestoreCommand : public SkDrawCommand { @@ -171,7 +175,7 @@ private: class SkDrawBitmapCommand : public SkDrawCommand { public: SkDrawBitmapCommand(const SkBitmap& bitmap, SkScalar left, SkScalar top, - const SkPaint* paint); + const SkPaint* paint); virtual void execute(SkCanvas* canvas) SK_OVERRIDE; virtual bool render(SkCanvas* canvas) const SK_OVERRIDE; private: @@ -187,7 +191,7 @@ private: class SkDrawBitmapMatrixCommand : public SkDrawCommand { public: SkDrawBitmapMatrixCommand(const SkBitmap& bitmap, const SkMatrix& matrix, - const SkPaint* paint); + const SkPaint* paint); virtual void execute(SkCanvas* canvas) SK_OVERRIDE; virtual bool render(SkCanvas* canvas) const SK_OVERRIDE; private: @@ -202,7 +206,7 @@ private: class SkDrawBitmapNineCommand : public SkDrawCommand { public: SkDrawBitmapNineCommand(const SkBitmap& bitmap, const SkIRect& center, - const SkRect& dst, const SkPaint* paint); + const SkRect& dst, const SkPaint* paint); virtual void execute(SkCanvas* canvas) SK_OVERRIDE; virtual bool render(SkCanvas* canvas) const SK_OVERRIDE; private: @@ -352,7 +356,7 @@ private: class SkDrawPointsCommand : public SkDrawCommand { public: SkDrawPointsCommand(SkCanvas::PointMode mode, size_t count, const SkPoint pts[], - const SkPaint& paint); + const SkPaint& paint); virtual ~SkDrawPointsCommand() { delete [] fPts; } virtual void execute(SkCanvas* canvas) SK_OVERRIDE; virtual bool render(SkCanvas* canvas) const SK_OVERRIDE; @@ -368,7 +372,7 @@ private: class SkDrawTextCommand : public SkDrawCommand { public: SkDrawTextCommand(const void* text, size_t byteLength, SkScalar x, SkScalar y, - const SkPaint& paint); + const SkPaint& paint); virtual ~SkDrawTextCommand() { delete [] fText; } virtual void execute(SkCanvas* canvas) SK_OVERRIDE; private: