class SkDescriptor; class SkDrawable; class SkReadBuffer; class SkStrike; class SkStrikeCache; class SkStrikeClient; class SkStrikeSpec; class SkWriteBuffer;
namespace sktext { // -- SkStrikePromise ------------------------------------------------------------------------------ // SkStrikePromise produces an SkStrike when needed by GPU glyph rendering. In ordinary // operation, it just wraps an SkStrike. When used for remote glyph cache operation, the promise is // serialized to an SkDescriptor. When SkStrikePromise is deserialized, it uses the descriptor to // look up the SkStrike. // // When deserializing some care must be taken; if the needed SkStrike is removed from the cache, // then looking up using the descriptor will fail resulting in a deserialization failure. The // Renderer/GPU system solves this problem by pinning all the strikes needed into the cache. class SkStrikePromise { public:
SkStrikePromise() = delete;
SkStrikePromise(const SkStrikePromise&) = delete;
SkStrikePromise& operator=(const SkStrikePromise&) = delete;
SkStrikePromise(SkStrikePromise&&);
SkStrikePromise& operator=(SkStrikePromise&&);
// This only works when the GPU code is compiled in. static std::optional<SkStrikePromise> MakeFromBuffer(SkReadBuffer& buffer, const SkStrikeClient* client,
SkStrikeCache* strikeCache); void flatten(SkWriteBuffer& buffer) const;
// Do what is needed to return a strike.
SkStrike* strike();
// Reset the sk_sp<SkStrike> to nullptr. void resetStrike();
// Return a descriptor used to look up the SkStrike. const SkDescriptor& descriptor() const;
// -- StrikeForGPU --------------------------------------------------------------------------------- class StrikeForGPU : public SkRefCnt { public: virtualvoid lock() = 0; virtualvoid unlock() = 0;
// Generate a digest for a given packed glyph ID as drawn using the give action type. virtual SkGlyphDigest digestFor(skglyph::ActionType, SkPackedGlyphID) = 0;
// Prepare the glyph to draw an image, and return if the image exists. virtualbool prepareForImage(SkGlyph*) = 0;
// Prepare the glyph to draw a path, and return if the path exists. virtualbool prepareForPath(SkGlyph*) = 0;
// Prepare the glyph to draw a drawable, and return if the drawable exists. virtualbool prepareForDrawable(SkGlyph*) = 0;
// prepareForPathDrawing uses this union to convert glyph ids to paths. union IDOrPath {
IDOrPath() {}
IDOrPath(SkGlyphID glyphID) : fGlyphID{glyphID} {}
// PathOpSubmitter takes care of destroying the paths.
~IDOrPath() {}
SkGlyphID fGlyphID;
SkPath fPath;
};
// prepareForDrawableDrawing uses this union to convert glyph ids to drawables. union IDOrDrawable {
SkGlyphID fGlyphID;
SkDrawable* fDrawable;
};
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.