1cb93a386Sopenharmony_ci/*
2cb93a386Sopenharmony_ci * Copyright 2015 Google Inc.
3cb93a386Sopenharmony_ci *
4cb93a386Sopenharmony_ci * Use of this source code is governed by a BSD-style license that can be
5cb93a386Sopenharmony_ci * found in the LICENSE file.
6cb93a386Sopenharmony_ci */
7cb93a386Sopenharmony_ci
8cb93a386Sopenharmony_ci#ifndef GrTextBlob_DEFINED
9cb93a386Sopenharmony_ci#define GrTextBlob_DEFINED
10cb93a386Sopenharmony_ci
11cb93a386Sopenharmony_ci#include <algorithm>
12cb93a386Sopenharmony_ci#include <limits>
13cb93a386Sopenharmony_ci
14cb93a386Sopenharmony_ci#include "include/core/SkPoint3.h"
15cb93a386Sopenharmony_ci#include "include/core/SkRefCnt.h"
16cb93a386Sopenharmony_ci#include "src/core/SkGlyphRunPainter.h"
17cb93a386Sopenharmony_ci#include "src/core/SkIPoint16.h"
18cb93a386Sopenharmony_ci#include "src/core/SkMaskFilterBase.h"
19cb93a386Sopenharmony_ci#include "src/core/SkOpts.h"
20cb93a386Sopenharmony_ci#include "src/core/SkRectPriv.h"
21cb93a386Sopenharmony_ci#include "src/core/SkStrikeSpec.h"
22cb93a386Sopenharmony_ci#include "src/core/SkTInternalLList.h"
23cb93a386Sopenharmony_ci#include "src/core/SkTLazy.h"
24cb93a386Sopenharmony_ci#include "src/gpu/GrColor.h"
25cb93a386Sopenharmony_ci#include "src/gpu/GrSubRunAllocator.h"
26cb93a386Sopenharmony_ci#include "src/gpu/ops/GrOp.h"
27cb93a386Sopenharmony_ci
28cb93a386Sopenharmony_ciclass GrAtlasManager;
29cb93a386Sopenharmony_ciclass GrDeferredUploadTarget;
30cb93a386Sopenharmony_ciclass GrGlyph;
31cb93a386Sopenharmony_ciclass GrMeshDrawTarget;
32cb93a386Sopenharmony_ciclass GrStrikeCache;
33cb93a386Sopenharmony_ciclass GrSubRun;
34cb93a386Sopenharmony_ci
35cb93a386Sopenharmony_ciclass SkMatrixProvider;
36cb93a386Sopenharmony_ciclass SkSurfaceProps;
37cb93a386Sopenharmony_ciclass SkTextBlob;
38cb93a386Sopenharmony_ciclass SkTextBlobRunIterator;
39cb93a386Sopenharmony_ci
40cb93a386Sopenharmony_cinamespace skgpu { namespace v1 { class SurfaceDrawContext; }}
41cb93a386Sopenharmony_ci
42cb93a386Sopenharmony_ci// -- SubRun Discussion ----------------------------------------------------------------------------
43cb93a386Sopenharmony_ci// There are two distinct types of SubRun, those that the GrTextBlob hold in the GrTextBlobCache,
44cb93a386Sopenharmony_ci// and those that are not cached at all. The type of SubRun that is not cached has NoCache
45cb93a386Sopenharmony_ci// appended to their name such as DirectMaskSubRunNoCache. The type of SubRun that is cached
46cb93a386Sopenharmony_ci// provides two interfaces the GrSubRun interface which used by the text blob caching system, and
47cb93a386Sopenharmony_ci// the GrAtlasSubRun which allows drawing by the AtlasTextOp system. The *NoCache SubRuns only
48cb93a386Sopenharmony_ci// provide the GrAtlasSubRun interface.
49cb93a386Sopenharmony_ci
50cb93a386Sopenharmony_ci// -- GrAtlasSubRun --------------------------------------------------------------------------------
51cb93a386Sopenharmony_ci// GrAtlasSubRun is the API that AtlasTextOp uses to generate vertex data for drawing.
52cb93a386Sopenharmony_ci//     There are three different ways GrAtlasSubRun is specialized.
53cb93a386Sopenharmony_ci//      * DirectMaskSubRun - this is by far the most common type of SubRun. The mask pixels are
54cb93a386Sopenharmony_ci//        in 1:1 correspondence with the pixels on the device. The destination rectangles in this
55cb93a386Sopenharmony_ci//        SubRun are in device space. This SubRun handles color glyphs.
56cb93a386Sopenharmony_ci//      * TransformedMaskSubRun - handles glyph where the image in the atlas needs to be
57cb93a386Sopenharmony_ci//        transformed to the screen. It is usually used for large color glyph which can't be
58cb93a386Sopenharmony_ci//        drawn with paths or scaled distance fields, but will be used to draw bitmap glyphs to
59cb93a386Sopenharmony_ci//        the screen, if the matrix does not map 1:1 to the screen. The destination rectangles
60cb93a386Sopenharmony_ci//        are in source space.
61cb93a386Sopenharmony_ci//      * SDFTSubRun - scaled distance field text handles largish single color glyphs that still
62cb93a386Sopenharmony_ci//        can fit in the atlas; the sizes between direct SubRun, and path SubRun. The destination
63cb93a386Sopenharmony_ci//        rectangles are in source space.
64cb93a386Sopenharmony_ci
65cb93a386Sopenharmony_ciclass GrAtlasSubRun;
66cb93a386Sopenharmony_ciusing GrAtlasSubRunOwner = std::unique_ptr<GrAtlasSubRun, GrSubRunAllocator::Destroyer>;
67cb93a386Sopenharmony_ciclass GrAtlasSubRun  {
68cb93a386Sopenharmony_cipublic:
69cb93a386Sopenharmony_ci    inline static constexpr int kVerticesPerGlyph = 4;
70cb93a386Sopenharmony_ci
71cb93a386Sopenharmony_ci    virtual ~GrAtlasSubRun() = default;
72cb93a386Sopenharmony_ci
73cb93a386Sopenharmony_ci    virtual size_t vertexStride(const SkMatrix& drawMatrix) const = 0;
74cb93a386Sopenharmony_ci    virtual int glyphCount() const = 0;
75cb93a386Sopenharmony_ci
76cb93a386Sopenharmony_ci    virtual std::tuple<const GrClip*, GrOp::Owner>
77cb93a386Sopenharmony_ci    makeAtlasTextOp(
78cb93a386Sopenharmony_ci            const GrClip*,
79cb93a386Sopenharmony_ci            const SkMatrixProvider& viewMatrix,
80cb93a386Sopenharmony_ci            SkPoint drawOrigin,
81cb93a386Sopenharmony_ci            const SkPaint&,
82cb93a386Sopenharmony_ci            skgpu::v1::SurfaceDrawContext*,
83cb93a386Sopenharmony_ci            GrAtlasSubRunOwner subRun) const = 0;
84cb93a386Sopenharmony_ci
85cb93a386Sopenharmony_ci    virtual void fillVertexData(
86cb93a386Sopenharmony_ci            void* vertexDst, int offset, int count,
87cb93a386Sopenharmony_ci            GrColor color, const SkMatrix& positionMatrix,
88cb93a386Sopenharmony_ci            SkIRect clip) const = 0;
89cb93a386Sopenharmony_ci
90cb93a386Sopenharmony_ci    virtual void testingOnly_packedGlyphIDToGrGlyph(GrStrikeCache* cache) = 0;
91cb93a386Sopenharmony_ci
92cb93a386Sopenharmony_ci    // This call is not thread safe. It should only be called from GrDrawOp::onPrepare which
93cb93a386Sopenharmony_ci    // is single threaded.
94cb93a386Sopenharmony_ci    virtual std::tuple<bool, int> regenerateAtlas(
95cb93a386Sopenharmony_ci            int begin, int end, GrMeshDrawTarget* target) const = 0;
96cb93a386Sopenharmony_ci};
97cb93a386Sopenharmony_ci
98cb93a386Sopenharmony_ci// -- GrSubRun -------------------------------------------------------------------------------------
99cb93a386Sopenharmony_ci// GrSubRun provides an interface used by GrTextBlob to manage the caching system.
100cb93a386Sopenharmony_ci// There are several types of SubRun, which can be broken into five classes:
101cb93a386Sopenharmony_ci//   * PathSubRun - handle very large single color glyphs using paths to render the glyph.
102cb93a386Sopenharmony_ci//   * DirectMaskSubRun - handle the majority of the glyphs where the cache entry's pixels are in
103cb93a386Sopenharmony_ci//     1:1 correspondence to the device pixels.
104cb93a386Sopenharmony_ci//   * TransformedMaskSubRun - handle large bitmap/argb glyphs that need to be scaled to the screen.
105cb93a386Sopenharmony_ci//   * SDFTSubRun - use signed distance fields to draw largish glyphs to the screen.
106cb93a386Sopenharmony_ciclass GrSubRun;
107cb93a386Sopenharmony_ciusing GrSubRunOwner = std::unique_ptr<GrSubRun, GrSubRunAllocator::Destroyer>;
108cb93a386Sopenharmony_ciclass GrSubRun {
109cb93a386Sopenharmony_cipublic:
110cb93a386Sopenharmony_ci    virtual ~GrSubRun() = default;
111cb93a386Sopenharmony_ci
112cb93a386Sopenharmony_ci    // Produce GPU ops for this subRun.
113cb93a386Sopenharmony_ci    virtual void draw(const GrClip*,
114cb93a386Sopenharmony_ci                      const SkMatrixProvider& viewMatrix,
115cb93a386Sopenharmony_ci                      const SkGlyphRunList&,
116cb93a386Sopenharmony_ci                      const SkPaint&,
117cb93a386Sopenharmony_ci                      skgpu::v1::SurfaceDrawContext*) const = 0;
118cb93a386Sopenharmony_ci
119cb93a386Sopenharmony_ci    // Given an already cached subRun, can this subRun handle this combination paint, matrix, and
120cb93a386Sopenharmony_ci    // position.
121cb93a386Sopenharmony_ci    virtual bool canReuse(const SkPaint& paint, const SkMatrix& drawMatrix) const = 0;
122cb93a386Sopenharmony_ci
123cb93a386Sopenharmony_ci    // Return the underlying atlas SubRun if it exists. Otherwise, return nullptr.
124cb93a386Sopenharmony_ci    // * Don't use this API. It is only to support testing.
125cb93a386Sopenharmony_ci    virtual GrAtlasSubRun* testingOnly_atlasSubRun() = 0;
126cb93a386Sopenharmony_ci
127cb93a386Sopenharmony_ci    GrSubRunOwner fNext;
128cb93a386Sopenharmony_ci};
129cb93a386Sopenharmony_ci
130cb93a386Sopenharmony_cistruct GrSubRunList {
131cb93a386Sopenharmony_ci    class Iterator {
132cb93a386Sopenharmony_ci    public:
133cb93a386Sopenharmony_ci        using value_type = GrSubRun;
134cb93a386Sopenharmony_ci        using difference_type = ptrdiff_t;
135cb93a386Sopenharmony_ci        using pointer = value_type*;
136cb93a386Sopenharmony_ci        using reference = value_type&;
137cb93a386Sopenharmony_ci        using iterator_category = std::input_iterator_tag;
138cb93a386Sopenharmony_ci        Iterator(GrSubRun* subRun) : fPtr{subRun} { }
139cb93a386Sopenharmony_ci        Iterator& operator++() { fPtr = fPtr->fNext.get(); return *this; }
140cb93a386Sopenharmony_ci        Iterator operator++(int) { Iterator tmp(*this); operator++(); return tmp; }
141cb93a386Sopenharmony_ci        bool operator==(const Iterator& rhs) const { return fPtr == rhs.fPtr; }
142cb93a386Sopenharmony_ci        bool operator!=(const Iterator& rhs) const { return fPtr != rhs.fPtr; }
143cb93a386Sopenharmony_ci        reference operator*() { return *fPtr; }
144cb93a386Sopenharmony_ci
145cb93a386Sopenharmony_ci    private:
146cb93a386Sopenharmony_ci        GrSubRun* fPtr;
147cb93a386Sopenharmony_ci    };
148cb93a386Sopenharmony_ci
149cb93a386Sopenharmony_ci    void append(GrSubRunOwner subRun) {
150cb93a386Sopenharmony_ci        GrSubRunOwner* newTail = &subRun->fNext;
151cb93a386Sopenharmony_ci        *fTail = std::move(subRun);
152cb93a386Sopenharmony_ci        fTail = newTail;
153cb93a386Sopenharmony_ci    }
154cb93a386Sopenharmony_ci    bool isEmpty() const { return fHead == nullptr; }
155cb93a386Sopenharmony_ci    Iterator begin() { return Iterator{ fHead.get()}; }
156cb93a386Sopenharmony_ci    Iterator end() { return Iterator{nullptr}; }
157cb93a386Sopenharmony_ci    Iterator begin() const { return Iterator{ fHead.get()}; }
158cb93a386Sopenharmony_ci    Iterator end() const { return Iterator{nullptr}; }
159cb93a386Sopenharmony_ci    GrSubRun& front() const {return *fHead; }
160cb93a386Sopenharmony_ci
161cb93a386Sopenharmony_ci    GrSubRunOwner fHead{nullptr};
162cb93a386Sopenharmony_ci    GrSubRunOwner* fTail{&fHead};
163cb93a386Sopenharmony_ci};
164cb93a386Sopenharmony_ci
165cb93a386Sopenharmony_ci// A GrTextBlob contains a fully processed SkTextBlob, suitable for nearly immediate drawing
166cb93a386Sopenharmony_ci// on the GPU.  These are initially created with valid positions and colors, but with invalid
167cb93a386Sopenharmony_ci// texture coordinates.
168cb93a386Sopenharmony_ci//
169cb93a386Sopenharmony_ci// A GrTextBlob contains a number of SubRuns that are created in the blob's arena. Each SubRun
170cb93a386Sopenharmony_ci// tracks its own GrGlyph* and vertex data. The memory is organized in the arena in the following
171cb93a386Sopenharmony_ci// way so that the pointers for the GrGlyph* and vertex data are known before creating the SubRun.
172cb93a386Sopenharmony_ci//
173cb93a386Sopenharmony_ci//  GrGlyph*... | vertexData... | SubRun | GrGlyph*... | vertexData... | SubRun  etc.
174cb93a386Sopenharmony_ci//
175cb93a386Sopenharmony_ci// In these classes, I'm trying to follow the convention about matrices and origins.
176cb93a386Sopenharmony_ci// * drawMatrix and drawOrigin    - describes transformations for the current draw command.
177cb93a386Sopenharmony_ci// * initial Matrix - describes the combined initial matrix and origin the GrTextBlob was created
178cb93a386Sopenharmony_ci//                    with.
179cb93a386Sopenharmony_ci//
180cb93a386Sopenharmony_ci//
181cb93a386Sopenharmony_ciclass GrTextBlob final : public SkRefCnt, public SkGlyphRunPainterInterface {
182cb93a386Sopenharmony_cipublic:
183cb93a386Sopenharmony_ci
184cb93a386Sopenharmony_ci    // Key is not used as part of a hash map, so the hash is never taken. It's only used in a
185cb93a386Sopenharmony_ci    // list search using operator =().
186cb93a386Sopenharmony_ci    struct Key {
187cb93a386Sopenharmony_ci        static std::tuple<bool, Key> Make(const SkGlyphRunList& glyphRunList,
188cb93a386Sopenharmony_ci                                          const SkPaint& paint,
189cb93a386Sopenharmony_ci                                          const SkSurfaceProps& surfaceProps,
190cb93a386Sopenharmony_ci                                          const GrColorInfo& colorInfo,
191cb93a386Sopenharmony_ci                                          const SkMatrix& drawMatrix,
192cb93a386Sopenharmony_ci                                          const GrSDFTControl& control);
193cb93a386Sopenharmony_ci        uint32_t fUniqueID;
194cb93a386Sopenharmony_ci        // Color may affect the gamma of the mask we generate, but in a fairly limited way.
195cb93a386Sopenharmony_ci        // Each color is assigned to on of a fixed number of buckets based on its
196cb93a386Sopenharmony_ci        // luminance. For each luminance bucket there is a "canonical color" that
197cb93a386Sopenharmony_ci        // represents the bucket.  This functionality is currently only supported for A8
198cb93a386Sopenharmony_ci        SkColor fCanonicalColor;
199cb93a386Sopenharmony_ci        SkScalar fFrameWidth;
200cb93a386Sopenharmony_ci        SkScalar fMiterLimit;
201cb93a386Sopenharmony_ci        SkPixelGeometry fPixelGeometry;
202cb93a386Sopenharmony_ci        SkMaskFilterBase::BlurRec fBlurRec;
203cb93a386Sopenharmony_ci        uint32_t fScalerContextFlags;
204cb93a386Sopenharmony_ci        SkMatrix fDrawMatrix;
205cb93a386Sopenharmony_ci        // Below here fields are of size 1 byte.
206cb93a386Sopenharmony_ci        uint8_t fSetOfDrawingTypes;
207cb93a386Sopenharmony_ci        bool fHasBlur;
208cb93a386Sopenharmony_ci        SkPaint::Style fStyle;
209cb93a386Sopenharmony_ci        SkPaint::Join fJoin;
210cb93a386Sopenharmony_ci
211cb93a386Sopenharmony_ci        bool operator==(const Key& other) const;
212cb93a386Sopenharmony_ci    };
213cb93a386Sopenharmony_ci
214cb93a386Sopenharmony_ci    SK_DECLARE_INTERNAL_LLIST_INTERFACE(GrTextBlob);
215cb93a386Sopenharmony_ci
216cb93a386Sopenharmony_ci    // Make a GrTextBlob and its sub runs.
217cb93a386Sopenharmony_ci    static sk_sp<GrTextBlob> Make(const SkGlyphRunList& glyphRunList,
218cb93a386Sopenharmony_ci                                  const SkPaint& paint,
219cb93a386Sopenharmony_ci                                  const SkMatrix& drawMatrix,
220cb93a386Sopenharmony_ci                                  const GrSDFTControl& control,
221cb93a386Sopenharmony_ci                                  SkGlyphRunListPainter* painter);
222cb93a386Sopenharmony_ci
223cb93a386Sopenharmony_ci    ~GrTextBlob() override;
224cb93a386Sopenharmony_ci
225cb93a386Sopenharmony_ci    // Change memory management to handle the data after GrTextBlob, but in the same allocation
226cb93a386Sopenharmony_ci    // of memory. Only allow placement new.
227cb93a386Sopenharmony_ci    void operator delete(void* p);
228cb93a386Sopenharmony_ci    void* operator new(size_t);
229cb93a386Sopenharmony_ci    void* operator new(size_t, void* p);
230cb93a386Sopenharmony_ci
231cb93a386Sopenharmony_ci    const Key& key() { return fKey; }
232cb93a386Sopenharmony_ci
233cb93a386Sopenharmony_ci    void addKey(const Key& key);
234cb93a386Sopenharmony_ci    bool hasPerspective() const;
235cb93a386Sopenharmony_ci    const SkMatrix& initialMatrix() const { return fInitialMatrix; }
236cb93a386Sopenharmony_ci
237cb93a386Sopenharmony_ci    std::tuple<SkScalar, SkScalar> scaleBounds() const { return {fMaxMinScale, fMinMaxScale}; }
238cb93a386Sopenharmony_ci    bool canReuse(const SkPaint& paint, const SkMatrix& drawMatrix) const;
239cb93a386Sopenharmony_ci
240cb93a386Sopenharmony_ci    const Key& key() const;
241cb93a386Sopenharmony_ci    size_t size() const;
242cb93a386Sopenharmony_ci
243cb93a386Sopenharmony_ci    const GrSubRunList& subRunList() const { return fSubRunList; }
244cb93a386Sopenharmony_ci
245cb93a386Sopenharmony_ciprivate:
246cb93a386Sopenharmony_ci    GrTextBlob(int allocSize, const SkMatrix& drawMatrix, SkColor initialLuminance);
247cb93a386Sopenharmony_ci
248cb93a386Sopenharmony_ci    template<typename AddSingleMaskFormat>
249cb93a386Sopenharmony_ci    void addMultiMaskFormat(
250cb93a386Sopenharmony_ci            AddSingleMaskFormat addSingle,
251cb93a386Sopenharmony_ci            const SkZip<SkGlyphVariant, SkPoint>& drawables,
252cb93a386Sopenharmony_ci            sk_sp<SkStrike>&& strike,
253cb93a386Sopenharmony_ci            SkScalar strikeToSourceScale);
254cb93a386Sopenharmony_ci
255cb93a386Sopenharmony_ci    // Methods to satisfy SkGlyphRunPainterInterface
256cb93a386Sopenharmony_ci    void processDeviceMasks(const SkZip<SkGlyphVariant, SkPoint>& drawables,
257cb93a386Sopenharmony_ci                            sk_sp<SkStrike>&& strike) override;
258cb93a386Sopenharmony_ci    void processSourcePaths(const SkZip<SkGlyphVariant, SkPoint>& drawables,
259cb93a386Sopenharmony_ci                            const SkFont& runFont,
260cb93a386Sopenharmony_ci                            SkScalar strikeToSourceScale) override;
261cb93a386Sopenharmony_ci    void processSourceSDFT(const SkZip<SkGlyphVariant, SkPoint>& drawables,
262cb93a386Sopenharmony_ci                           sk_sp<SkStrike>&& strike,
263cb93a386Sopenharmony_ci                           SkScalar strikeToSourceScale,
264cb93a386Sopenharmony_ci                           const SkFont& runFont,
265cb93a386Sopenharmony_ci                           SkScalar minScale,
266cb93a386Sopenharmony_ci                           SkScalar maxScale) override;
267cb93a386Sopenharmony_ci    void processSourceMasks(const SkZip<SkGlyphVariant, SkPoint>& drawables,
268cb93a386Sopenharmony_ci                            sk_sp<SkStrike>&& strike,
269cb93a386Sopenharmony_ci                            SkScalar strikeToSourceScale) override;
270cb93a386Sopenharmony_ci
271cb93a386Sopenharmony_ci    // The allocator must come first because it needs to be destroyed last. Other fields of this
272cb93a386Sopenharmony_ci    // structure may have pointers into it.
273cb93a386Sopenharmony_ci    GrSubRunAllocator fAlloc;
274cb93a386Sopenharmony_ci
275cb93a386Sopenharmony_ci    // Owner and list of the SubRun.
276cb93a386Sopenharmony_ci    GrSubRunList fSubRunList;
277cb93a386Sopenharmony_ci
278cb93a386Sopenharmony_ci    // Overall size of this struct plus vertices and glyphs at the end.
279cb93a386Sopenharmony_ci    const int fSize;
280cb93a386Sopenharmony_ci
281cb93a386Sopenharmony_ci    // The initial view matrix combined with the initial origin. Used to determine if a cached
282cb93a386Sopenharmony_ci    // subRun can be used in this draw situation.
283cb93a386Sopenharmony_ci    const SkMatrix fInitialMatrix;
284cb93a386Sopenharmony_ci
285cb93a386Sopenharmony_ci    const SkColor fInitialLuminance;
286cb93a386Sopenharmony_ci
287cb93a386Sopenharmony_ci    Key fKey;
288cb93a386Sopenharmony_ci
289cb93a386Sopenharmony_ci    // We can reuse distance field text, but only if the new view matrix would not result in
290cb93a386Sopenharmony_ci    // a mip change.  Because there can be multiple runs in a blob, we track the overall
291cb93a386Sopenharmony_ci    // maximum minimum scale, and minimum maximum scale, we can support before we need to regen
292cb93a386Sopenharmony_ci    SkScalar fMaxMinScale{-SK_ScalarMax};
293cb93a386Sopenharmony_ci    SkScalar fMinMaxScale{SK_ScalarMax};
294cb93a386Sopenharmony_ci
295cb93a386Sopenharmony_ci    bool fSomeGlyphsExcluded{false};
296cb93a386Sopenharmony_ci};
297cb93a386Sopenharmony_ci
298cb93a386Sopenharmony_ciclass GrSubRunNoCachePainter : public SkGlyphRunPainterInterface {
299cb93a386Sopenharmony_cipublic:
300cb93a386Sopenharmony_ci    GrSubRunNoCachePainter(skgpu::v1::SurfaceDrawContext*,
301cb93a386Sopenharmony_ci                           GrSubRunAllocator*,
302cb93a386Sopenharmony_ci                           const GrClip*,
303cb93a386Sopenharmony_ci                           const SkMatrixProvider& viewMatrix,
304cb93a386Sopenharmony_ci                           const SkGlyphRunList&,
305cb93a386Sopenharmony_ci                           const SkPaint&);
306cb93a386Sopenharmony_ci    void processDeviceMasks(const SkZip<SkGlyphVariant, SkPoint>& drawables,
307cb93a386Sopenharmony_ci                            sk_sp<SkStrike>&& strike) override;
308cb93a386Sopenharmony_ci    void processSourceMasks(const SkZip<SkGlyphVariant, SkPoint>& drawables,
309cb93a386Sopenharmony_ci                            sk_sp<SkStrike>&& strike,
310cb93a386Sopenharmony_ci                            SkScalar strikeToSourceScale) override;
311cb93a386Sopenharmony_ci    void processSourcePaths(const SkZip<SkGlyphVariant, SkPoint>& drawables,
312cb93a386Sopenharmony_ci                            const SkFont& runFont,
313cb93a386Sopenharmony_ci                            SkScalar strikeToSourceScale) override;
314cb93a386Sopenharmony_ci    void processSourceSDFT(const SkZip<SkGlyphVariant, SkPoint>& drawables,
315cb93a386Sopenharmony_ci                           sk_sp<SkStrike>&& strike,
316cb93a386Sopenharmony_ci                           SkScalar strikeToSourceScale,
317cb93a386Sopenharmony_ci                           const SkFont& runFont,
318cb93a386Sopenharmony_ci                           SkScalar minScale, SkScalar maxScale) override;
319cb93a386Sopenharmony_ci
320cb93a386Sopenharmony_ciprivate:
321cb93a386Sopenharmony_ci
322cb93a386Sopenharmony_ci    // Draw passes ownership of the sub run to the op.
323cb93a386Sopenharmony_ci    void draw(GrAtlasSubRunOwner subRun);
324cb93a386Sopenharmony_ci
325cb93a386Sopenharmony_ci    skgpu::v1::SurfaceDrawContext* const fSDC;
326cb93a386Sopenharmony_ci    GrSubRunAllocator* const fAlloc;
327cb93a386Sopenharmony_ci    const GrClip* const fClip;
328cb93a386Sopenharmony_ci    const SkMatrixProvider& fViewMatrix;
329cb93a386Sopenharmony_ci    const SkGlyphRunList& fGlyphRunList;
330cb93a386Sopenharmony_ci    const SkPaint& fPaint;
331cb93a386Sopenharmony_ci};
332cb93a386Sopenharmony_ci
333cb93a386Sopenharmony_ci#endif  // GrTextBlob_DEFINED
334