class SkCanvas; struct SkPoint; struct SkStrikeDeviceInfo;
namespace sktext { class GlyphRunList; class StrikeForGPUCacheInterface;
}
namespace sktext::gpu { class Slug;
// -- TextBlob ----------------------------------------------------------------------------------- // A TextBlob contains a fully processed SkTextBlob, suitable for nearly immediate drawing // on the GPU. These are initially created with valid positions and colors, but with invalid // texture coordinates. // // A TextBlob contains a number of SubRuns that are created in the blob's arena. Each SubRun // tracks its own glyph and position data. // // In these classes, I'm trying to follow the convention about matrices and origins. // * drawMatrix and drawOrigin - describes transformations for the current draw command. // * positionMatrix - is equal to drawMatrix * [drawOrigin-as-translation-matrix] // * initial Matrix - describes the combined initial matrix and origin the TextBlob was created // with. // // class TextBlob final : public SkRefCnt { public: // Key is not used as part of a hash map, so the hash is never taken. It's only used in a // list search using operator =(). struct Key { static std::tuple<bool, Key> Make(const GlyphRunList& glyphRunList, const SkPaint& paint, const SkMatrix& drawMatrix, const SkStrikeDeviceInfo& strikeDevice);
uint32_t fUniqueID; // Color may affect the gamma of the mask we generate, but in a fairly limited way. // Each color is assigned to on of a fixed number of buckets based on its // luminance. For each luminance bucket there is a "canonical color" that // represents the bucket. This functionality is currently only supported for A8
SkColor fCanonicalColor;
SkScalar fFrameWidth;
SkScalar fMiterLimit;
SkPixelGeometry fPixelGeometry;
SkMaskFilterBase::BlurRec fBlurRec;
uint32_t fScalerContextFlags;
SkMatrix fPositionMatrix; // Below here fields are of size 1 byte. bool fHasSomeDirectSubRuns; bool fHasBlur;
SkPaint::Style fStyle;
SkPaint::Join fJoin;
booloperator==(const Key& other) const;
};
SK_DECLARE_INTERNAL_LLIST_INTERFACE(TextBlob);
// Make a TextBlob and its sub runs. static sk_sp<TextBlob> Make(const sktext::GlyphRunList& glyphRunList, const SkPaint& paint, const SkMatrix& positionMatrix,
SkStrikeDeviceInfo strikeDeviceInfo,
StrikeForGPUCacheInterface* strikeCache);
TextBlob(SubRunAllocator&& alloc,
SubRunContainerOwner subRuns, int totalMemorySize,
SkColor initialLuminance);
~TextBlob() override;
// Change memory management to handle the data after TextBlob, but in the same allocation // of memory. Only allow placement new. voidoperatordelete(void* p); void* operatornew(size_t); void* operatornew(size_t, void* p);
private: friendclass TextBlobTools; // The allocator must come first because it needs to be destroyed last. Other fields of this // structure may have pointers into it.
SubRunAllocator fAlloc;
SubRunContainerOwner fSubRuns;
// Overall size of this struct plus vertices and glyphs at the end. constint fSize;
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.