79 RunDef mergedSet5[] = {
91 RunDef mergedSet6[] = {
111 RunDef mergedSet7[] = {
183 const char*
txt =
"BOOO";
184 const size_t txtLen = strlen(
txt);
201 font.setScaleX(4.2f);
203 font.setSkewX(0.42f);
206 font.setEmbolden(
true);
207 font.setLinearMetrics(
true);
208 font.setSubpixel(
true);
209 font.setEmbeddedBitmaps(
true);
210 font.setForceAutoHinting(
true);
250 const RunDef in[],
unsigned inCount,
251 const RunDef
out[],
unsigned outCount) {
254 for (
unsigned i = 0;
i < inCount; ++
i) {
265 for (
unsigned i = 0;
i < outCount; ++
i) {
276 for (
unsigned k = 0; k < it.glyphCount(); ++k) {
320 SK_ABORT(
"unhandled positioning value");
337 const char text1[] =
"Foo";
338 const char text2[] =
"Bar";
345 memcpy(
run.glyphs,
glyphs.get(),
sizeof(uint16_t) * glyphCount);
346 memcpy(
run.utf8text, text2, strlen(text2));
347 for (
int i = 0;
i < glyphCount; ++
i) {
355 for (uint32_t
i = 0;
i < it.glyphCount(); ++
i) {
362 for (uint32_t
i = 0;
i < it.glyphCount(); ++
i) {
374 font.setSubpixel(
true);
376 font.setTypeface(tf);
395 return surf->makeImageSnapshot();
404 const size_t idx = array->
size();
412 if (
length !=
sizeof(
size_t)) {
420 std::memcpy(&idx,
data,
sizeof(
size_t));
425 return (*array)[idx];
452 "Did not serialize exactly one non-empty font, instead %d", array.
size());
468 const char text[] =
"Hello";
490 { tf.
get(), 5,
nullptr },
491 { tf.
get(), 6,
nullptr },
496 for (
auto exp : expected) {
500 for (
int i = 0;
i <
run.fGlyphCount; ++
i) {
502 "Glyph Index %d is unexpectedly 0",
i);
#define SkDEBUGFAIL(message)
#define SK_ABORT(message,...)
constexpr SkColor SK_ColorWHITE
@ kFull
modifies glyph outlines for maximum constrast
@ kUTF8
uses bytes to represent UTF-8 or ASCII
sk_sp< T > sk_ref_sp(T *obj)
#define SkScalarRoundToInt(x)
constexpr size_t SkToSizeT(S x)
constexpr int SkToInt(S x)
static constexpr bool SkToBool(const T &x)
constexpr uint32_t SkToU32(S x)
#define REPORTER_ASSERT(r, cond,...)
static sk_sp< SkTypeface > DeserializeTypeface(const void *data, size_t length, void *ctx)
DEF_TEST(TextBlob_builder, reporter)
static sk_sp< SkImage > render(const SkTextBlob *blob)
static sk_sp< SkData > SerializeTypeface(SkTypeface *tf, void *ctx)
static void add_run(SkTextBlobBuilder *builder, const char text[], SkScalar x, SkScalar y, sk_sp< SkTypeface > tf)
static sk_sp< SkData > MakeWithCopy(const void *data, size_t length)
static constexpr SkFontStyle BoldItalic()
static constexpr SkFontStyle Bold()
SkTypeface * getTypeface() const
SkFontHinting getHinting() const
bool isForceAutoHinting() const
bool isLinearMetrics() const
bool isEmbeddedBitmaps() const
SkScalar getScaleX() const
SkScalar getSkewX() const
@ kAntiAlias
may have transparent pixels on glyph edges
@ kSubpixelAntiAlias
glyph positioned in pixel using transparency
const RunBuffer & allocRunText(const SkFont &font, int count, SkScalar x, SkScalar y, int textByteCount, const SkRect *bounds=nullptr)
sk_sp< SkTextBlob > make()
@ kHorizontal_Positioning
const SkFont & font() const
const SkRect & bounds() const
static sk_sp< SkTextBlob > MakeFromPosText(const void *text, size_t byteLength, const SkPoint pos[], const SkFont &font, SkTextEncoding encoding=SkTextEncoding::kUTF8)
static sk_sp< SkTextBlob > Deserialize(const void *data, size_t size, const SkDeserialProcs &procs)
static sk_sp< SkTextBlob > MakeFromString(const char *string, const SkFont &font, SkTextEncoding encoding=SkTextEncoding::kUTF8)
size_t serialize(const SkSerialProcs &procs, void *memory, size_t memory_size) const
static void TestPaintProps(skiatest::Reporter *reporter)
static void TestBounds(skiatest::Reporter *reporter)
static void TestBuilder(skiatest::Reporter *reporter)
static float min(float r, float g, float b)
Optional< SkRect > bounds
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
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.
SkDeserialTypefaceProc fTypefaceProc
static SkImageInfo MakeN32Premul(int width, int height)
static constexpr SkPoint Make(float x, float y)
constexpr float left() const
constexpr float top() const
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
constexpr float height() const
constexpr float width() const
SkSerialTypefaceProc fTypefaceProc
SkScalar * pos
storage for glyph positions in run
SkGlyphID * glyphs
storage for glyph indexes in run
std::shared_ptr< const fml::Mapping > data