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

Unified Diff: tools/debugger/SkDrawCommand.cpp

Issue 2335493005: Use sk_sp text blob APIs (Closed)
Patch Set: Created 4 years, 3 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
Index: tools/debugger/SkDrawCommand.cpp
diff --git a/tools/debugger/SkDrawCommand.cpp b/tools/debugger/SkDrawCommand.cpp
index d77a554fa403d4a188e9b0cf9ebd19d19988d483..5c6c59f44667de5682d21325a424b4903fe53ecd 100644
--- a/tools/debugger/SkDrawCommand.cpp
+++ b/tools/debugger/SkDrawCommand.cpp
@@ -2797,10 +2797,10 @@ static const char* gPositioningLabels[] = {
"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) {
@@ -2814,7 +2814,7 @@ SkDrawTextBlobCommand::SkDrawTextBlobCommand(const SkTextBlob* blob, SkScalar x,
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++);
@@ -2847,7 +2847,7 @@ bool SkDrawTextBlobCommand::render(SkCanvas* canvas) const {
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();
@@ -2950,7 +2950,7 @@ SkDrawTextBlobCommand* SkDrawTextBlobCommand::fromJSON(Json::Value& command,
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],
« src/gpu/text/GrStencilAndCoverTextContext.cpp ('K') | « tools/debugger/SkDrawCommand.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698