// -- 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: virtual ~AtlasSubRun() = default;
virtualvoid fillVertexData( void* vertexDst, int offset, int count,
GrColor color, const SkMatrix& drawMatrix,
SkPoint drawOrigin,
SkIRect clip) const = 0; #endif // This call is not thread safe. It should only be called from a known single-threaded env. virtual std::tuple<bool, int> regenerateAtlas( int begin, int end, RegenerateAtlasDelegate) const = 0;
// -- 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. virtualint unflattenSize() const = 0;
// Given an already cached subRun, can this subRun handle this combination paint, matrix, and // position. virtualbool 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. virtualconst AtlasSubRun* testingOnly_atlasSubRun() const = 0;
// 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.