57 paint.setAntiAlias(
true);
65 paint.setColor(0x660000FF);
66 paint.setImageFilter(std::move(imf));
72 canvas->translate(10, 10);
86 canvas->translate(240, 0);
90 canvas->translate(0, 240);
98 return surface->makeImageSnapshot();
109 canvas->translate(10, 10);
110 for (
SkScalar sigma = 8; sigma <= 128; sigma *= 2) {
122 canvas->translate(0, r.
height() + 20);
125 canvas->translate(r.
width() + 20, 0);
164 const SkScalar kernel[] = { 4, 0, 4, 0, -15, 0, 4, 0, 4 };
177 { 0.5f, 0.5f, 530, 0 },
178 { 0.25f, 0.25f, 530, 275 },
179 { 0.125f, 0.125f, 530, 420 },
187 for (
const auto& xform :
xforms) {
190 canvas->
scale(xform.fSx, xform.fSy);
209 image = std::move(gpuImage);
216 SkScalar kernel[9] = {-1.f, -1.f, -1.f,
228 testCFPaint.setImageFilter(edgeDetector);
239 canvas->clipRect(crop);
245 canvas->clipRect(crop);
254 static constexpr SkScalar kPos[] = { 0.4f, 0.9f };
276 canvas->clipRect(crop);
282 canvas->clipRect(crop);
289 canvas->translate(5, 5);
302 canvas->clipRect({0, 0, 200, 200});
303 canvas->saveLayer(rec);
307 paint.setStrokeWidth(20);
309 canvas->drawCircle(100, 100, 70,
paint);
313 canvas->translate(205, 0);
320 drawFilteredLayer(filters);
327 drawFilteredLayer(filters);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kSrcOver
r = s + (1-sa)*d
@ kSrcATop
r = s*da + d*(1-sa)
constexpr SkColor SK_ColorTRANSPARENT
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
bool runAsBench() const override
void onDraw(SkCanvas *canvas) override
SkISize getISize() override
SkString getName() const override
static SkCanvas::SaveLayerRec ScaledBackdropLayer(const SkRect *bounds, const SkPaint *paint, const SkImageFilter *backdrop, SkScalar backdropScale, SkCanvas::SaveLayerFlags saveLayerFlags, SkCanvas::FilterSpan filters={})
int saveLayer(const SkRect *bounds, const SkPaint *paint)
void drawOval(const SkRect &oval, const SkPaint &paint)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void translate(SkScalar dx, SkScalar dy)
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
void scale(SkScalar sx, SkScalar sy)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
void clipRRect(const SkRRect &rrect, SkClipOp op, bool doAntiAlias)
static sk_sp< SkColorFilter > Matrix(const SkColorMatrix &)
void setSaturation(float sat)
static sk_sp< SkShader > MakeRadial(const SkPoint ¢er, SkScalar radius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
static sk_sp< SkImageFilter > MatrixConvolution(const SkISize &kernelSize, const SkScalar kernel[], SkScalar gain, SkScalar bias, const SkIPoint &kernelOffset, SkTileMode tileMode, bool convolveAlpha, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > ColorFilter(sk_sp< SkColorFilter > cf, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Erode(SkScalar radiusX, SkScalar radiusY, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > DropShadowOnly(SkScalar dx, SkScalar dy, SkScalar sigmaX, SkScalar sigmaY, SkColor color, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Blur(SkScalar sigmaX, SkScalar sigmaY, SkTileMode tileMode, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Compose(sk_sp< SkImageFilter > outer, sk_sp< SkImageFilter > inner)
static sk_sp< SkImageFilter > Image(sk_sp< SkImage > image, const SkRect &srcRect, const SkRect &dstRect, const SkSamplingOptions &sampling)
static sk_sp< SkImageFilter > MatrixTransform(const SkMatrix &matrix, const SkSamplingOptions &sampling, sk_sp< SkImageFilter > input)
static sk_sp< SkImageFilter > Blend(SkBlendMode mode, sk_sp< SkImageFilter > background, sk_sp< SkImageFilter > foreground=nullptr, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Shader(sk_sp< SkShader > shader, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Dilate(SkScalar radiusX, SkScalar radiusY, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static const SkMatrix & I()
void setImageFilter(sk_sp< SkImageFilter > imageFilter)
@ kStroke_Style
set to stroke geometry
void setMaskFilter(sk_sp< SkMaskFilter > maskFilter)
void setColorFilter(sk_sp< SkColorFilter > colorFilter)
static SkRRect MakeRectXY(const SkRect &rect, SkScalar xRad, SkScalar yRad)
const SkRect & getBounds() const
static sk_sp< SkMaskFilter > Make(sk_sp< SkShader > shader)
static void do_draw(SkCanvas *canvas, SkBlendMode mode, sk_sp< SkImageFilter > imf)
DEF_SIMPLE_GM(imagefilters_xfermodes, canvas, 480, 480)
static sk_sp< SkImage > make_image(SkCanvas *canvas)
static void draw_set(SkCanvas *canvas, sk_sp< SkImageFilter > filters[], int count)
SK_API sk_sp< SkImage > TextureFromImage(GrDirectContext *, const SkImage *, skgpu::Mipmapped=skgpu::Mipmapped::kNo, skgpu::Budgeted=skgpu::Budgeted::kYes)
sk_sp< const SkImage > image
PODArray< SkRSXform > xforms
SkSamplingOptions sampling
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
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
SkSamplingOptions(SkFilterMode::kLinear))
static sk_sp< SkColorFilter > Make(const SkHighContrastConfig &config)
static constexpr SkIPoint Make(int32_t x, int32_t y)
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo MakeS32(int width, int height, SkAlphaType at)
static SkRect Make(const SkISize &size)
constexpr SkRect makeOffset(float dx, float dy) const
static SkRect MakeIWH(int w, int h)
SkRect makeOutset(float dx, float dy) const
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
constexpr float height() const
constexpr float width() const
static constexpr SkRect MakeWH(float w, float h)