230 {
245 };
246 const char* filterNames[] = {
247 "Color",
248 "Blur",
249 "Drop Shadow",
250 "Offset",
251 "Dilate",
252 "Erode",
253 "Displacement",
254 "Arithmetic",
255 "Blend",
256 "Convolution",
257 "Matrix Xform",
258 "Lighting",
259 "Tile"
260 };
262
264 { -20, -20, 100, 100 },
265 { 0, 0, 75, 75 },
266 { 20, 20, 100, 100 },
267 { -20, -20, 50, 50 },
268 { 20, 20, 50, 50 },
269 { 30, 30, 75, 75 }
270 };
271
273
275 if (rContext) {
276 if (!dContext) {
277 *errorMsg = "Requires a direct context.";
279 }
280 if (dContext->abandoned()) {
281 *errorMsg = "Direct context abandoned.";
283 }
284 }
285
286
287
290 if (!mainImage || !auxImage) {
292 }
295
299
300
307 }
308
310
311 for (auto clipBound : clipBounds) {
316
317
318
322
323 this->drawImageWithFilter(canvas, mainImage, auxImage, filters[
i], clipBound,
324 subset, &outSubset);
325
326
327
328 SkIRect* outSubsetBounds =
nullptr;
329 if (fStrategy != Strategy::kSaveLayer) {
330 outSubsetBounds = &outSubset;
331 }
332 show_bounds(canvas, &clipBound, &subset, outSubsetBounds);
333
335 }
338 }
340 }
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
void translate(SkScalar dx, SkScalar dy)
virtual GrRecordingContext * recordingContext() const
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
virtual bool isTextureBacked() const =0
void setAntiAlias(bool aa)
static sk_sp< SkImageFilter > tile_factory(sk_sp< SkImage > auxImage, const SkIRect *cropRect)
static void show_bounds(SkCanvas *canvas, const SkIRect *clip, const SkIRect *inSubset, const SkIRect *outSubset)
static sk_sp< SkImageFilter > drop_shadow_factory(sk_sp< SkImage > auxImage, const SkIRect *cropRect)
static sk_sp< SkImageFilter > lighting_factory(sk_sp< SkImage > auxImage, const SkIRect *cropRect)
static sk_sp< SkImageFilter > dilate_factory(sk_sp< SkImage > auxImage, const SkIRect *cropRect)
static sk_sp< SkImageFilter > blur_filter_factory(sk_sp< SkImage > auxImage, const SkIRect *cropRect)
static sk_sp< SkImageFilter > convolution_factory(sk_sp< SkImage > auxImage, const SkIRect *cropRect)
static sk_sp< SkImageFilter > offset_factory(sk_sp< SkImage > auxImage, const SkIRect *cropRect)
static sk_sp< SkImageFilter > blend_factory(sk_sp< SkImage > auxImage, const SkIRect *cropRect)
static sk_sp< SkImageFilter > erode_factory(sk_sp< SkImage > auxImage, const SkIRect *cropRect)
static sk_sp< SkImageFilter > color_filter_factory(sk_sp< SkImage > auxImage, const SkIRect *cropRect)
static sk_sp< SkImageFilter > matrix_factory(sk_sp< SkImage > auxImage, const SkIRect *cropRect)
sk_sp< SkImageFilter >(* FilterFactory)(sk_sp< SkImage > auxImage, const SkIRect *cropRect)
static sk_sp< SkImageFilter > arithmetic_factory(sk_sp< SkImage > auxImage, const SkIRect *cropRect)
static sk_sp< SkImageFilter > displacement_factory(sk_sp< SkImage > auxImage, const SkIRect *cropRect)
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.
SkSamplingOptions(SkFilterMode::kLinear))
static constexpr SkIRect MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)