27 int padRight,
int padBottom) {
33 int padRight,
int padBottom) {
36 const int kSize = 2*kCap + 3*kMid;
40 canvas->
translate((
float) padLeft, (
float) padTop);
46 xDivs[0] = kCap + padLeft;
47 yDivs[0] = kCap + padTop;
48 xDivs[1] = kCap + kMid + padLeft;
49 yDivs[1] = kCap + kMid + padTop;
50 xDivs[2] = kCap + 2 * kMid + padLeft;
51 yDivs[2] = kCap + 2 * kMid + padTop;
52 xDivs[3] = kCap + 3 * kMid + padLeft;
53 yDivs[3] = kCap + 3 * kMid + padTop;
56 paint.setAntiAlias(
true);
58 paint.setColor(0xFFFFFF00);
62 paint.setColor(0x8800FF00);
65 paint.setColor(0x880000FF);
68 paint.setColor(0x88FF00FF);
72 paint.setColor(0x8800FF00);
75 paint.setColor(0x880000FF);
78 paint.setColor(0x88FF00FF);
81 return surface->makeImageSnapshot();
104 int padRight,
int padBottom) {
114 padRight, padBottom);
142 for (
int iy = 0; iy < 2; ++iy) {
143 for (
int ix = 0; ix < 2; ++ix) {
153 int fixedColorX[3] = {2, 4, 1};
154 int fixedColorY[3] = {1, 1, 2};
158 for (
int rectNum = 0; rectNum < 3; rectNum++) {
159 int srcX =
xDivs[fixedColorX[rectNum]-1];
160 int srcY =
yDivs[fixedColorY[rectNum]-1];
178 for (
int rectNum = 0; rectNum < 3; rectNum++) {
179 flags[fixedColorY[rectNum]*6 + fixedColorX[rectNum]]
186 for (
int rectNum = 0; rectNum < 3; rectNum++) {
187 colors[fixedColorY[rectNum]*6 + fixedColorX[rectNum]]
188 = fixedColor[rectNum];
194 for (
int iy = 0; iy < 2; ++iy) {
195 for (
int ix = 0; ix < 2; ++ix) {
209 if (rContext && !dContext) {
210 *errorMsg =
"not supported in ddl";
234 const int kSize = 80;
238 paint.setAntiAlias(
false);
243 paint.setColor(0xFF00FF00);
247 paint.setColor(0xFF0000FF);
251 paint.setColor(0xFFFF0000);
257 paint.setColor(0xFFFF0000);
261 paint.setColor(0x880000FF);
265 paint.setColor(0xFF00FF00);
271 paint.setColor(0xFF00FF00);
275 paint.setColor(0x88FF0000);
279 paint.setColor(0xFF0000FF);
282 return surface->makeImageSnapshot();
287 int xDivs[2] = {4, 5};
288 int yDivs[2] = {1, 2};
315 0xFFFF0000, 0x880000FF, 0xFF00FF00,
318 paint.setColor(0xFFFFFFFF);
325 paint.setColor(0x80000FFF);
337 paint.setColor(0x7F123456);
343 this->onDrawHelper(canvas, 0, 0, 0, 0,
paint);
348 this->onDrawHelper(canvas, 0, 0, 0, 0,
paint);
359 surface->getCanvas()->clear(0);
363 int divs[] = { 20, 40, 60, 80 };
static const int strokeWidth
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
sk_bzero(glyphs, sizeof(glyphs))
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
@ kSrcOver
r = s + (1-sa)*d
@ kSrcATop
r = s*da + d*(1-sa)
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
constexpr SkColor SK_ColorMAGENTA
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorWHITE
#define INHERITED(method,...)
void onDrawHelper(SkCanvas *canvas, int padLeft, int padTop, int padRight, int padBottom, SkPaint &paint)
SkISize getISize() override
void onDraw(SkCanvas *canvas) override
SkString getName() const override
sk_sp< SkImage > makeImage(SkCanvas *root, int padLeft, int padTop, int padRight, int padBottom)
SkISize getISize() override
void onDrawHelper(GrDirectContext *dContext, SkCanvas *canvas, int padLeft, int padTop, int padRight, int padBottom)
DrawResult onDraw(SkCanvas *canvas, SkString *errorMsg) override
SkString getName() const override
void allocPixels(const SkImageInfo &info, size_t rowBytes)
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
virtual GrRecordingContext * recordingContext() const
void drawRoundRect(const SkRect &rect, SkScalar rx, SkScalar ry, const SkPaint &paint)
void drawImageLattice(const SkImage *image, const Lattice &lattice, const SkRect &dst, SkFilterMode filter, const SkPaint *paint=nullptr)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
bool readPixels(GrDirectContext *context, const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes, int srcX, int srcY, CachingHint cachingHint=kAllow_CachingHint) const
FlutterSemanticsFlag flags
static void image_to_bitmap(GrDirectContext *dContext, const SkImage *image, SkBitmap *bm)
static sk_sp< SkSurface > make_surface(SkCanvas *root, int N, int padLeft, int padTop, int padRight, int padBottom)
DEF_SIMPLE_GM_BG(lattice_alpha, canvas, 120, 120, SK_ColorWHITE)
static sk_sp< SkImage > make_image(SkCanvas *root, int *xDivs, int *yDivs, int padLeft, int padTop, int padRight, int padBottom)
Optional< SkRect > bounds
sk_sp< const SkImage > image
PODArray< SkColor > colors
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
int fYCount
number of y-coordinates
const SkIRect * fBounds
source bounds to draw from
@ kFixedColor
draws one of fColors into lattice rectangle
@ kTransparent
skips lattice rectangle by making it transparent
const int * fYDivs
y-axis values dividing bitmap
int fXCount
number of x-coordinates
const RectType * fRectTypes
array of fill types
const SkColor * fColors
array of colors
const int * fXDivs
x-axis values dividing bitmap
static constexpr SkIRect MakeLTRB(int32_t l, int32_t t, int32_t r, int32_t b)
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo MakeN32Premul(int width, int height)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static SkImageInfo MakeA8(int width, int height)
void setXYWH(float x, float y, float width, float height)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
static constexpr SkRect MakeWH(float w, float h)