aboutsummaryrefslogtreecommitdiffhomepage
path: root/debugger
diff options
context:
space:
mode:
authorGravatar chudy@google.com <chudy@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-01 16:10:06 +0000
committerGravatar chudy@google.com <chudy@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-01 16:10:06 +0000
commit92b11f610376dea7192ade22dde31c8bb8ede76c (patch)
tree49b22a8fe653b0b3a98b5e5fb296c80c739b5328 /debugger
parentfbf31949ac31271362750168ffcb13a04408b721 (diff)
Added more DrawPoints debugging info for inspector
Review URL: https://codereview.appspot.com/6441084 git-svn-id: http://skia.googlecode.com/svn/trunk@4893 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'debugger')
-rw-r--r--debugger/SkDrawCommand.cpp2
-rw-r--r--debugger/SkObjectParser.cpp13
-rw-r--r--debugger/SkObjectParser.h5
3 files changed, 20 insertions, 0 deletions
diff --git a/debugger/SkDrawCommand.cpp b/debugger/SkDrawCommand.cpp
index 1e569b4eec..5844049fe8 100644
--- a/debugger/SkDrawCommand.cpp
+++ b/debugger/SkDrawCommand.cpp
@@ -256,6 +256,8 @@ DrawPoints::DrawPoints(SkCanvas::PointMode mode, size_t count,
this->fDrawType = DRAW_POINTS;
this->fInfo.push_back(SkObjectParser::PointsToString(pts, count));
+ this->fInfo.push_back(SkObjectParser::ScalarToString(count, "Points: "));
+ this->fInfo.push_back(SkObjectParser::PointModeToString(mode));
}
void DrawPoints::execute(SkCanvas* canvas) {
diff --git a/debugger/SkObjectParser.cpp b/debugger/SkObjectParser.cpp
index 0381e7ce15..68774c2682 100644
--- a/debugger/SkObjectParser.cpp
+++ b/debugger/SkObjectParser.cpp
@@ -87,6 +87,19 @@ std::string SkObjectParser::PointsToString(const SkPoint pts[], size_t count) {
return ss.str();
}
+std::string SkObjectParser::PointModeToString(SkCanvas::PointMode mode) {
+ std::string mMode("SkCanvas::PointMode: ");
+ if (mode == SkCanvas::kPoints_PointMode) {
+ mMode.append("kPoints_PointMode");
+ } else if (mode == SkCanvas::kLines_PointMode) {
+ mMode.append("kLines_Mode");
+ } else if (mode == SkCanvas::kPolygon_PointMode) {
+ mMode.append("kPolygon_PointMode");
+ }
+
+ return mMode;
+}
+
std::string SkObjectParser::RectToString(const SkRect& rect) {
std::string mRect("SkRect: ");
std::stringstream ss;
diff --git a/debugger/SkObjectParser.h b/debugger/SkObjectParser.h
index 5b71abc73d..f08ca08182 100644
--- a/debugger/SkObjectParser.h
+++ b/debugger/SkObjectParser.h
@@ -73,6 +73,11 @@ public:
static std::string PointsToString(const SkPoint pts[], size_t count);
/**
+ Returns a string representation of the SkCanvas PointMode enum.
+ */
+ static std::string PointModeToString(SkCanvas::PointMode mode);
+
+ /**
Returns a string representation of the SkRects coordinates.
@param rect SkRect
*/