45#include <initializer_list>
66 paint.setAntiAlias(
true);
68 return surface->makeImageSnapshot();
108 for (
int i = 0;
i <
N; ++
i) {
109 rec[
i].apply(&xform[
i]);
111 colors[
i] = 0x80FF0000 + (
i * 40 * 256);
115 paint.setAntiAlias(
true);
126 using INHERITED =
GM;
134 float baseline_offset) {
182 SkPoint pts[2] = {{0, 0}, {220, 0}};
188 const char text0[] =
"ABCDFGHJKLMNOPQRSTUVWXYZ";
189 const int N =
sizeof(text0) - 1;
197 paint.setAntiAlias(
true);
200 paint.setStrokeWidth(2.25f);
205 for (
int i = 0;
i <
N; ++
i) {
211 const float baseline_offset = -5;
216 for (
auto d : dirs) {
228 canvas->
scale(0.5f, 0.5f);
229 const bool doStroke[] = {
false,
true };
230 for (
auto st : doStroke) {
241 const char text[] =
"CrazyXform";
242 constexpr size_t len =
sizeof(
text) - 1;
247 for (
size_t i = 0;
i <
len; ++
i) {
257 paint.setColor(0xFFCCCCCC);
282 const char text[] =
"abcabcabc";
283 constexpr size_t len =
sizeof(
text) - 1;
288 for (
size_t i = 0;
i <
len; ++
i) {
298 paint.setColor(0xFFCCCCCC);
343 for (
float alpha : { 1.0f, 0.5f }) {
344 paint.setAlphaf(alpha);
347 paint.setColorFilter(cf);
353 paint.setShader(
nullptr);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
std::unique_ptr< SkStreamAsset > GetResourceAsStream(const char *resource, bool useFileStream)
@ kSrcOver
r = s + (1-sa)*d
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorBLACK
@ kUTF8
uses bytes to represent UTF-8 or ASCII
@ kGlyphID
uses two byte words to represent glyph indices
static bool apply(Pass *pass, SkRecord *record)
#define SkDegreesToRadians(degrees)
#define SkScalarSin(radians)
#define SkScalarCos(radians)
static constexpr SkFourByteTag SkSetFourByteTag(char a, char b, char c, char d)
SkISize getISize() override
void onDraw(SkCanvas *canvas) override
SkString getName() const override
void drawRect(const SkRect &rect, const SkPaint &paint)
void drawOval(const SkRect &oval, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
void clear(SkColor color)
void drawPath(const SkPath &path, const SkPaint &paint)
void drawAtlas(const SkImage *atlas, const SkRSXform xform[], const SkRect tex[], const SkColor colors[], int count, SkBlendMode mode, const SkSamplingOptions &sampling, const SkRect *cullRect, const SkPaint *paint)
void scale(SkScalar sx, SkScalar sy)
void drawVertices(const SkVertices *vertices, SkBlendMode mode, const SkPaint &paint)
void drawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
static sk_sp< SkColorFilter > Blend(const SkColor4f &c, sk_sp< SkColorSpace >, SkBlendMode mode)
sk_sp< SkTypeface > makeFromStream(std::unique_ptr< SkStreamAsset >, int ttcIndex=0) const
static SkRect GetFontBounds(const SkFont &)
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)
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
@ kStroke_Style
set to stroke geometry
bool getPosTan(SkScalar distance, SkPoint *position, SkVector *tangent)
static sk_sp< SkTextBlob > MakeFromRSXform(const void *text, size_t byteLength, const SkRSXform xform[], const SkFont &font, SkTextEncoding encoding=SkTextEncoding::kUTF8)
static sk_sp< SkVertices > MakeCopy(VertexMode mode, int vertexCount, const SkPoint positions[], const SkPoint texs[], const SkColor colors[], int indexCount, const uint16_t indices[])
@ kTriangleFan_VertexMode
GM(SkColor backgroundColor=SK_ColorWHITE)
static void draw_text_on_path(SkCanvas *canvas, const void *text, size_t length, const SkPoint xy[], const SkPath &path, const SkFont &font, const SkPaint &paint, float baseline_offset)
DEF_SIMPLE_GM(drawTextRSXform, canvas, 430, 860)
static void drawTextPath(SkCanvas *canvas, bool doStroke)
static sk_sp< SkShader > make_shader()
static sk_sp< SkVertices > make_vertices(sk_sp< SkImage > image, const SkRect &r, SkColor color)
const EmbeddedViewParams * params
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
static float max(float r, float g, float b)
sk_sp< const SkImage > atlas
Optional< SkRect > bounds
sk_sp< const SkImage > image
PODArray< SkRSXform > xforms
PODArray< SkColor > colors
SkSamplingOptions sampling
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 mode
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 constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo MakeN32Premul(int width, int height)
static constexpr SkPoint Make(float x, float y)
void set(float x, float y)
constexpr float y() const
constexpr float x() const
SkScalar fBottom
larger y-axis bounds
void toQuad(SkPoint quad[4]) const
void inset(float dx, float dy)
SkScalar fLeft
smaller x-axis bounds
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
SkScalar fRight
larger x-axis bounds
static constexpr SkRect MakeWH(float w, float h)
SkScalar fTop
smaller y-axis bounds