Pointer to GrStrikeCache on GrTextBlob
This will allow all the glyph drawing closures to live on the
GrTextBlob.
Other cleanup
* Rename glyphCache things to grStrikeCache.
Change-Id: I03e0353a1434230086a08184221272f1e5751ae6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197244
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
diff --git a/src/gpu/text/GrTextBlob.cpp b/src/gpu/text/GrTextBlob.cpp
index 8feaa1a..0ab8f6d 100644
--- a/src/gpu/text/GrTextBlob.cpp
+++ b/src/gpu/text/GrTextBlob.cpp
@@ -23,7 +23,10 @@
return ((s + (N-1)) / N) * N;
}
-sk_sp<GrTextBlob> GrTextBlob::Make(int glyphCount, int runCount, GrColor color) {
+sk_sp<GrTextBlob> GrTextBlob::Make(int glyphCount,
+ int runCount,
+ GrColor color,
+ GrStrikeCache* strikeCache) {
// We allocate size for the GrTextBlob itself, plus size for the vertices array,
// and size for the glyphIds array.
size_t verticesCount = glyphCount * kVerticesPerGlyph * kMaxVASize;
@@ -40,7 +43,7 @@
sk_bzero(allocation, size);
}
- sk_sp<GrTextBlob> blob{new (allocation) GrTextBlob{}};
+ sk_sp<GrTextBlob> blob{new (allocation) GrTextBlob{strikeCache}};
blob->fSize = size;
// setup offsets for vertices / glyphs