26#if !defined(SK_DISABLE_SDF_TEXT)
33#ifdef SK_BUILD_FOR_MAC
34static const int kExtraLargeDFFontLimit = 256;
38 if (!useSDFTForSmallText) {
45 bool ableToUseSDFT,
bool useSDFTForSmallText,
bool useSDFTForPerspectiveText,
47 : fMinDistanceFieldFontSize{MinSDFTRange(useSDFTForSmallText,
min)}
48 , fMaxDistanceFieldFontSize{
max}
49 , fAbleToUseSDFT{ableToUseSDFT}
50 , fAbleToUsePerspectiveSDFT{useSDFTForPerspectiveText} {
57#if !defined(SK_DISABLE_SDF_TEXT)
63 !
matrix.hasPerspective() &&
64 0 < approximateDeviceTextSize &&
68#if !defined(SK_DISABLE_SDF_TEXT)
72 paint.getStrokeWidth() > 0;
73 return fAbleToUseSDFT &&
74 paint.getMaskFilter() ==
nullptr &&
76 0 < approximateDeviceTextSize &&
77 (fAbleToUsePerspectiveSDFT || !
matrix.hasPerspective()) &&
78 (fMinDistanceFieldFontSize <= approximateDeviceTextSize ||
matrix.hasPerspective()) &&
79 approximateDeviceTextSize <= fMaxDistanceFieldFontSize;
82std::tuple<SkFont, SkScalar, SDFTMatrixRange>
88 scaledTextSize = textSize;
97 dfMaskScaleFloor = fMinDistanceFieldFontSize;
104#ifdef SK_BUILD_FOR_MAC
111 dfMaskScaleCeil = fMaxDistanceFieldFontSize;
112 dfMaskSize = kExtraLargeDFFontLimit;
117 dfMaskScaleCeil = fMaxDistanceFieldFontSize;
122 dfFont.setSize(dfMaskSize);
124 dfFont.setForceAutoHinting(
false);
128 dfFont.setSubpixel(
false);
130 SkScalar minMatrixScale = dfMaskScaleFloor / textSize,
131 maxMatrixScale = dfMaskScaleCeil / textSize;
132 return {dfFont, textSize / dfMaskSize, {minMatrixScale, maxMatrixScale}};
137 return fMatrixMin < maxScale && maxScale <= fMatrixMax;
141 buffer.writeScalar(fMatrixMin);
142 buffer.writeScalar(fMatrixMax);
#define SkASSERT_RELEASE(cond)
@ kNormal
glyph outlines modified to improve constrast
static bool SkScalarNearlyEqual(SkScalar x, SkScalar y, SkScalar tolerance=SK_ScalarNearlyZero)
static SkScalar ApproximateTransformedTextSize(const SkFont &font, const SkMatrix &matrix, const SkPoint &textLocation)
@ kAntiAlias
may have transparent pixels on glyph edges
static constexpr uint16_t kSkSideTooBigForAtlas
@ kStroke_Style
set to stroke geometry
@ kFill_Style
set to fill geometry
std::tuple< SkFont, SkScalar, SDFTMatrixRange > getSDFFont(const SkFont &font, const SkMatrix &viewMatrix, const SkPoint &textLocation) const
bool isSDFT(SkScalar approximateDeviceTextSize, const SkPaint &paint, const SkMatrix &matrix) const
SDFTControl(bool ableToUseSDFT, bool useSDFTForSmallText, bool useSDFTForPerspectiveText, SkScalar min, SkScalar max)
bool isDirect(SkScalar approximateDeviceTextSize, const SkPaint &paint, const SkMatrix &matrix) const
static float max(float r, float g, float b)
static float min(float r, float g, float b)
unsigned useCenter Optional< SkMatrix > matrix
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
font
Font Metadata and Metrics.
static const int kMediumDFFontLimit
static const int kSmallDFFontLimit
static const int kLargeDFFontLimit