51 canvas->
clear(0x00000000);
60 return surface->makeImageSnapshot();
97 for (
size_t j = 0; j < 3; j++) {
103 paint.setImageFilter(filters[
i]);
104 paint.setAntiAlias(
true);
127 using INHERITED =
GM;
129DEF_GM(
return new ImageFiltersTransformedGM; )
145 for (
auto& filter : filters) {
146 paint.setAntiAlias(
false);
147 paint.setImageFilter(filter);
151 canvas->drawRect(r,
paint);
153 canvas->translate(150, 0);
155 canvas->rotate(30, 100, 100);
156 canvas->drawRect(r,
paint);
159 paint.setAntiAlias(
true);
160 canvas->translate(150, 0);
162 canvas->rotate(30, 100, 100);
163 canvas->drawRect(r,
paint);
167 canvas->translate(0, 150);
202 filterMatrix.
setRotate(fDegrees, 64, 64);
210 p.setImageFilter(filter);
245 this->drawFilter(canvas, 0.f, 0.f, this->makeDirectFilter(
matrix));
246 this->drawFilter(canvas, 256.f, 0.f, this->makeEarlyComposeFilter(
matrix));
247 this->drawFilter(canvas, 0.f, 256.f, this->makeLateComposeFilter(
matrix));
248 this->drawFilter(canvas, 256.f, 256.f, this->makeFullComposeFilter(
matrix));
257 p.setImageFilter(std::move(filter));
262 canvas->
scale(0.5f, 0.5f);
336 for (
auto m : {m1, m2}) {
338 for (
bool canvasTransform : {
false,
true}) {
343 if (canvasTransform) {
345 finalFilter = imageFilter;
351 paint.setImageFilter(std::move(finalFilter));
@ kSrcOver
r = s + (1-sa)*d
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
constexpr SkColor SK_ColorWHITE
#define SkDoubleToScalar(x)
void onDraw(SkCanvas *canvas) override
SkString getName() const override
void onOnceBeforeDraw() override
SkISize getISize() override
ImageFilterMatrixWLocalMatrix()
bool onAnimate(double nanos) override
void drawOval(const SkRect &oval, const SkPaint &paint)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void translate(SkScalar dx, SkScalar dy)
void drawPaint(const SkPaint &paint)
void clear(SkColor color)
void rotate(SkScalar degrees)
void scale(SkScalar sx, SkScalar sy)
void concat(const SkMatrix &matrix)
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
void skew(SkScalar sx, SkScalar sy)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
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)
sk_sp< SkImageFilter > makeWithLocalMatrix(const SkMatrix &matrix) const
static sk_sp< SkImageFilter > DropShadow(SkScalar dx, SkScalar dy, SkScalar sigmaX, SkScalar sigmaY, SkColor color, 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 > Blur(SkScalar sigmaX, SkScalar sigmaY, SkTileMode tileMode, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > DisplacementMap(SkColorChannel xChannelSelector, SkColorChannel yChannelSelector, SkScalar scale, sk_sp< SkImageFilter > displacement, sk_sp< SkImageFilter > color, 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 > Offset(SkScalar dx, SkScalar dy, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Dilate(SkScalar radiusX, SkScalar radiusY, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static SkM44 Rotate(SkV3 axis, SkScalar radians)
static SkM44 RectToRect(const SkRect &src, const SkRect &dst)
static SkM44 Translate(SkScalar x, SkScalar y, SkScalar z=0)
static SkM44 Perspective(float near, float far, float angle)
static SkM44 Scale(SkScalar x, SkScalar y, SkScalar z=1)
static SkMatrix RotateDeg(SkScalar deg)
SkMatrix & setRotate(SkScalar degrees, SkScalar px, SkScalar py)
SkMatrix & preTranslate(SkScalar dx, SkScalar dy)
SkMatrix & preScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)
GM(SkColor backgroundColor=SK_ColorWHITE)
static float min(float r, float g, float b)
unsigned useCenter Optional< SkMatrix > matrix
sk_sp< const SkImage > image
PODArray< SkColor > colors
SkSamplingOptions sampling
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static float Scaled(float time, float speed, float period=0)
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.
DEF_GM(return F(C(clipbox), 0.0f, 0.0f, {})) DEF_GM(return F(C(clipbox)
SkSamplingOptions(SkFilterMode::kLinear))
static sk_sp< SkImage > make_gradient_circle(int width, int height)
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo MakeN32Premul(int width, int height)
static constexpr SkPoint Make(float x, float y)
static SkRect MakeIWH(int w, int h)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
static constexpr SkRect MakeWH(float w, float h)
static void checkerboard(SkCanvas *canvas, SkColor c1, SkColor c2, int size)