Flutter Engine
The Flutter Engine
Static Public Member Functions | List of all members
skgpu::ganesh::AtlasTextOpTools Class Referencefinal

#include <AtlasTextOpTools.h>

Static Public Member Functions

static GrOp::Owner CreateOp (SurfaceDrawContext *, const SkPaint &, const SkFont &, const SkMatrix &, const char *text, int x, int y)
 

Detailed Description

Definition at line 20 of file AtlasTextOpTools.h.

Member Function Documentation

◆ CreateOp()

GrOp::Owner skgpu::ganesh::AtlasTextOpTools::CreateOp ( SurfaceDrawContext sdc,
const SkPaint skPaint,
const SkFont font,
const SkMatrix ctm,
const char *  text,
int  x,
int  y 
)
static

Definition at line 28 of file AtlasTextOpTools.cpp.

34 {
35 size_t textLen = (int)strlen(text);
36
37 SkMatrix drawMatrix = ctm;
38 drawMatrix.preTranslate(x, y);
39 auto drawOrigin = SkPoint::Make(x, y);
41 auto glyphRunList = builder.textToGlyphRunList(font, skPaint, text, textLen, drawOrigin);
42 if (glyphRunList.empty()) {
43 return nullptr;
44 }
45
46 auto rContext = sdc->recordingContext();
48 rContext->priv().getSDFTControl(sdc->surfaceProps().isUseDeviceIndependentFonts());
49
50 SkStrikeDeviceInfo strikeDeviceInfo{
52
54 sktext::gpu::TextBlob::Make(glyphRunList,
55 skPaint,
56 drawMatrix,
57 strikeDeviceInfo,
59
61 if (!subRun) {
62 return nullptr;
63 }
64
65 GrOp::Owner op;
66 std::tie(std::ignore, op) =
67 subRun->makeAtlasTextOp(nullptr, ctm, glyphRunList.origin(), skPaint, blob, sdc);
68 return op;
69}
std::unique_ptr< GrOp > Owner
Definition: GrOp.h:72
SkMatrix & preTranslate(SkScalar dx, SkScalar dy)
Definition: SkMatrix.cpp:263
static SkStrikeCache * GlobalStrikeCache()
bool isUseDeviceIndependentFonts() const
T * get() const
Definition: SkRefCnt.h:303
GrRecordingContext * recordingContext() const
const SkSurfaceProps & surfaceProps() const
static const AtlasSubRun * FirstSubRun(const TextBlob *)
static sk_sp< TextBlob > Make(const sktext::GlyphRunList &glyphRunList, const SkPaint &paint, const SkMatrix &positionMatrix, SkStrikeDeviceInfo strikeDeviceInfo, StrikeForGPUCacheInterface *strikeCache)
Definition: TextBlob.cpp:194
std::u16string text
double y
double x
font
Font Metadata and Metrics.
static constexpr SkPoint Make(float x, float y)
Definition: SkPoint_impl.h:173

The documentation for this class was generated from the following files: