diff options
author | fmalita <fmalita@chromium.org> | 2016-01-04 08:08:04 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-04 08:08:05 -0800 |
commit | 0d48e4175a69fb6c50ca19f0891558ff829a753d (patch) | |
tree | e81b726346dc65a4dd1447fa241f54c0c0c9f364 /src | |
parent | ffe031e65cda3f52e057dd7aafbc9407c25cbf8d (diff) |
[SkDebugger] Display run glyph positioning modes
R=robertphillips@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1559883002
Review URL: https://codereview.chromium.org/1559883002
Diffstat (limited to 'src')
-rw-r--r-- | src/utils/debugger/SkDrawCommand.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp index bb9f2f831d..17c59e67a6 100644 --- a/src/utils/debugger/SkDrawCommand.cpp +++ b/src/utils/debugger/SkDrawCommand.cpp @@ -675,6 +675,12 @@ void SkDrawPosTextHCommand::execute(SkCanvas* canvas) const { canvas->drawPosTextH(fText, fByteLength, fXpos, fConstY, fPaint); } +static const char* gPositioningLabels[] = { + "kDefault_Positioning", + "kHorizontal_Positioning", + "kFull_Positioning", +}; + SkDrawTextBlobCommand::SkDrawTextBlobCommand(const SkTextBlob* blob, SkScalar x, SkScalar y, const SkPaint& paint) : INHERITED(kDrawTextBlob_OpType) @@ -694,11 +700,15 @@ SkDrawTextBlobCommand::SkDrawTextBlobCommand(const SkTextBlob* blob, SkScalar x, SkPaint runPaint(paint); SkTextBlobRunIterator iter(blob); while (!iter.done()) { - SkAutoTDelete<SkString> label(new SkString); - label->printf("==== Run [%d] ====", runs++); - fInfo.push(label.release()); + SkAutoTDelete<SkString> tmpStr(new SkString); + tmpStr->printf("==== Run [%d] ====", runs++); + fInfo.push(tmpStr.release()); fInfo.push(SkObjectParser::IntToString(iter.glyphCount(), "GlyphCount: ")); + tmpStr.reset(new SkString("GlyphPositioning: ")); + tmpStr->append(gPositioningLabels[iter.positioning()]); + fInfo.push(tmpStr.release()); + iter.applyFontToPaint(&runPaint); fInfo.push(SkObjectParser::PaintToString(runPaint)); |