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

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

Issue 177683003: Add DRRect to debugger (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Cleanup Created 6 years, 10 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 | « src/utils/debugger/SkDrawCommand.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/utils/debugger/SkDrawCommand.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698