class AtlasSubRun;
using AtlasDrawDelegate = std::function<void(const sktext::gpu::AtlasSubRun* subRun,
SkPoint drawOrigin, const SkPaint& paint,
sk_sp<SkRefCnt> subRunStorage,
sktext::gpu::RendererData)>;
// -- SubRun ------------------------------------------------------------------------------------- // SubRun defines the most basic functionality of a SubRun; the ability to draw, and the // ability to be in a list. class SubRun;
using SubRunOwner = std::unique_ptr<SubRun, SubRunAllocator::Destroyer>; class SubRun {
public:
virtual ~SubRun();
// Size hint for unflattening this run. If this is accurate, it will help with the allocation // of the slug. If it's off then there may be more allocations needed to unflatten.
virtual int unflattenSize() const = 0;
// Given an already cached subRun, can this subRun handle this combination paint, matrix, and // position.
virtual bool canReuse(const SkPaint& paint, const SkMatrix& positionMatrix) const = 0;
// Return the underlying atlas SubRun if it exists. Otherwise, return nullptr. // * Don't use this API. It is only to support testing.
virtual const AtlasSubRun* testingOnly_atlasSubRun() const = 0;
// -- AtlasSubRun -------------------------------------------------------------------------------- // AtlasSubRun is the API that AtlasTextOp uses to generate vertex data for drawing. // There are three different ways AtlasSubRun is specialized. // * DirectMaskSubRun* - this is by far the most common type of SubRun. The mask pixels are // in 1:1 correspondence with the pixels on the device. The destination rectangles in this // SubRun are in device space. This SubRun handles color glyphs. // * TransformedMaskSubRun* - handles glyph where the image in the atlas needs to be // transformed to the screen. It is usually used for large color glyph which can't be // drawn with paths or scaled distance fields, but will be used to draw bitmap glyphs to // the screen, if the matrix does not map 1:1 to the screen. The destination rectangles // are in source space. // * SDFTSubRun* - scaled distance field text handles largish single color glyphs that still // can fit in the atlas; the sizes between direct SubRun, and path SubRun. The destination // rectangles are in source space. class AtlasSubRun : public SubRun {
public:
AtlasSubRun(VertexFiller&& vertexFiller, GlyphVector&& glyphVector)
: fVertexFiller{std::move(vertexFiller)}, fGlyphVector{std::move(glyphVector)} {}
// Delete the move operations because the SubRuns contain pointers to fInitialPositionMatrix.
SubRunContainer(SubRunContainer&&) = delete;
SubRunContainer& operator=(SubRunContainer&&) = delete;
enum SubRunCreationBehavior {kAddSubRuns, kStrikeCalculationsOnly}; // The returned SubRunContainerOwner will never be null. If subRunCreation == // kStrikeCalculationsOnly, then the returned container will be empty.
[[nodiscard]] static SubRunContainerOwner MakeInAlloc(const GlyphRunList& glyphRunList, const SkMatrix& positionMatrix, const SkPaint& runPaint,
SkStrikeDeviceInfo strikeDeviceInfo,
StrikeForGPUCacheInterface* strikeCache,
sktext::gpu::SubRunAllocator* alloc,
SubRunCreationBehavior creationBehavior, constchar* tag);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.