#include "src/core/SkStrike.h"
#include "include/core/SkDrawable.h"
#include "include/core/SkFontStyle.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPath.h"
#include "include/core/SkString.h"
#include "include/core/SkTraceMemoryDump.h"
#include "include/core/SkTypeface.h"
#include "include/private/base/SkDebug.h"
#include "include/private/base/SkTFitsIn.h"
#include "src/core/SkGlyph.h"
#include "src/core/SkMask.h"
#include "src/core/SkReadBuffer.h"
#include "src/core/SkScalerContext.h"
#include "src/core/SkStrikeCache.h"
#include "src/core/SkWriteBuffer.h"
#include "src/text/StrikeForGPU.h"
#include <cctype>
#include <new>
#include <optional>
#include <utility>
usingnamespaceskglyph;
static SkFontMetrics use_or_generate_metrics(
const SkFontMetrics* metrics, SkScalerContext* context) { … }
SkStrike::SkStrike(SkStrikeCache* strikeCache,
const SkStrikeSpec& strikeSpec,
std::unique_ptr<SkScalerContext> scaler,
const SkFontMetrics* metrics,
std::unique_ptr<SkStrikePinner> pinner)
: … { … }
class SK_SCOPED_CAPABILITY SkStrike::Monitor { … };
void SkStrike::lock() { … }
void SkStrike::unlock() { … }
void
SkStrike::FlattenGlyphsByType(SkWriteBuffer& buffer,
SkSpan<SkGlyph> images,
SkSpan<SkGlyph> paths,
SkSpan<SkGlyph> drawables) { … }
bool SkStrike::mergeFromBuffer(SkReadBuffer& buffer) { … }
SkGlyph* SkStrike::mergeGlyphAndImage(SkPackedGlyphID toID, const SkGlyph& fromGlyph) { … }
const SkPath* SkStrike::mergePath(SkGlyph* glyph, const SkPath* path, bool hairline) { … }
const SkDrawable* SkStrike::mergeDrawable(SkGlyph* glyph, sk_sp<SkDrawable> drawable) { … }
void SkStrike::findIntercepts(const SkScalar bounds[2], SkScalar scale, SkScalar xPos,
SkGlyph* glyph, SkScalar* array, int* count) { … }
SkSpan<const SkGlyph*> SkStrike::metrics(
SkSpan<const SkGlyphID> glyphIDs, const SkGlyph* results[]) { … }
SkSpan<const SkGlyph*> SkStrike::preparePaths(
SkSpan<const SkGlyphID> glyphIDs, const SkGlyph* results[]) { … }
SkSpan<const SkGlyph*> SkStrike::prepareImages(
SkSpan<const SkPackedGlyphID> glyphIDs, const SkGlyph* results[]) { … }
SkSpan<const SkGlyph*> SkStrike::prepareDrawables(
SkSpan<const SkGlyphID> glyphIDs, const SkGlyph* results[]) { … }
void SkStrike::glyphIDsToPaths(SkSpan<sktext::IDOrPath> idsOrPaths) { … }
void SkStrike::glyphIDsToDrawables(SkSpan<sktext::IDOrDrawable> idsOrDrawables) { … }
void SkStrike::dump() const { … }
void SkStrike::dumpMemoryStatistics(SkTraceMemoryDump* dump) const { … }
SkGlyph* SkStrike::glyph(SkGlyphDigest digest) { … }
SkGlyph* SkStrike::glyph(SkPackedGlyphID packedGlyphID) { … }
SkGlyphDigest SkStrike::digestFor(ActionType actionType, SkPackedGlyphID packedGlyphID) { … }
SkGlyphDigest* SkStrike::addGlyphAndDigest(SkGlyph* glyph) { … }
bool SkStrike::prepareForImage(SkGlyph* glyph) { … }
bool SkStrike::prepareForPath(SkGlyph* glyph) { … }
bool SkStrike::prepareForDrawable(SkGlyph* glyph) { … }
SkGlyph* SkStrike::mergeGlyphFromBuffer(SkReadBuffer& buffer) { … }
bool SkStrike::mergeGlyphAndImageFromBuffer(SkReadBuffer& buffer) { … }
bool SkStrike::mergeGlyphAndPathFromBuffer(SkReadBuffer& buffer) { … }
bool SkStrike::mergeGlyphAndDrawableFromBuffer(SkReadBuffer& buffer) { … }
SkSpan<const SkGlyph*> SkStrike::internalPrepare(
SkSpan<const SkGlyphID> glyphIDs, PathDetail pathDetail, const SkGlyph** results) { … }
void SkStrike::updateMemoryUsage(size_t increase) { … }