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;
182 fDigestForPackedGlyphID SK_GUARDED_BY(fStrikeLock);
185 std::vector<SkGlyph*> fGlyphForIndex SK_GUARDED_BY(fStrikeLock);
188 const std::unique_ptr<SkScalerContext> fScalerContext SK_GUARDED_BY(fStrikeLock);
191 size_t fMemoryIncrease SK_GUARDED_BY(fStrikeLock) {0};
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;
198 SkArenaAlloc fAlloc SK_GUARDED_BY(fStrikeLock) {kMinAllocAmount};
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)
SkStrike(SkStrikeCache *strikeCache, const SkStrikeSpec &strikeSpec, std::unique_ptr< SkScalerContext > scaler, const SkFontMetrics *metrics, std::unique_ptr< SkStrikePinner > pinner)
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)
Monitor(SkStrike *strike) SK_ACQUIRE(strike -> fStrikeLock) :fStrike
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)
std::array< MockImage, 3 > images
Optional< SkRect > bounds
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer