8#ifndef SkScalerContext_DEFINED
9#define SkScalerContext_DEFINED
83 const uint8_t fReservedAlign2{0};
85 const uint8_t fReservedAlign{0};
87 static constexpr SkScalar ExternalGammaFromInternal(uint8_t g) {
90 static constexpr uint8_t InternalGammaFromExternal(
SkScalar g) {
92 return static_cast<uint8_t
>(g * (1 << 6));
94 static constexpr SkScalar ExternalContrastFromInternal(uint8_t c) {
97 static constexpr uint8_t InternalContrastFromExternal(
SkScalar c) {
99 return static_cast<uint8_t
>((c * ((1 << 8) - 1)) + 0.5f);
106 fDeviceGamma = InternalGammaFromExternal(g);
113 fContrast = InternalContrastFromExternal(c);
142 uint8_t fStrokeJoin : 4;
143 uint8_t fStrokeCap : 4;
156 msg.
appendf(
" textsize %a prescale %a preskew %a post [%a %a %a %a]\n",
159 msg.
appendf(
" frame %g miter %g format %d join %d cap %d flags %#hx\n",
161 msg.
appendf(
" lum bits %x, device gamma %d, contrast %d\n", fLumBits,
162 fDeviceGamma, fContrast);
212 SkMatrix* remainingWithoutRotation =
nullptr,
213 SkMatrix* remainingRotation =
nullptr,
342 static std::unique_ptr<SkScalerContext>
MakeEmpty(
365 return { fPathEffect.
get(), fMaskFilter.
get() };
405 bool verticalLCD,
bool a8FromLCD,
bool hairline);
421 bool doBGR,
bool verticalLCD,
bool a8FromLCD,
bool hairline);
464 bool fGenerateImageFromPath;
475#define kRec_SkDescriptorTag SkSetFourByteTag('s', 'r', 'e', 'c')
476#define kEffects_SkDescriptorTag SkSetFourByteTag('e', 'f', 'c', 't')
constexpr SkColor SK_ColorTRANSPARENT
constexpr SkColor SK_ColorBLACK
#define SK_MAKE_BITFIELD_OPS(X)
#define SK_BEGIN_REQUIRE_DENSE
#define SK_END_REQUIRE_DENSE
SkTMaskGamma< 3, 3, 3 > SkMaskGamma
@ kFakeGammaAndBoostContrast
void sk_ignore_unused_variable(const T &)
static constexpr bool SkToBool(const T &x)
static const SkMatrix & I()
void forceGenerateImageFromPath()
virtual void generateFontMetrics(SkFontMetrics *)=0
SkScalerContext(sk_sp< SkTypeface >, const SkScalerContextEffects &, const SkDescriptor *)
@ kEmbeddedBitmapText_Flag
@ kNeedsForegroundColor_Flag
@ kSubpixelPositioning_Flag
virtual void generateImage(const SkGlyph &glyph, void *imageBuffer)=0
static void GenerateImageFromPath(SkMaskBuilder &dst, const SkPath &path, const SkMaskGamma::PreBlend &maskPreBlend, bool doBGR, bool verticalLCD, bool a8FromLCD, bool hairline)
static void MakeRecAndEffects(const SkFont &font, const SkPaint &paint, const SkSurfaceProps &surfaceProps, SkScalerContextFlags scalerContextFlags, const SkMatrix &deviceMatrix, SkScalerContextRec *rec, SkScalerContextEffects *effects)
SkMask::Format getMaskFormat() const
static std::unique_ptr< SkDescriptor > DescriptorGivenRecAndEffects(const SkScalerContextRec &rec, const SkScalerContextEffects &effects)
virtual GlyphMetrics generateMetrics(const SkGlyph &, SkArenaAlloc *)=0
virtual bool generatePath(const SkGlyph &, SkPath *)=0
void getPath(SkGlyph &, SkArenaAlloc *)
const SkMaskGamma::PreBlend fPreBlend
static SkMaskGamma::PreBlend GetMaskPreBlend(const SkScalerContextRec &rec)
SkTypeface * getTypeface() const
static SkDescriptor * CreateDescriptorAndEffectsUsingPaint(const SkFont &, const SkPaint &, const SkSurfaceProps &, SkScalerContextFlags scalerContextFlags, const SkMatrix &deviceMatrix, SkAutoDescriptor *ad, SkScalerContextEffects *effects)
virtual sk_sp< SkDrawable > generateDrawable(const SkGlyph &)
static SkDescriptor * AutoDescriptorGivenRecAndEffects(const SkScalerContextRec &rec, const SkScalerContextEffects &effects, SkAutoDescriptor *ad)
static void MakeRecAndEffectsFromFont(const SkFont &font, SkScalerContextRec *rec, SkScalerContextEffects *effects)
const SkScalerContextRec & getRec() const
static void GenerateMetricsFromPath(SkGlyph *glyph, const SkPath &path, SkMask::Format format, bool verticalLCD, bool a8FromLCD, bool hairline)
static bool CheckBufferSizeForRec(const SkScalerContextRec &rec, const SkScalerContextEffects &effects, size_t size)
SkScalerContextEffects getEffects() const
static size_t GetGammaLUTSize(SkScalar contrast, SkScalar deviceGamma, int *width, int *height)
SkAxisAlignment computeAxisAlignmentForHText() const
sk_sp< SkDrawable > getDrawable(SkGlyph &)
static std::unique_ptr< SkScalerContext > MakeEmpty(sk_sp< SkTypeface > typeface, const SkScalerContextEffects &effects, const SkDescriptor *desc)
SkGlyph makeGlyph(SkPackedGlyphID, SkArenaAlloc *)
static void DescriptorBufferGiveRec(const SkScalerContextRec &rec, void *buffer)
virtual ~SkScalerContext()
bool isLinearMetrics() const
void forceOffGenerateImageFromPath()
void getFontMetrics(SkFontMetrics *)
static bool GetGammaLUTData(SkScalar contrast, SkScalar deviceGamma, uint8_t *data)
void getImage(const SkGlyph &)
static void SaturateGlyphBounds(SkGlyph *glyph, SkRect &&)
void void void appendf(const char format[],...) SK_PRINTF_LIKE(2
static constexpr SkScalar kMaxContrastInclusive
static constexpr SkScalar kMaxGammaExclusive
static constexpr SkScalar kMinGammaInclusive
static constexpr SkScalar kMinContrastInclusive
uint32_t uint32_t * format
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
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
font
Font Metadata and Metrics.
SkPathEffect * fPathEffect
SkScalerContextEffects(const SkPaint &paint)
SkScalerContextEffects(SkPathEffect *pe, SkMaskFilter *mf)
SkMaskFilter * fMaskFilter
void getSingleMatrix(SkMatrix *) const
uint32_t fForegroundColor
void getLocalMatrix(SkMatrix *) const
void setDeviceGamma(SkScalar g)
static const SkMaskGamma & CachedMaskGamma(uint8_t contrast, uint8_t gamma)
SkAxisAlignment computeAxisAlignmentForHText() const
SkMask::Format fMaskFormat
void setContrast(SkScalar c)
SkMask::Format getFormat() const
void getMatrixFrom2x2(SkMatrix *) const
bool computeMatrices(PreMatrixScale preMatrixScale, SkVector *scale, SkMatrix *remaining, SkMatrix *remainingWithoutRotation=nullptr, SkMatrix *remainingRotation=nullptr, SkMatrix *total=nullptr)
const SkMaskGamma & cachedMaskGamma() const
SkColor getLuminanceColor() const
SkFontHinting getHinting() const
void setHinting(SkFontHinting)
void setLuminanceColor(SkColor c)
GlyphMetrics(SkMask::Format format)
SkMask::Format maskFormat
std::shared_ptr< const fml::Mapping > data