25static constexpr int kImgW = 100;
43 for (
int i = 1;
i <= 8; ++
i) {
57 auto* canvas = surf->getCanvas();
84 canvas->translate(1, 1);
85 canvas->drawString(
string,
x,
y,
font, blurPaint);
90 auto measure = [&
font](
const char*
text) {
102 bounds = measure(
"bottom");
107 SkScalar baseY = midY - measure(
"leftright").centerY();
109 drawLabel(
"left",
kPad -
bounds.left(), baseY);
111 bounds = measure(
"right");
116 drawLabel(num.
c_str(), midX -
bounds.centerX(), baseY);
119 surf->makeImageSnapshot()->peekPixels(&pm);
135 for (
char i =
'1';
i <=
'8';
i++) {
151#define MAKE_GM(subsample) DEF_SIMPLE_GM(orientation_##subsample, canvas, 4*kImgW, 2*kImgH) { \
152 draw(canvas, "_" #subsample); \
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kNormal_SkBlurStyle
fuzzy inside and outside
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
constexpr SkColor SK_ColorWHITE
@ kLeftTop_SkEncodedOrigin
static SkMatrix SkEncodedOriginToMatrix(SkEncodedOrigin origin, int w, int h)
@ kUTF8
uses bytes to represent UTF-8 or ASCII
void swap(sk_sp< T > &a, sk_sp< T > &b)
SK_API SkString SkStringPrintf(const char *format,...) SK_PRINTF_LIKE(1
Creates a new string and writes into it using a printf()-style format.
void translate(SkScalar dx, SkScalar dy)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
static sk_sp< SkMaskFilter > MakeBlur(SkBlurStyle style, SkScalar sigma, bool respectCTM=true)
void setColor(SkColor color)
void setMaskFilter(sk_sp< SkMaskFilter > maskFilter)
void append(const char text[])
const char * c_str() const
Optional< SkRect > bounds
sk_sp< const SkImage > image
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
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.
static void draw(SkCanvas *canvas, const char *suffix)
static constexpr int kImgH
static constexpr int kImgW
#define MAKE_GM(subsample)
static void make_images()
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)