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/src/gpu/text/GrStencilAndCoverTextContext.cpp b/src/gpu/text/GrStencilAndCoverTextContext.cpp
index 02b7ffd..32d8021 100644
--- a/src/gpu/text/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp
@@ -344,7 +344,7 @@
void appendGlyph(uint16_t glyphId, const SkPoint& pos);
- const SkTextBlob* buildIfNeeded(int* count);
+ sk_sp<SkTextBlob> makeIfNeeded(int* count);
private:
enum { kWriteBufferSize = 1024 };
@@ -521,7 +521,7 @@
y += SkFloatToScalar(glyph.fAdvanceY) * fTextRatio;
}
- fFallbackTextBlob.reset(fallback.buildIfNeeded(&fFallbackGlyphCount));
+ fFallbackTextBlob = fallback.makeIfNeeded(&fFallbackGlyphCount);
}
void GrStencilAndCoverTextContext::TextRun::setPosText(const char text[], size_t byteLength,
@@ -557,7 +557,7 @@
pos += scalarsPerPosition;
}
- fFallbackTextBlob.reset(fallback.buildIfNeeded(&fFallbackGlyphCount));
+ fFallbackTextBlob = fallback.makeIfNeeded(&fFallbackGlyphCount);
}
GrPathRange* GrStencilAndCoverTextContext::TextRun::createGlyphs(GrContext* ctx) const {
@@ -654,7 +654,8 @@
}
fallbackTextContext->drawTextBlob(ctx, drawContext, clip, fallbackSkPaint, viewMatrix,
- props, fFallbackTextBlob, x, y, nullptr, clipBounds);
+ props, fFallbackTextBlob.get(), x, y, nullptr,
+ clipBounds);
}
}
@@ -728,11 +729,11 @@
fBuffIdx = 0;
}
-const SkTextBlob* GrStencilAndCoverTextContext::FallbackBlobBuilder::buildIfNeeded(int *count) {
+sk_sp<SkTextBlob> GrStencilAndCoverTextContext::FallbackBlobBuilder::makeIfNeeded(int *count) {
*count = fCount;
if (fCount) {
this->flush();
- return fBuilder->build();
+ return fBuilder->make();
}
return nullptr;
}