7#ifndef SkStrike_DEFINED
8#define SkStrike_DEFINED
48 std::unique_ptr<SkScalerContext> scaler,
50 std::unique_ptr<SkStrikePinner> pinner);
108 return fRoundingSpec;
126 if (fPinner !=
nullptr) {
127 fPinner->assertValid();
154 void updateMemoryUsage(
size_t increase)
SK_EXCLUDES(fStrikeLock);
164 PathDetail pathDetail,
174 mutable SkMutex fStrikeLock;
185 std::vector<SkGlyph*> fGlyphForIndex
SK_GUARDED_BY(fStrikeLock);
188 const std::unique_ptr<SkScalerContext> fScalerContext
SK_GUARDED_BY(fStrikeLock);
194 inline static constexpr size_t kMinGlyphCount = 8;
195 inline static constexpr size_t kMinGlyphImageSize = 16 * 8 ;
196 inline static constexpr size_t kMinAllocAmount = kMinGlyphImageSize * kMinGlyphCount;
203 std::unique_ptr<SkStrikePinner> fPinner;
204 size_t fMemoryUsed{
sizeof(
SkStrike)};
205 bool fRemoved{
false};
#define SK_RELEASE_CAPABILITY(...)
virtual void assertValid()
virtual bool canDelete()=0
virtual ~SkStrikePinner()=default
const SkDescriptor & descriptor() const
static void FlattenGlyphsByType(SkWriteBuffer &buffer, SkSpan< SkGlyph > images, SkSpan< SkGlyph > paths, SkSpan< SkGlyph > drawables)
void dump() const SK_EXCLUDES(fStrikeLock)
const SkDrawable * mergeDrawable(SkGlyph *glyph, sk_sp< SkDrawable > drawable) SK_EXCLUDES(fStrikeLock)
const SkDescriptor & getDescriptor() const override
void glyphIDsToDrawables(SkSpan< sktext::IDOrDrawable > idsOrDrawables) SK_EXCLUDES(fStrikeLock)
void verifyPinnedStrike() const
void dumpMemoryStatistics(SkTraceMemoryDump *dump) const SK_EXCLUDES(fStrikeLock)
void unlock() override SK_RELEASE_CAPABILITY(fStrikeLock)
bool mergeFromBuffer(SkReadBuffer &buffer) SK_EXCLUDES(fStrikeLock)
sktext::SkStrikePromise strikePromise() override
SkSpan< const SkGlyph * > metrics(SkSpan< const SkGlyphID > glyphIDs, const SkGlyph *results[]) SK_EXCLUDES(fStrikeLock)
const SkPath * mergePath(SkGlyph *glyph, const SkPath *path, bool hairline) SK_EXCLUDES(fStrikeLock)
const SkFontMetrics & getFontMetrics() const
const SkStrikeSpec & strikeSpec() const
bool prepareForPath(SkGlyph *) override SK_REQUIRES(fStrikeLock)
void lock() override SK_ACQUIRE(fStrikeLock)
SkSpan< const SkGlyph * > preparePaths(SkSpan< const SkGlyphID > glyphIDs, const SkGlyph *results[]) SK_EXCLUDES(fStrikeLock)
void findIntercepts(const SkScalar bounds[2], SkScalar scale, SkScalar xPos, SkGlyph *, SkScalar *array, int *count) SK_EXCLUDES(fStrikeLock)
void glyphIDsToPaths(SkSpan< sktext::IDOrPath > idsOrPaths) SK_EXCLUDES(fStrikeLock)
SkGlyph * mergeGlyphAndImage(SkPackedGlyphID toID, const SkGlyph &fromGlyph) SK_EXCLUDES(fStrikeLock)
bool prepareForDrawable(SkGlyph *) override SK_REQUIRES(fStrikeLock)
SkGlyph * glyph(SkGlyphDigest) SK_REQUIRES(fStrikeLock)
SkSpan< const SkGlyph * > prepareDrawables(SkSpan< const SkGlyphID > glyphIDs, const SkGlyph *results[]) SK_EXCLUDES(fStrikeLock)
bool prepareForImage(SkGlyph *glyph) override SK_REQUIRES(fStrikeLock)
const SkGlyphPositionRoundingSpec & roundingSpec() const override
SkSpan< const SkGlyph * > prepareImages(SkSpan< const SkPackedGlyphID > glyphIDs, const SkGlyph *results[]) SK_EXCLUDES(fStrikeLock)
SkGlyphDigest digestFor(skglyph::ActionType, SkPackedGlyphID) override SK_REQUIRES(fStrikeLock)
static const uint8_t buffer[]