Use sk_sp text blob APIs
SkTextBlobBuilder::build() -> make()
SkAutoTUnref<const SkTextBlob> -> sk_sp<SkTextBlob>
drawTextBlob(const SkTextBlob*) -> drawTextBlob(const sk_sp<SkTextBlob>&)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2335493005
Review-Url: https://codereview.chromium.org/2335493005
diff --git a/tools/debugger/SkDrawCommand.cpp b/tools/debugger/SkDrawCommand.cpp
index 6ca3fe0..0f81013 100644
--- a/tools/debugger/SkDrawCommand.cpp
+++ b/tools/debugger/SkDrawCommand.cpp
@@ -2796,10 +2796,10 @@
"kFull_Positioning",
};
-SkDrawTextBlobCommand::SkDrawTextBlobCommand(const SkTextBlob* blob, SkScalar x, SkScalar y,
+SkDrawTextBlobCommand::SkDrawTextBlobCommand(sk_sp<SkTextBlob> blob, SkScalar x, SkScalar y,
const SkPaint& paint)
: INHERITED(kDrawTextBlob_OpType)
- , fBlob(SkRef(blob))
+ , fBlob(std::move(blob))
, fXPos(x)
, fYPos(y)
, fPaint(paint) {
@@ -2813,7 +2813,7 @@
unsigned runs = 0;
SkPaint runPaint(paint);
- SkTextBlobRunIterator iter(blob);
+ SkTextBlobRunIterator iter(blob.get());
while (!iter.done()) {
SkAutoTDelete<SkString> tmpStr(new SkString);
tmpStr->printf("==== Run [%d] ====", runs++);
@@ -2846,7 +2846,7 @@
SkRect bounds = fBlob->bounds().makeOffset(fXPos, fYPos);
xlate_and_scale_to_bounds(canvas, bounds);
- canvas->drawTextBlob(fBlob.get(), fXPos, fYPos, fPaint);
+ canvas->drawTextBlob(fBlob, fXPos, fYPos, fPaint);
canvas->restore();
@@ -2949,7 +2949,7 @@
SkScalar y = command[SKDEBUGCANVAS_ATTRIBUTE_Y].asFloat();
SkPaint paint;
extract_json_paint(command[SKDEBUGCANVAS_ATTRIBUTE_PAINT], urlDataManager, &paint);
- return new SkDrawTextBlobCommand(builder.build(), x, y, paint);
+ return new SkDrawTextBlobCommand(builder.make(), x, y, paint);
}
SkDrawPatchCommand::SkDrawPatchCommand(const SkPoint cubics[12], const SkColor colors[4],