39 {
40 const int w = tileW *
m;
41 const int h = tileH * n;
44 surf->getCanvas()->clear(
bgColor);
45
46 static constexpr SkScalar kStripeW = 10;
47 static constexpr SkScalar kStripeSpacing = 30;
49
52 paint.setShader(std::move(grad));
53 paint.setAntiAlias(
true);
55 paint.setStrokeWidth(kStripeW);
56 SkPoint stripePts[] = {{-
w - kStripeW, -kStripeW}, {kStripeW,
h + kStripeW}};
57 while (stripePts[0].fX <=
w) {
59 stripePts[0].
fX += kStripeSpacing;
60 stripePts[1].
fX += kStripeSpacing;
61 }
62
65 paint.setShader(std::move(grad));
67 stripePts[0] = {-
w - kStripeW,
h + kStripeW};
68 stripePts[1] = {kStripeW, -kStripeW};
69 while (stripePts[0].fX <=
w) {
71 stripePts[0].
fX += kStripeSpacing;
72 stripePts[1].
fX += kStripeSpacing;
73 }
74 auto fullImage = surf->makeImageSnapshot();
75 for (
int y = 0;
y < n; ++
y) {
76 for (
int x = 0;
x <
m; ++
x) {
77
83 }
87 }
91 }
95 }
96 set[
y *
m +
x].fImage = fullImage->makeSubset(
nullptr, subset);
100 set[
y *
m +
x].fAlpha = 1.f;
102 }
103 }
104}
static const SkColor bgColor
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kMultiply
r = s*(1-da) + d*(1-sa) + s*d
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
@ kLines_PointMode
draw each pair of points as a line segment
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)
@ kStroke_Style
set to stroke geometry
PODArray< SkColor > colors
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 set
int32_t fBottom
larger y-axis bounds
int32_t fTop
smaller y-axis bounds
static constexpr SkIRect MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
int32_t fLeft
smaller x-axis bounds
int32_t fRight
larger x-axis bounds
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)