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

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

Issue 1507033003: [SkDebugger] Show more text blob details (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 5 years 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 | « no previous file | 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
diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp
index 66f0c14f2d2ef66085bcc3d3b18ac4a05f0702c7..330c2c9183cecf156a995c0b0b4d2feddeeb8190 100644
--- a/src/utils/debugger/SkDrawCommand.cpp
+++ b/src/utils/debugger/SkDrawCommand.cpp
@@ -11,6 +11,7 @@
#include "SkObjectParser.h"
#include "SkPicture.h"
#include "SkTextBlob.h"
+#include "SkTextBlobRunIterator.h"
// TODO(chudy): Refactor into non subclass model.
@@ -678,18 +679,36 @@ void SkDrawPosTextHCommand::execute(SkCanvas* canvas) const {
SkDrawTextBlobCommand::SkDrawTextBlobCommand(const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint& paint)
: INHERITED(kDrawTextBlob_OpType)
- , fBlob(blob)
+ , fBlob(SkRef(blob))
, fXPos(x)
, fYPos(y)
, fPaint(paint) {
- blob->ref();
-
- // FIXME: push blob info
+ SkAutoTDelete<SkString> runsStr(new SkString);
fInfo.push(SkObjectParser::ScalarToString(x, "XPOS: "));
fInfo.push(SkObjectParser::ScalarToString(y, "YPOS: "));
fInfo.push(SkObjectParser::RectToString(fBlob->bounds(), "Bounds: "));
+ fInfo.push(runsStr);
fInfo.push(SkObjectParser::PaintToString(paint));
+
+ unsigned runs = 0;
+ SkPaint runPaint(paint);
+ SkTextBlobRunIterator iter(blob);
+ while (!iter.done()) {
+ SkAutoTDelete<SkString> label(new SkString);
+ label->printf("==== Run [%d] ====", runs++);
+ fInfo.push(label.release());
+
+ fInfo.push(SkObjectParser::IntToString(iter.glyphCount(), "GlyphCount: "));
+ iter.applyFontToPaint(&runPaint);
+ fInfo.push(SkObjectParser::PaintToString(runPaint));
+
+ iter.next();
+ }
+
+ runsStr->printf("Runs: %d", runs);
+ // runStr is owned by fInfo at this point.
+ runsStr.release();
}
void SkDrawTextBlobCommand::execute(SkCanvas* canvas) const {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698