diff options
author | 2015-12-28 07:23:58 -0800 | |
---|---|---|
committer | 2015-12-28 07:23:58 -0800 | |
commit | e76b4bb3ae03ae85119055eac44f2721578e8202 (patch) | |
tree | dbd74fce2241f376ac2b3265e10bd9b04fdf499d /src/gpu/text/GrTextUtils.cpp | |
parent | 90e293dae4990a86cb952663ccde8fae55112d7d (diff) |
Reland of Make draw* lines responsible for cache management (patchset #1 id:1 of https://codereview.chromium.org/1552513003/ )
Reason for revert:
might have been premature
Original issue's description:
> Revert of Make draw* lines responsible for cache management (patchset #1 id:1 of https://codereview.chromium.org/1521613002/ )
>
> Reason for revert:
> seeing crashes on android and linux
>
> Original issue's description:
> > Make draw* lines responsible for cache management
> >
> > TBR=bsalomon@google.com
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/66957946c0c418e71c0f36bb2904cc38c334eba4
>
> TBR=bsalomon@google.com,jvanverth@google.com,joshualitt@chromium.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/90e293dae4990a86cb952663ccde8fae55112d7d
TBR=bsalomon@google.com,jvanverth@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/1551563003
Diffstat (limited to 'src/gpu/text/GrTextUtils.cpp')
-rw-r--r-- | src/gpu/text/GrTextUtils.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gpu/text/GrTextUtils.cpp b/src/gpu/text/GrTextUtils.cpp index 293ea4d891..9d6bb2c857 100644 --- a/src/gpu/text/GrTextUtils.cpp +++ b/src/gpu/text/GrTextUtils.cpp @@ -23,7 +23,7 @@ void GrTextUtils::DrawBmpText(GrAtlasTextBlob* blob, int runIndex, GrBatchFontCache* fontCache, - SkGlyphCache* cache, const SkPaint& skPaint, + const SkSurfaceProps& props, const SkPaint& skPaint, GrColor color, const SkMatrix& viewMatrix, const char text[], size_t byteLength, @@ -38,6 +38,7 @@ void GrTextUtils::DrawBmpText(GrAtlasTextBlob* blob, int runIndex, GrBatchTextStrike* currStrike = nullptr; // Get GrFontScaler from cache + SkGlyphCache* cache = blob->setupCache(runIndex, props, skPaint, &viewMatrix, false); GrFontScaler* fontScaler = GrTextContext::GetGrFontScaler(cache); SkFindAndPlaceGlyph::ProcessText( @@ -52,11 +53,13 @@ void GrTextUtils::DrawBmpText(GrAtlasTextBlob* blob, int runIndex, color, fontScaler); } ); + + SkGlyphCache::AttachCache(cache); } void GrTextUtils::DrawBmpPosText(GrAtlasTextBlob* blob, int runIndex, GrBatchFontCache* fontCache, - SkGlyphCache* cache, const SkPaint& skPaint, + const SkSurfaceProps& props, const SkPaint& skPaint, GrColor color, const SkMatrix& viewMatrix, const char text[], size_t byteLength, @@ -73,6 +76,7 @@ void GrTextUtils::DrawBmpPosText(GrAtlasTextBlob* blob, int runIndex, GrBatchTextStrike* currStrike = nullptr; // Get GrFontScaler from cache + SkGlyphCache* cache = blob->setupCache(runIndex, props, skPaint, &viewMatrix, false); GrFontScaler* fontScaler = GrTextContext::GetGrFontScaler(cache); SkFindAndPlaceGlyph::ProcessPosText( @@ -87,6 +91,8 @@ void GrTextUtils::DrawBmpPosText(GrAtlasTextBlob* blob, int runIndex, color, fontScaler); } ); + + SkGlyphCache::AttachCache(cache); } void GrTextUtils::BmpAppendGlyph(GrAtlasTextBlob* blob, int runIndex, |