Chromium Code Reviews| Index: src/gpu/text/GrStencilAndCoverTextContext.cpp |
| diff --git a/src/gpu/text/GrStencilAndCoverTextContext.cpp b/src/gpu/text/GrStencilAndCoverTextContext.cpp |
| index 02b7ffd15a1ab7348bf506ede334d2fa384880bb..6ea12ea404447ef06371c789ff33233e864f2d09 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); |
|
robertphillips
2016/09/13 12:37:59
makeIfNeeded ?
f(malita)
2016/09/13 13:41:57
Done.
|
| - const SkTextBlob* buildIfNeeded(int* count); |
| + sk_sp<SkTextBlob> buildIfNeeded(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.buildIfNeeded(&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.buildIfNeeded(&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::buildIfNeeded(int *count) { |
| *count = fCount; |
| if (fCount) { |
| this->flush(); |
| - return fBuilder->build(); |
| + return fBuilder->make(); |
| } |
| return nullptr; |
| } |