44 constexpr char kSkiaStr[] =
"SKIA";
45 constexpr SkScalar kGradientPad = .1f;
46 constexpr SkScalar kVerticalSpacing = 0.25f;
47 constexpr SkScalar kAccentScale = 1.20f;
50 paint.setAntiAlias(
true);
53 font.setSubpixel(
true);
54 font.setEmbolden(
true);
57 SkRect iBox, skiBox, skiaBox;
64 const size_t textLen = strlen(kSkiaStr);
67 skiaBox.
outset(0, 2 * iBox.
width() * (kVerticalSpacing + 1));
76 iBox.
y() - (0.5f + kVerticalSpacing) * accentSize,
81 path.moveTo(iBox.
centerX() - accentSize / 2, iBox.
bottom() + kVerticalSpacing * accentSize);
82 path.rLineTo(accentSize, 0);
89 underlineY + accentSize / 10);
92 const SkScalar pos1[] = { 0, 0.75f };
101 const SkScalar pos2[] = { 0, .01f, 1.0f/3, 1.0f/3, 2.0f/3, 2.0f/3, .99f, 1 };
162 const unsigned kDrawsPerRow = 4;
176 std::unique_ptr<SkImageGenerator>
gen =
180 p.getAlpha() != 255 ? &
p :
nullptr,
190 const SkScalar x = kDrawSize * (
i % kDrawsPerRow);
191 const SkScalar y = kDrawSize * (
i / kDrawsPerRow);
193 p.setColor(0xfff0f0f0);
206 const SkScalar kPictureHeight = 100;
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
constexpr SkColor SK_ColorTRANSPARENT
constexpr SkColor SK_ColorBLACK
@ kUTF8
uses bytes to represent UTF-8 or ASCII
bool SK_API TightBounds(const SkPath &path, SkRect *result)
SkString getName() const override
void onOnceBeforeDraw() override
SkISize getISize() override
void onDraw(SkCanvas *canvas) override
void allocPixels(const SkImageInfo &info, size_t rowBytes)
sk_sp< SkImage > asImage() const
const SkImageInfo & info() const
void drawRect(const SkRect &rect, const SkPaint &paint)
void drawSimpleText(const void *text, size_t byteLength, SkTextEncoding encoding, SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
void drawPath(const SkPath &path, const SkPaint &paint)
void concat(const SkMatrix &matrix)
SkImageInfo imageInfo() const
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
static sk_sp< SkColorSpace > MakeSRGB()
static sk_sp< SkShader > MakeLinear(const SkPoint pts[2], const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
static SkMatrix Scale(SkScalar sx, SkScalar sy)
static SkMatrix RectToRect(const SkRect &src, const SkRect &dst, ScaleToFit mode=kFill_ScaleToFit)
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkPicture > finishRecordingAsPicture()
static void GetPath(const void *text, size_t length, SkTextEncoding, SkScalar x, SkScalar y, const SkFont &, SkPath *)
std::unique_ptr< SkImageGenerator > MakeFromPicture(const SkISize &, sk_sp< SkPicture >, const SkMatrix *, const SkPaint *, SkImages::BitDepth, sk_sp< SkColorSpace >, SkSurfaceProps props)
@ kU8
uses 8-bit unsigned int per color component
sk_sp< SkBlender > blender SkRect rect
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_vector_logo(SkCanvas *canvas, const SkRect &viewBox)
static constexpr SkISize Make(int32_t w, int32_t h)
sk_sp< SkColorSpace > refColorSpace() const
static constexpr SkPoint Make(float x, float y)
void offsetTo(float newX, float newY)
constexpr float x() const
void outset(float dx, float dy)
constexpr float y() const
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
SkScalar fRight
larger x-axis bounds
constexpr float centerX() const
constexpr float right() const
constexpr float width() const
static constexpr SkRect MakeWH(float w, float h)
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
constexpr float bottom() const
SkScalar fTop
smaller y-axis bounds