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

Unified Diff: src/gpu/text/GrStencilAndCoverTextContext.cpp

Issue 2335493005: Use sk_sp text blob APIs (Closed)
Patch Set: SK_SUPPORT_LEGACY_TEXTBLOB_BUILDER 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
« no previous file with comments | « src/gpu/text/GrStencilAndCoverTextContext.h ('k') | src/utils/SkLua.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/text/GrStencilAndCoverTextContext.cpp
diff --git a/src/gpu/text/GrStencilAndCoverTextContext.cpp b/src/gpu/text/GrStencilAndCoverTextContext.cpp
index 02b7ffd15a1ab7348bf506ede334d2fa384880bb..32d80218d32cfc1bb438ceaadd108923f16f3f3f 100644
--- a/src/gpu/text/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp
@@ -344,7 +344,7 @@ public:
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 @@ void GrStencilAndCoverTextContext::TextRun::setText(const char text[], size_t by
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 @@ void GrStencilAndCoverTextContext::TextRun::setPosText(const char text[], size_t
pos += scalarsPerPosition;
}
- fFallbackTextBlob.reset(fallback.buildIfNeeded(&fFallbackGlyphCount));
+ fFallbackTextBlob = fallback.makeIfNeeded(&fFallbackGlyphCount);
}
GrPathRange* GrStencilAndCoverTextContext::TextRun::createGlyphs(GrContext* ctx) const {
@@ -654,7 +654,8 @@ void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx,
}
fallbackTextContext->drawTextBlob(ctx, drawContext, clip, fallbackSkPaint, viewMatrix,
- props, fFallbackTextBlob, x, y, nullptr, clipBounds);
+ props, fFallbackTextBlob.get(), x, y, nullptr,
+ clipBounds);
}
}
@@ -728,11 +729,11 @@ void GrStencilAndCoverTextContext::FallbackBlobBuilder::flush() {
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;
}
« no previous file with comments | « src/gpu/text/GrStencilAndCoverTextContext.h ('k') | src/utils/SkLua.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698