MCPcopy Create free account
hub / github.com/Tencent/libpag / CreateFillPaint

Function CreateFillPaint

src/rendering/graphics/Text.cpp:28–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26
27namespace pag {
28static std::unique_ptr<tgfx::Paint> CreateFillPaint(const Glyph* glyph) {
29 if (glyph->getStyle() != TextStyle::Fill && glyph->getStyle() != TextStyle::StrokeAndFill) {
30 return nullptr;
31 }
32 auto fillPaint = new tgfx::Paint();
33 fillPaint->setStyle(tgfx::PaintStyle::Fill);
34 fillPaint->setColor(ToTGFX(glyph->getFillColor()));
35 fillPaint->setAlpha(glyph->getAlpha());
36 return std::unique_ptr<tgfx::Paint>(fillPaint);
37}
38
39static std::unique_ptr<tgfx::Paint> CreateStrokePaint(const Glyph* glyph) {
40 if (glyph->getStyle() != TextStyle::Stroke && glyph->getStyle() != TextStyle::StrokeAndFill) {

Callers 1

MakeTextRunFunction · 0.85

Calls 6

getStyleMethod · 0.80
setStyleMethod · 0.80
getFillColorMethod · 0.80
ToTGFXFunction · 0.50
setAlphaMethod · 0.45
getAlphaMethod · 0.45

Tested by

no test coverage detected