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

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

Issue 1521613002: Make draw* lines responsible for cache management (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanuptext13reallytexutilsdf
Patch Set: Created 5 years 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
« include/core/SkPaint.h ('K') | « src/gpu/text/GrTextUtils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/text/GrTextUtils.cpp
diff --git a/src/gpu/text/GrTextUtils.cpp b/src/gpu/text/GrTextUtils.cpp
index 293ea4d891edac7888625522a1563b663bb9e675..9d6bb2c857dfa18de7a512bf1037e60d487dcd8d 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,
« include/core/SkPaint.h ('K') | « src/gpu/text/GrTextUtils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698