128 {
130
131
136
137
141 canvas->imageInfo().refColorSpace());
144 auto atlas = surf->makeImageSnapshot();
146
147
157 };
158
160 if (!effect) {
162 }
165
166 auto makePaint = [&](bool useCF, bool useShader) {
168 paint.setColorFilter(useCF ? colorfilter : nullptr);
171 };
172
173 auto drawVertices = [&](
float x,
bool useCF,
bool useShader) {
175 canvas->translate(
x, 0);
176
178 canvas->drawVertices(verts, mode, makePaint(useCF, useShader));
179 };
180
183 canvas->translate(
x, 0);
187 &xform,
188 &r,
190 1,
193 nullptr,
195 };
196
197 auto drawPatch = [&](
float x,
bool useCF) {
199 canvas->translate(
x, 0);
202 };
203
204 drawVertices( 0, false, false);
205 drawVertices( r.
width() + 10,
true,
false);
206 drawVertices(2*(r.
width() + 10),
true,
true);
207
208 canvas->translate(0, r.
height() + 10);
211
212 canvas->translate(0, r.
height() + 10);
213 drawPatch( 0, false);
214 drawPatch(r.
width() + 10,
true);
215}
static constexpr SkColor kColor
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorCYAN
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorGREEN
constexpr SkColor SK_ColorWHITE
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
static Result MakeForColorFilter(SkString sksl, const Options &)
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
sk_sp< const SkImage > atlas
drawAtlas(r.atlas.get(), r.xforms, r.texs, r.colors, r.count, r.mode, r.sampling, r.cull, r.paint)) DRAW(DrawAnnotation
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
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
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
bool setLength(float length)
void toQuad(SkPoint quad[4]) const
constexpr float height() const
constexpr float width() const
static constexpr SkRect MakeWH(float w, float h)