Index: src/utils/debugger/SkDrawCommand.cpp |
=================================================================== |
--- src/utils/debugger/SkDrawCommand.cpp (revision 13558) |
+++ src/utils/debugger/SkDrawCommand.cpp (working copy) |
@@ -64,6 +64,7 @@ |
case BEGIN_COMMENT_GROUP: return "BeginCommentGroup"; |
case COMMENT: return "Comment"; |
case END_COMMENT_GROUP: return "EndCommentGroup"; |
+ case DRAW_DRRECT: return "Draw DRRect"; |
default: |
SkDebugf("DrawType error 0x%08x\n", type); |
SkASSERT(0); |
@@ -170,6 +171,22 @@ |
canvas->restore(); |
} |
+void render_drrect(SkCanvas* canvas, const SkRRect& outer, const SkRRect& inner) { |
+ canvas->clear(0xFFFFFFFF); |
+ canvas->save(); |
+ |
+ const SkRect& bounds = outer.getBounds(); |
+ |
+ xlate_and_scale_to_bounds(canvas, bounds); |
+ |
+ SkPaint p; |
+ p.setColor(SK_ColorBLACK); |
+ p.setStyle(SkPaint::kStroke_Style); |
+ |
+ canvas->drawDRRect(outer, inner, p); |
+ canvas->restore(); |
+} |
+ |
}; |
@@ -634,6 +651,28 @@ |
return true; |
} |
+SkDrawDRRectCommand::SkDrawDRRectCommand(const SkRRect& outer, |
+ const SkRRect& inner, |
+ const SkPaint& paint) { |
+ fOuter = outer; |
+ fInner = inner; |
+ fPaint = paint; |
+ fDrawType = DRAW_DRRECT; |
+ |
+ fInfo.push(SkObjectParser::RRectToString(outer)); |
+ fInfo.push(SkObjectParser::RRectToString(inner)); |
+ fInfo.push(SkObjectParser::PaintToString(paint)); |
+} |
+ |
+void SkDrawDRRectCommand::execute(SkCanvas* canvas) { |
+ canvas->drawDRRect(fOuter, fInner, fPaint); |
+} |
+ |
+bool SkDrawDRRectCommand::render(SkCanvas* canvas) const { |
+ render_drrect(canvas, fOuter, fInner); |
+ return true; |
+} |
+ |
SkDrawSpriteCommand::SkDrawSpriteCommand(const SkBitmap& bitmap, int left, int top, |
const SkPaint* paint) { |
fBitmap = bitmap; |