blob: f87d8e1ab7a43819dd592d285244c1f6fef7ebb0 [file] [log] [blame]
joshualitt374b2f72015-07-21 08:05:03 -07001/*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
Herb Derby86240592018-05-24 16:12:31 -04008#ifndef GrTextBlob_DEFINED
9#define GrTextBlob_DEFINED
joshualitt374b2f72015-07-21 08:05:03 -070010
Mike Kleinc0bd9f92019-04-23 12:05:21 -050011#include "include/core/SkPathEffect.h"
12#include "include/core/SkPoint3.h"
13#include "include/core/SkSurfaceProps.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050014#include "src/core/SkDescriptor.h"
15#include "src/core/SkMaskFilterBase.h"
16#include "src/core/SkOpts.h"
17#include "src/core/SkRectPriv.h"
18#include "src/core/SkStrikeCache.h"
Herb Derbye7efd082019-05-28 11:30:33 -040019#include "src/core/SkStrikeSpec.h"
Ben Wagner729a23f2019-05-17 16:29:34 -040020#include "src/core/SkTInternalLList.h"
Greg Danielf91aeb22019-06-18 09:58:02 -040021#include "src/gpu/GrColor.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050022#include "src/gpu/GrDrawOpAtlas.h"
23#include "src/gpu/text/GrStrikeCache.h"
24#include "src/gpu/text/GrTextContext.h"
25#include "src/gpu/text/GrTextTarget.h"
joshualitt374b2f72015-07-21 08:05:03 -070026
Robert Phillipsc4039ea2018-03-01 11:36:45 -050027class GrAtlasManager;
Herb Derby660c2ff2019-11-14 18:22:41 -050028class GrAtlasTextOp;
joshualitt2e2202e2015-12-10 11:22:08 -080029struct GrDistanceFieldAdjustTable;
Robert Phillipsc4039ea2018-03-01 11:36:45 -050030struct GrGlyph;
Robert Phillipsc4039ea2018-03-01 11:36:45 -050031
joshualitt2e2202e2015-12-10 11:22:08 -080032class SkTextBlob;
33class SkTextBlobRunIterator;
34
joshualitt374b2f72015-07-21 08:05:03 -070035/*
Herb Derby86240592018-05-24 16:12:31 -040036 * A GrTextBlob contains a fully processed SkTextBlob, suitable for nearly immediate drawing
joshualitt374b2f72015-07-21 08:05:03 -070037 * on the GPU. These are initially created with valid positions and colors, but invalid
Herb Derby86240592018-05-24 16:12:31 -040038 * texture coordinates. The GrTextBlob itself has a few Blob-wide properties, and also
joshualitt374b2f72015-07-21 08:05:03 -070039 * consists of a number of runs. Runs inside a blob are flushed individually so they can be
40 * reordered.
41 *
Herb Derby86240592018-05-24 16:12:31 -040042 * The only thing(aside from a memcopy) required to flush a GrTextBlob is to ensure that
joshualitt374b2f72015-07-21 08:05:03 -070043 * the GrAtlas will not evict anything the Blob needs.
44 *
joshualitt374b2f72015-07-21 08:05:03 -070045 */
Herb Derbya9047642019-12-06 12:12:11 -050046class GrTextBlob final : public SkNVRefCnt<GrTextBlob>, public SkGlyphRunPainterInterface {
joshualitt2e2202e2015-12-10 11:22:08 -080047public:
Herb Derby660c2ff2019-11-14 18:22:41 -050048 class SubRun;
Herb Derbya9047642019-12-06 12:12:11 -050049 class VertexRegenerator;
Herb Derby1b8dcd12019-11-15 15:21:15 -050050 using SubRunBufferSpec = std::tuple<uint32_t, uint32_t, size_t, size_t>;
joshualitt374b2f72015-07-21 08:05:03 -070051
Herb Derbya9047642019-12-06 12:12:11 -050052 enum SubRunType {
53 kDirectMask,
54 kTransformedMask,
55 kTransformedPath,
56 kTransformedSDFT
57 };
joshualitt323c2eb2016-01-20 06:48:47 -080058
59 struct Key {
Herb Derbya9047642019-12-06 12:12:11 -050060 Key();
joshualitt323c2eb2016-01-20 06:48:47 -080061 uint32_t fUniqueID;
62 // Color may affect the gamma of the mask we generate, but in a fairly limited way.
63 // Each color is assigned to on of a fixed number of buckets based on its
64 // luminance. For each luminance bucket there is a "canonical color" that
65 // represents the bucket. This functionality is currently only supported for A8
66 SkColor fCanonicalColor;
67 SkPaint::Style fStyle;
68 SkPixelGeometry fPixelGeometry;
69 bool fHasBlur;
brianosman8d7ffce2016-04-21 08:29:06 -070070 uint32_t fScalerContextFlags;
joshualitt323c2eb2016-01-20 06:48:47 -080071
Herb Derbya9047642019-12-06 12:12:11 -050072 bool operator==(const Key& other) const;
joshualitt323c2eb2016-01-20 06:48:47 -080073 };
74
Herb Derbya9047642019-12-06 12:12:11 -050075 // Any glyphs that can't be rendered with the base or override descriptor
76 // are rendered as paths
77 struct PathGlyph {
78 PathGlyph(const SkPath& path, SkPoint origin);
79 SkPath fPath;
80 SkPoint fOrigin;
81 };
82
83 // Hold data to draw the different types of sub run. SubRuns are produced knowing all the
84 // glyphs that are included in them.
85 class SubRun {
86 public:
87 // SubRun for masks
88 SubRun(SubRunType type,
89 GrTextBlob* textBlob,
90 const SkStrikeSpec& strikeSpec,
91 GrMaskFormat format,
92 const SubRunBufferSpec& bufferSpec,
93 sk_sp<GrTextStrike>&& grStrike);
94
95 // SubRun for paths
96 SubRun(GrTextBlob* textBlob, const SkStrikeSpec& strikeSpec);
97
98 void appendGlyphs(const SkZip<SkGlyphVariant, SkPoint>& drawables);
99
100 // TODO when this object is more internal, drop the privacy
101 void resetBulkUseToken();
102 GrDrawOpAtlas::BulkUseTokenUpdater* bulkUseToken();
103 void setStrike(sk_sp<GrTextStrike> strike);
104 GrTextStrike* strike() const;
105 sk_sp<GrTextStrike> refStrike() const;
106
107 void setAtlasGeneration(uint64_t atlasGeneration);
108 uint64_t atlasGeneration() const;
109
110 size_t vertexStartIndex() const;
111 uint32_t glyphCount() const;
112 uint32_t glyphStartIndex() const;
113
114 void setColor(GrColor color);
115 GrColor color() const;
116
117 GrMaskFormat maskFormat() const;
118
119 const SkRect& vertexBounds() const;
120 void joinGlyphBounds(const SkRect& glyphBounds);
121
122 void init(const SkMatrix& viewMatrix, SkScalar x, SkScalar y);
123
124 // This function assumes the translation will be applied before it is called again
125 void computeTranslation(const SkMatrix& viewMatrix, SkScalar x, SkScalar y,
126 SkScalar* transX, SkScalar* transY);
127
128 bool drawAsDistanceFields() const;
129 bool drawAsPaths() const;
130 bool needsTransform() const;
131 bool hasW() const;
132
133 // df properties
134 void setUseLCDText(bool useLCDText);
135 bool hasUseLCDText() const;
136 void setAntiAliased(bool antiAliased);
137 bool isAntiAliased() const;
138
139 const SkStrikeSpec& strikeSpec() const;
140
141 const SubRunType fType;
142 GrTextBlob* const fBlob;
143 const GrMaskFormat fMaskFormat;
144 const uint32_t fGlyphStartIndex;
145 const uint32_t fGlyphEndIndex;
146 const size_t fVertexStartIndex;
147 const size_t fVertexEndIndex;
148 const SkStrikeSpec fStrikeSpec;
149 sk_sp<GrTextStrike> fStrike;
150 struct {
151 bool useLCDText:1;
152 bool antiAliased:1;
153 } fFlags{false, false};
154 GrColor fColor;
155 GrDrawOpAtlas::BulkUseTokenUpdater fBulkUseToken;
156 SkRect fVertexBounds = SkRectPriv::MakeLargestInverted();
157 uint64_t fAtlasGeneration{GrDrawOpAtlas::kInvalidAtlasGeneration};
158 SkScalar fX;
159 SkScalar fY;
160 SkMatrix fCurrentViewMatrix;
161 std::vector<PathGlyph> fPaths;
162 }; // SubRun
163
164 SK_DECLARE_INTERNAL_LLIST_INTERFACE(GrTextBlob);
165
166 // Change memory management to handle the data after GrTextBlob, but in the same allocation
167 // of memory. Only allow placement new.
168 void operator delete(void* p);
169 void* operator new(size_t);
170 void* operator new(size_t, void* p);
171
172 ~GrTextBlob() override;
173
174 // Make an empty GrTextBlob, with all the invariants set to make the right decisions when
175 // adding SubRuns.
176 static sk_sp<GrTextBlob> Make(int glyphCount,
177 GrStrikeCache* strikeCache,
178 const SkMatrix& viewMatrix,
179 SkPoint origin,
180 GrColor color,
181 bool forceWForDistanceFields);
182
183 void generateFromGlyphRunList(const GrShaderCaps& shaderCaps,
184 const GrTextContext::Options& options,
185 const SkPaint& paint,
186 const SkMatrix& viewMatrix,
187 const SkSurfaceProps& props,
188 const SkGlyphRunList& glyphRunList,
189 SkGlyphRunListPainter* glyphPainter);
190
191 // Key manipulation functions
Herb Derby86240592018-05-24 16:12:31 -0400192 void setupKey(const GrTextBlob::Key& key,
Mike Reed80747ef2018-01-23 15:29:32 -0500193 const SkMaskFilterBase::BlurRec& blurRec,
Herb Derbya9047642019-12-06 12:12:11 -0500194 const SkPaint& paint);
195 static const Key& GetKey(const GrTextBlob& blob);
196 static uint32_t Hash(const Key& key);
joshualitt92303772016-02-10 11:55:52 -0800197
Herb Derbya9047642019-12-06 12:12:11 -0500198 bool hasDistanceField() const;
199 bool hasBitmap() const;
200 bool hasPerspective() const;
joshualitt323c2eb2016-01-20 06:48:47 -0800201
Herb Derbya9047642019-12-06 12:12:11 -0500202 void setHasDistanceField();
203 void setHasBitmap();
204 void setMinAndMaxScale(SkScalar scaledMin, SkScalar scaledMax);
joshualitt323c2eb2016-01-20 06:48:47 -0800205
Herb Derbya9047642019-12-06 12:12:11 -0500206 static size_t GetVertexStride(GrMaskFormat maskFormat, bool hasWCoord);
joshualitt323c2eb2016-01-20 06:48:47 -0800207
Herb Derby0edb2142018-10-16 17:04:11 -0400208 bool mustRegenerate(const SkPaint&, bool, const SkMaskFilterBase::BlurRec& blurRec,
joshualitt323c2eb2016-01-20 06:48:47 -0800209 const SkMatrix& viewMatrix, SkScalar x, SkScalar y);
210
Herb Derbyc1b482c2018-08-09 15:02:27 -0400211 void flush(GrTextTarget*, const SkSurfaceProps& props,
Jim Van Verth54d9c882018-02-08 16:14:48 -0500212 const GrDistanceFieldAdjustTable* distanceAdjustTable,
Brian Osmancf860852018-10-31 14:04:39 -0400213 const SkPaint& paint, const SkPMColor4f& filteredColor, const GrClip& clip,
Robert Phillipse4643cc2018-08-14 13:01:29 -0400214 const SkMatrix& viewMatrix, SkScalar x, SkScalar y);
joshualitt323c2eb2016-01-20 06:48:47 -0800215
Herb Derby660c2ff2019-11-14 18:22:41 -0500216 void computeSubRunBounds(SkRect* outBounds, const SubRun& subRun,
Jim Van Verth70276912018-06-01 13:46:46 -0400217 const SkMatrix& viewMatrix, SkScalar x, SkScalar y,
Herb Derbyeba195f2019-12-03 16:44:47 -0500218 bool needsGlyphTransform);
joshualittbc811112016-02-11 12:42:02 -0800219
Herb Derbycd498e12019-12-06 14:17:31 -0500220 // Normal text mask, SDFT, or color.
221 struct Mask2DVertex {
222 SkPoint devicePos;
223 GrColor color;
224 SkIPoint16 atlasPos;
225 };
226 struct ARGB2DVertex {
227 SkPoint devicePos;
228 SkIPoint16 atlasPos;
229 };
230
231 // Perspective SDFT or SDFT forced to 3D or perspective color.
232 struct SDFT3DVertex {
233 SkPoint3 devicePos;
234 GrColor color;
235 SkIPoint16 atlasPos;
236 };
237 struct ARGB3DVertex {
238 SkPoint3 devicePos;
239 SkIPoint16 atlasPos;
240 };
241
joshualitt323c2eb2016-01-20 06:48:47 -0800242 static const int kVerticesPerGlyph = 4;
243
Herb Derbyeba195f2019-12-03 16:44:47 -0500244 // This function will only be called when we are generating a blob from scratch.
joshualitt323c2eb2016-01-20 06:48:47 -0800245 // The color here is the GrPaint color, and it is used to determine whether we
246 // have to regenerate LCD text blobs.
Herb Derbye9f691d2019-12-04 12:11:13 -0500247 // We use this color vs the SkPaint color because it has the color filter applied.
Herb Derbya9047642019-12-06 12:12:11 -0500248 void initReusableBlob(SkColor luminanceColor);
joshualitt323c2eb2016-01-20 06:48:47 -0800249
Herb Derbya9047642019-12-06 12:12:11 -0500250 const Key& key() const;
251 size_t size() const;
joshualitt92303772016-02-10 11:55:52 -0800252
joshualittbc811112016-02-11 12:42:02 -0800253 // Internal test methods
Herb Derbya6c4a302019-11-21 11:58:10 -0500254 std::unique_ptr<GrDrawOp> test_makeOp(int glyphCount,
Brian Salomon44acb5b2017-07-18 19:59:24 -0400255 const SkMatrix& viewMatrix, SkScalar x, SkScalar y,
Brian Osmancf860852018-10-31 14:04:39 -0400256 const SkPaint& paint, const SkPMColor4f& filteredColor,
Herb Derbybc6f9c92018-08-08 13:58:45 -0400257 const SkSurfaceProps&, const GrDistanceFieldAdjustTable*,
Herb Derbyc1b482c2018-08-09 15:02:27 -0400258 GrTextTarget*);
joshualittbc811112016-02-11 12:42:02 -0800259
Herb Derbya9047642019-12-06 12:12:11 -0500260 bool hasW(SubRunType type) const;
Herb Derby1b8dcd12019-11-15 15:21:15 -0500261
262 SubRun* makeSubRun(SubRunType type,
263 const SkZip<SkGlyphVariant, SkPoint>& drawables,
264 const SkStrikeSpec& strikeSpec,
265 GrMaskFormat format);
266
267 void addSingleMaskFormat(
268 SubRunType type,
269 const SkZip<SkGlyphVariant, SkPoint>& drawables,
270 const SkStrikeSpec& strikeSpec,
271 GrMaskFormat format);
272
273 void addMultiMaskFormat(
274 SubRunType type,
275 const SkZip<SkGlyphVariant, SkPoint>& drawables,
276 const SkStrikeSpec& strikeSpec);
277
278 void addSDFT(const SkZip<SkGlyphVariant, SkPoint>& drawables,
279 const SkStrikeSpec& strikeSpec,
280 const SkFont& runFont,
281 SkScalar minScale,
282 SkScalar maxScale);
joshualitt374b2f72015-07-21 08:05:03 -0700283
Herb Derby660c2ff2019-11-14 18:22:41 -0500284private:
Herb Derbya9047642019-12-06 12:12:11 -0500285 enum TextType {
286 kHasDistanceField_TextType = 0x1,
287 kHasBitmap_TextType = 0x2,
288 };
Herb Derby00ae9592019-12-03 15:55:56 -0500289
290 struct StrokeInfo {
291 SkScalar fFrameWidth;
292 SkScalar fMiterLimit;
293 SkPaint::Join fJoin;
294 };
295
Herb Derbya9047642019-12-06 12:12:11 -0500296 GrTextBlob(size_t size,
297 GrStrikeCache* strikeCache,
298 const SkMatrix& viewMatrix,
299 SkPoint origin,
300 GrColor color,
301 bool forceWForDistanceFields);
Herb Derby00ae9592019-12-03 15:55:56 -0500302
Herb Derbyc72594a2019-03-05 17:39:38 -0500303 std::unique_ptr<GrAtlasTextOp> makeOp(
Herb Derbya6c4a302019-11-21 11:58:10 -0500304 SubRun& info, int glyphCount,
Brian Salomonf18b1d82017-10-27 11:30:49 -0400305 const SkMatrix& viewMatrix, SkScalar x, SkScalar y, const SkIRect& clipRect,
Brian Osmancf860852018-10-31 14:04:39 -0400306 const SkPaint& paint, const SkPMColor4f& filteredColor, const SkSurfaceProps&,
Herb Derbyc1b482c2018-08-09 15:02:27 -0400307 const GrDistanceFieldAdjustTable*, GrTextTarget*);
joshualitt323c2eb2016-01-20 06:48:47 -0800308
Herb Derbya9047642019-12-06 12:12:11 -0500309 // Methods to satisfy SkGlyphRunPainterInterface
Herb Derby20eafff2019-10-16 16:21:13 -0400310 void processDeviceMasks(const SkZip<SkGlyphVariant, SkPoint>& drawables,
Herb Derby36a54c12019-06-06 10:50:56 -0400311 const SkStrikeSpec& strikeSpec) override;
Herb Derby12130412019-10-21 18:02:24 -0400312 void processSourcePaths(const SkZip<SkGlyphVariant, SkPoint>& drawables,
Herb Derby1b8dcd12019-11-15 15:21:15 -0500313 const SkFont& runFont,
Herb Derby36a54c12019-06-06 10:50:56 -0400314 const SkStrikeSpec& strikeSpec) override;
Herb Derby20eafff2019-10-16 16:21:13 -0400315 void processSourceSDFT(const SkZip<SkGlyphVariant, SkPoint>& drawables,
Herb Derby36a54c12019-06-06 10:50:56 -0400316 const SkStrikeSpec& strikeSpec,
Herb Derbyc72594a2019-03-05 17:39:38 -0500317 const SkFont& runFont,
Herb Derbyc72594a2019-03-05 17:39:38 -0500318 SkScalar minScale,
Herb Derby1b8dcd12019-11-15 15:21:15 -0500319 SkScalar maxScale) override;
Herb Derby1b8dcd12019-11-15 15:21:15 -0500320 void processSourceMasks(const SkZip<SkGlyphVariant, SkPoint>& drawables,
321 const SkStrikeSpec& strikeSpec) override;
Herb Derbyc72594a2019-03-05 17:39:38 -0500322
Herb Derby00ae9592019-12-03 15:55:56 -0500323 // Overall size of this struct plus vertices and glyphs at the end.
324 const size_t fSize;
Herb Derby1b8dcd12019-11-15 15:21:15 -0500325
Herb Derby00ae9592019-12-03 15:55:56 -0500326 // Lifetime: The GrStrikeCache is owned by and has the same lifetime as the GrRecordingContext.
327 // The GrRecordingContext also owns the GrTextBlob cache which owns this GrTextBlob.
328 GrStrikeCache* const fStrikeCache;
329
Herb Derbye9f691d2019-12-04 12:11:13 -0500330 // The initial view matrix and its inverse. This is used for moving additional draws of this
331 // same text blob. We record the initial view matrix and initial offsets(x,y), because we
332 // record vertex bounds relative to these numbers. When blobs are reused with new matrices,
333 // we need to return to source space so we can update the vertex bounds appropriately.
334 const SkMatrix fInitialViewMatrix;
335 const SkMatrix fInitialViewMatrixInverse;
336
Herb Derbyeba195f2019-12-03 16:44:47 -0500337 // Initial position of this blob. Used for calculating position differences when reusing this
338 // blob.
339 const SkPoint fInitialOrigin;
340
Herb Derby00ae9592019-12-03 15:55:56 -0500341 // From the distance field options to force distance fields to have a W coordinate.
342 const bool fForceWForDistanceFields;
343
344 // The color of the text to draw for solid colors.
345 const GrColor fColor;
Herb Derby1b8dcd12019-11-15 15:21:15 -0500346
347 // Pool of bytes for vertex data.
348 char* fVertices;
349 // How much (in bytes) of the vertex data is used while accumulating SubRuns.
350 size_t fVerticesCursor{0};
351 // Pointers to every glyph that will be drawn.
352 GrGlyph** fGlyphs;
353 // Number of glyphs stored in fGlyphs while accumulating SubRuns.
354 uint32_t fGlyphsCursor{0};
355
356 // Assume one run per text blob.
357 SkSTArray<1, SubRun> fSubRuns;
358
Herb Derby1b8dcd12019-11-15 15:21:15 -0500359 SkMaskFilterBase::BlurRec fBlurRec;
joshualitt374b2f72015-07-21 08:05:03 -0700360 StrokeInfo fStrokeInfo;
joshualitt374b2f72015-07-21 08:05:03 -0700361 Key fKey;
Jim Van Verthbc2cdd12017-06-08 11:14:35 -0400362 SkColor fLuminanceColor;
joshualitt374b2f72015-07-21 08:05:03 -0700363
Herb Derbyeba195f2019-12-03 16:44:47 -0500364 // We can reuse distance field text, but only if the new view matrix would not result in
joshualitt374b2f72015-07-21 08:05:03 -0700365 // a mip change. Because there can be multiple runs in a blob, we track the overall
366 // maximum minimum scale, and minimum maximum scale, we can support before we need to regen
Herb Derbya00da612019-03-04 17:10:01 -0500367 SkScalar fMaxMinScale{-SK_ScalarMax};
368 SkScalar fMinMaxScale{SK_ScalarMax};
Herb Derby1b8dcd12019-11-15 15:21:15 -0500369
Herb Derbya00da612019-03-04 17:10:01 -0500370 uint8_t fTextType{0};
joshualitt374b2f72015-07-21 08:05:03 -0700371};
372
Brian Salomon18923f92017-11-06 16:26:02 -0500373/**
374 * Used to produce vertices for a subrun of a blob. The vertices are cached in the blob itself.
375 * This is invoked each time a sub run is drawn. It regenerates the vertex data as required either
376 * because of changes to the atlas or because of different draw parameters (e.g. color change). In
377 * rare cases the draw may have to interrupted and flushed in the middle of the sub run in order to
378 * free up atlas space. Thus, this generator is stateful and should be invoked in a loop until the
379 * entire sub run has been completed.
380 */
Herb Derby86240592018-05-24 16:12:31 -0400381class GrTextBlob::VertexRegenerator {
Brian Salomon18923f92017-11-06 16:26:02 -0500382public:
383 /**
384 * Consecutive VertexRegenerators often use the same SkGlyphCache. If the same instance of
385 * SkAutoGlyphCache is reused then it can save the cost of multiple detach/attach operations of
386 * SkGlyphCache.
387 */
Herb Derby660c2ff2019-11-14 18:22:41 -0500388 VertexRegenerator(GrResourceProvider*, GrTextBlob*,
389 GrTextBlob::SubRun* subRun,
Robert Phillips4bc70112018-03-01 10:24:02 -0500390 const SkMatrix& viewMatrix, SkScalar x, SkScalar y, GrColor color,
Herb Derbycb443a52019-11-11 18:01:36 -0500391 GrDeferredUploadTarget*, GrStrikeCache*, GrAtlasManager*);
Brian Salomon18923f92017-11-06 16:26:02 -0500392
393 struct Result {
394 /**
395 * Was regenerate() able to draw all the glyphs from the sub run? If not flush all glyph
396 * draws and call regenerate() again.
397 */
398 bool fFinished = true;
399
400 /**
401 * How many glyphs were regenerated. Will be equal to the sub run's glyph count if
402 * fType is kFinished.
403 */
404 int fGlyphsRegenerated = 0;
405
406 /**
407 * Pointer where the caller finds the first regenerated vertex.
408 */
409 const char* fFirstVertex;
410 };
411
Robert Phillipsd2e9f762018-03-07 11:54:37 -0500412 bool regenerate(Result*);
Brian Salomon18923f92017-11-06 16:26:02 -0500413
414private:
Brian Osman5d6be8f2019-01-08 12:02:51 -0500415 bool doRegen(Result*, bool regenPos, bool regenCol, bool regenTexCoords, bool regenGlyphs);
Brian Salomon18923f92017-11-06 16:26:02 -0500416
Robert Phillips4bc70112018-03-01 10:24:02 -0500417 GrResourceProvider* fResourceProvider;
Brian Salomon18923f92017-11-06 16:26:02 -0500418 const SkMatrix& fViewMatrix;
Herb Derby86240592018-05-24 16:12:31 -0400419 GrTextBlob* fBlob;
Brian Salomon18923f92017-11-06 16:26:02 -0500420 GrDeferredUploadTarget* fUploadTarget;
Herb Derby3a4f2272019-11-13 15:09:32 -0500421 GrStrikeCache* fGrStrikeCache;
Robert Phillipsc4039ea2018-03-01 11:36:45 -0500422 GrAtlasManager* fFullAtlasManager;
Herb Derbycb443a52019-11-11 18:01:36 -0500423 SkTLazy<SkBulkGlyphMetricsAndImages> fMetricsAndImages;
Herb Derby69ff8952018-11-12 11:39:12 -0500424 SubRun* fSubRun;
Brian Salomon18923f92017-11-06 16:26:02 -0500425 GrColor fColor;
426 SkScalar fTransX;
427 SkScalar fTransY;
428
429 uint32_t fRegenFlags = 0;
430 int fCurrGlyph = 0;
431 bool fBrokenRun = false;
432};
433
Herb Derby86240592018-05-24 16:12:31 -0400434#endif // GrTextBlob_DEFINED