72static DEFINE_bool2(gpuInfo, g,
false,
"Display GPU information on relevant targets.");
98 switch (colorFilterType) {
115 return outer->makeComposed(std::move(inner));
119 fuzz->
nextN(array, std::size(array));
124 fuzz->
next(&mul, &add);
131 fuzz->
next(&grayscale);
149 fuzz->
nextN(tableA, std::size(tableA));
150 fuzz->
nextN(tableR, std::size(tableR));
151 fuzz->
nextN(tableG, std::size(tableG));
152 fuzz->
nextN(tableB, std::size(tableB));
164 for (
int i = 0; i < colorCount; ++i) {
168 totalPos = 1.0f / totalPos;
169 for (
int i = 0; i < colorCount; ++i) {
173 pos[colorCount - 1] = 1.0f;
191 switch (shaderType) {
195 return SkShaders::Empty();
198 return SkShaders::Color(
color);
203 fuzz->
next(&useMatrix);
207 return img->makeShader(tmX, tmY,
SkSamplingOptions(), useMatrix ? &matrix :
nullptr);
211 return shader1 ? shader1->makeWithLocalMatrix(matrix) :
nullptr;
215 return shader1 ? shader1->makeWithColorFilter(std::move(colorFilter)) :
nullptr;
220 return SkShaders::Blend(blendMode, std::move(shader1), std::move(shader2));
227 fuzz->
next(&useMatrix, &useTile);
235 useMatrix ? &matrix :
nullptr, useTile ? &tile :
nullptr);
242 constexpr int kMaxColors = 12;
249 fuzz->
nextRange(&colorCount, 2, kMaxColors);
250 fuzz->
nextN(colors, colorCount);
252 fuzz->
next(&useMatrix, &usePos);
260 tmX, 0, useMatrix ? &matrix :
nullptr);
263 constexpr int kMaxColors = 12;
271 fuzz->
next(&useMatrix, &usePos, &
center, &radius);
272 fuzz->
nextRange(&colorCount, 2, kMaxColors);
273 fuzz->
nextN(colors, colorCount);
281 colorCount, tmX, 0, useMatrix ? &matrix :
nullptr);
284 constexpr int kMaxColors = 12;
292 fuzz->
next(&useMatrix, &usePos, &startRadius, &endRadius, &
start, &
end);
293 fuzz->
nextRange(&colorCount, 2, kMaxColors);
294 fuzz->
nextN(colors, colorCount);
302 usePos ?
pos :
nullptr, colorCount, tmX, 0,
303 useMatrix ? &matrix :
nullptr);
306 constexpr int kMaxColors = 12;
312 fuzz->
next(&cx, &cy, &useMatrix, &usePos);
313 fuzz->
nextRange(&colorCount, 2, kMaxColors);
314 fuzz->
nextN(colors, colorCount);
322 0, useMatrix ? &matrix :
nullptr);
325 SkScalar baseFrequencyX, baseFrequencyY, seed;
328 bool useTileSize, turbulence;
329 fuzz->
next(&baseFrequencyX, &baseFrequencyY, &seed, &useTileSize, &turbulence);
331 fuzz->
next(&tileSize);
339 useTileSize ? &tileSize :
nullptr);
345 useTileSize ? &tileSize :
nullptr);
359 uint8_t pathEffectType;
361 switch (pathEffectType) {
379 fuzz->
next(&advance, &phase);
415 fuzz->
next(&segLength, &dev, &seed);
427 switch (maskfilterType) {
436 fuzz->
next(&respectCTM);
446 if (make_fuzz_t<bool>(fuzz)) {
450 int familyCount = mgr->countFamilies();
454 int styleCount = family->count();
465 uint8_t imageFilterType;
469 SkScalar surfaceScale, k, specularExponent, cutoffAngle, shininess;
473 fuzz->
next(&useCropRect);
475 fuzz->
next(&cropRect);
477 switch (imageFilterType) {
479 fuzz->
next(&p, &lightColor, &surfaceScale, &k);
483 useCropRect ? &cropRect :
nullptr);
485 fuzz->
next(&p, &lightColor, &surfaceScale, &k);
489 useCropRect ? &cropRect :
nullptr);
491 fuzz->
next(&p, &q, &specularExponent, &cutoffAngle, &lightColor, &surfaceScale, &k);
494 p, q, specularExponent, cutoffAngle, lightColor, surfaceScale, k,
495 std::move(input), useCropRect ? &cropRect :
nullptr);
497 fuzz->
next(&p, &lightColor, &surfaceScale, &k, &shininess);
500 shininess, std::move(input),
501 useCropRect ? &cropRect :
nullptr);
503 fuzz->
next(&p, &lightColor, &surfaceScale, &k, &shininess);
506 shininess, std::move(input),
507 useCropRect ? &cropRect :
nullptr);
509 fuzz->
next(&p, &q, &specularExponent, &cutoffAngle, &lightColor, &surfaceScale, &k,
513 p, q, specularExponent, cutoffAngle, lightColor, surfaceScale, k, shininess,
514 std::move(input), useCropRect ? &cropRect :
nullptr);
541 uint8_t imageFilterType;
542 fuzz->
nextRange(&imageFilterType, 0, 22);
543 switch (imageFilterType) {
550 fuzz->
next(&sigmaX, &sigmaY, &useCropRect);
553 fuzz->
next(&cropRect);
556 useCropRect ? &cropRect :
nullptr);
566 float k1, k2, k3, k4;
569 fuzz->
next(&k1, &k2, &k3, &k4, &enforcePMColor, &useCropRect);
574 fuzz->
next(&cropRect);
577 std::move(background), std::move(foreground),
578 useCropRect ? &cropRect :
nullptr);
585 fuzz->
next(&useCropRect);
587 fuzz->
next(&cropRect);
590 useCropRect ? &cropRect :
nullptr);
606 fuzz->
next(&cropRect);
611 std::move(displacement), std::move(
color),
612 useCropRect ? &cropRect :
nullptr);
617 bool shadowOnly, useCropRect;
618 fuzz->
next(&dx, &dy, &sigmaX, &sigmaY, &
color, &shadowOnly, &useCropRect);
621 fuzz->
next(&cropRect);
627 useCropRect ? &cropRect :
nullptr);
630 useCropRect ? &cropRect :
nullptr);
638 fuzz->
next(&srcRect, &dstRect);
649 fuzz->
next(&lensBounds, &zoomAmount, &
inset, &useCropRect);
651 fuzz->
next(&cropRect);
656 std::move(input), useCropRect ? &cropRect :
nullptr);
659 constexpr int kMaxKernelSize = 5;
663 SkScalar kernel[kMaxKernelSize * kMaxKernelSize];
664 fuzz->
nextN(kernel, n * m);
669 bool convolveAlpha, useCropRect;
670 fuzz->
next(&gain, &bias, &convolveAlpha, &useCropRect);
675 fuzz->
next(&cropRect);
680 convolveAlpha, std::move(input), useCropRect ? &cropRect :
nullptr);
686 fuzz->
next(&useCropRect);
689 fuzz->
next(&cropRect);
692 useCropRect ? &cropRect :
nullptr);
695 constexpr int kMaxCount = 4;
699 for (
int i = 0; i <
count; ++i) {
703 fuzz->
next(&useCropRect);
706 fuzz->
next(&cropRect);
712 fuzz->
next(&rx, &ry);
714 fuzz->
next(&useCropRect);
717 fuzz->
next(&cropRect);
721 useCropRect ? &cropRect :
nullptr);
725 fuzz->
next(&rx, &ry);
727 fuzz->
next(&useCropRect);
730 fuzz->
next(&cropRect);
734 useCropRect ? &cropRect :
nullptr);
738 fuzz->
next(&dx, &dy);
740 fuzz->
next(&useCropRect);
743 fuzz->
next(&cropRect);
747 useCropRect ? &cropRect :
nullptr);
755 fuzz->
next(&cropRect);
761 fuzz->
next(&src, &dst);
768 fuzz->
next(&useCropRect);
772 fuzz->
next(&cropRect);
777 useCropRect ? &cropRect :
nullptr);
782 fuzz->
next(&useCropRect);
785 fuzz->
next(&cropRect);
802 for (
int i = 0; i < n; ++i) {
807 (void)data.release();
809 pixmap, [](
const void* p,
void*) {
sk_free(
const_cast<void*
>(p)); },
nullptr);
820 if (!fuzz || !
paint || depth <= 0) {
824 paint->setAntiAlias( make_fuzz_t<bool>(fuzz));
825 paint->setDither( make_fuzz_t<bool>(fuzz));
826 paint->setColor( make_fuzz_t<SkColor>(fuzz));
828 paint->setStyle( make_fuzz_enum_range<SkPaint::Style>(fuzz,
837 paint->setStrokeWidth(make_fuzz_t<SkScalar>(fuzz));
838 paint->setStrokeMiter(make_fuzz_t<SkScalar>(fuzz));
847 font.setSize( make_fuzz_t<SkScalar>(fuzz));
848 font.setScaleX( make_fuzz_t<SkScalar>(fuzz));
849 font.setSkewX( make_fuzz_t<SkScalar>(fuzz));
850 font.setLinearMetrics( make_fuzz_t<bool>(fuzz));
851 font.setSubpixel( make_fuzz_t<bool>(fuzz));
852 font.setEmbeddedBitmaps( make_fuzz_t<bool>(fuzz));
853 font.setForceAutoHinting( make_fuzz_t<bool>(fuzz));
854 font.setEmbolden( make_fuzz_t<bool>(fuzz));
856 font.setEdging( make_fuzz_enum_range<SkFont::Edging>(fuzz,
870 int glyphRange = font.getTypeface()->countGlyphs();
871 if (glyphRange == 0) {
879 for (
int i = 0; i < glyphCount; ++i) {
890 for (
size_t i = 0; i < std::size(ranges); ++i) {
891 count += (ranges[i][1] - ranges[i][0]);
897 for (
int j = 0; j <
length; ++j) {
900 for (
size_t i = 0; i < std::size(ranges); ++i) {
901 if (
value + ranges[i][0] < ranges[i][1]) {
905 value -= (ranges[i][1] - ranges[i][0]);
912 for (
int j = 0; j <
length; ++j) {
915 char* ptr = (
char*)array.
append(utf8len);
916 for (
int j = 0; j <
length; ++j) {
922 for (
int j = 0; j <
length; ++j) {
925 uint16_t* ptr = (uint16_t*)array.
append(utf16len *
sizeof(uint16_t));
926 for (
int j = 0; j <
length; ++j) {
943 std::string str(len, 0);
944 for (
int i = 0; i < len; i++) {
953 fuzz->
nextRange(&runCount, (int8_t)1, (int8_t)8);
954 while (runCount-- > 0) {
964 fuzz->
nextRange(&runType, (uint8_t)0, (uint8_t)2);
965 const void* textPtr =
text.begin();
972 (void)font.textToGlyphs(textPtr, textLen, encoding,
buffer->glyphs, glyphCount);
978 (void)font.textToGlyphs(textPtr, textLen, encoding,
buffer->glyphs, glyphCount);
984 (void)font.textToGlyphs(textPtr, textLen, encoding,
buffer->glyphs, glyphCount);
992 return textBlobBuilder.
make();
996 if (!fuzz || !canvas || depth <= 0) {
1002 for (
unsigned loop = 0; loop <
N; ++loop) {
1008 unsigned drawCommand;
1010 switch (drawCommand) {
1012#if defined(SK_GANESH)
1014 dContext->flushAndSubmit();
1023 fuzz->
next(&bounds);
1030 fuzz->
next(&bounds);
1050 fuzz->
next(&bounds, &alpha);
1057 if (make_fuzz_t<bool>(fuzz)) {
1058 fuzz->
next(&bounds);
1059 saveLayerRec.
fBounds = &bounds;
1061 if (make_fuzz_t<bool>(fuzz)) {
1066 if (make_fuzz_t<bool>(fuzz)) {
1083 fuzz->
next(&saveCount);
1136 fuzz->
next(&r, &doAntiAlias);
1147 fuzz->
next(&doAntiAlias);
1157 fuzz->
next(&doAntiAlias);
1165 fuzz->
next(®ion);
1180 constexpr int kMaxCount = 30;
1200 fuzz->
next(®ion);
1237 fuzz->
next(&r, &
start, &sweep, &useCenter);
1252 fuzz->
next(&
left, &top, &usePaint);
1257 usePaint ? &
paint :
nullptr);
1265 fuzz->
next(&src, &dst, &usePaint);
1273 usePaint ? &
paint :
nullptr, constraint);
1281 fuzz->
next(&usePaint);
1285 if (make_fuzz_t<bool>(fuzz)) {
1295 usePaint ? &
paint :
nullptr);
1302 fuzz->
next(&usePaint, &dst);
1306 constexpr int kMax = 6;
1307 int xDivs[kMax], yDivs[kMax];
1309 fuzz->
nextRange(&lattice.fXCount, 2, kMax);
1310 fuzz->
nextRange(&lattice.fYCount, 2, kMax);
1311 fuzz->
nextN(xDivs, lattice.fXCount);
1312 fuzz->
nextN(yDivs, lattice.fYCount);
1314 usePaint ? &
paint :
nullptr);
1358 bool usePaint, useMatrix;
1359 fuzz->
next(&usePaint, &useMatrix);
1367 canvas->
drawPicture(pic, useMatrix ? &matrix :
nullptr,
1368 usePaint ? &
paint :
nullptr);
1377 constexpr int kMaxCount = 100;
1382 fuzz->
nextRange(&vertexCount, 3, kMaxCount);
1383 fuzz->
nextN(vertices, vertexCount);
1384 bool useTexs, useColors;
1385 fuzz->
next(&useTexs, &useColors);
1387 fuzz->
nextN(texs, vertexCount);
1390 fuzz->
nextN(colors, vertexCount);
1393 uint16_t indices[kMaxCount * 2];
1394 if (make_fuzz_t<bool>(fuzz)) {
1395 fuzz->
nextRange(&indexCount, vertexCount, vertexCount + kMaxCount);
1396 for (
int index = 0; index < indexCount; ++index) {
1397 fuzz->
nextRange(&indices[index], 0, vertexCount - 1);
1401 useTexs ? texs :
nullptr,
1402 useColors ? colors :
nullptr,
1403 indexCount, indices),
1418 float R,
G,
B, Alpha;
1431 fuzz->
next(&p0, &p1);
1455 fuzz->
next(&oval, &startAngle, &sweepAngle, &useCenter);
1456 canvas->
drawArc(oval, startAngle, sweepAngle, useCenter,
paint);
1463 fuzz->
next(&rect, &rx, &ry);
1482 fuzz->
nextN(cubics, 12);
1483 fuzz->
nextN(colors, 4);
1484 fuzz->
next(&useTexCoords);
1486 fuzz->
nextN(texCoords, 4);
1490 canvas->
drawPatch(cubics, colors, useTexCoords ? texCoords : nullptr
1527 if (!pic) { fuzz->signalBug(); }
1533 if (!data) { fuzz->signalBug(); }
1537 if (!deserialized) { fuzz->signalBug(); }
1541 surface->getCanvas()->drawPicture(deserialized);
1546 if (!
bitmap.tryAllocN32Pixels(256, 256)) {
1547 SkDEBUGF(
"Could not allocate 256x256 bitmap in ImageFilter");
1554 paint.setImageFilter(fil);
1561#define SK_ADD_RANDOM_BIT_FLIPS
1565 if (!
bitmap.tryAllocN32Pixels(256, 256)) {
1566 SkDEBUGF(
"Could not allocate 256x256 bitmap in SerializedImageFilter");
1574 auto data = filter->serialize();
1575 const unsigned char* ptr =
static_cast<const unsigned char*
>(data->data());
1576 size_t len = data->size();
1577#ifdef SK_ADD_RANDOM_BIT_FLIPS
1578 unsigned char* p =
const_cast<unsigned char*
>(ptr);
1579 for (
size_t i = 0; i < len; ++i, ++p) {
1581 fuzz->nextRange(&j, 1, 250);
1584 fuzz->nextRange(&k, 1, 10);
1587 fuzz->nextRange(&
s, 0, 2);
1601 fuzz->nextRange(&
s, 0, 7);
1618 paint.setImageFilter(deserializedFil);
1625#if defined(SK_GANESH)
1638 fuzz_ganesh(fuzz,
f.get(skgpu::ContextType::kMock));
1648 SkDebugf(
"GL_RENDERER %s\n", (
const char*) output);
1651 SkDebugf(
"GL_VENDOR %s\n", (
const char*) output);
1654 SkDebugf(
"GL_VERSION %s\n", (
const char*) output);
1659 auto context =
f.get(skgpu::ContextType::kGL);
1661 context =
f.get(skgpu::ContextType::kGLES);
1663 if (FLAGS_gpuInfo) {
1664 dump_GPU_info(context);
1666 fuzz_ganesh(fuzz, context);
1686 debugCanvas.
toJSON(writer, dataManager, nullCanvas.get());
1690 fwrite(json->data(), json->size(), 1, stdout);
#define DEFINE_bool2(name, shortName, defaultValue, helpString)
static sk_sp< SkPicture > make_fuzz_picture(Fuzz *, int depth)
constexpr int kMaxGlyphCount
static void fuzz_canvas(Fuzz *fuzz, SkCanvas *canvas, int depth=9)
static T make_fuzz_enum_range(Fuzz *fuzz, T maxv)
static sk_sp< SkPathEffect > make_fuzz_patheffect(Fuzz *fuzz, int depth)
static SkFont fuzz_font(Fuzz *fuzz)
static sk_sp< SkTypeface > make_fuzz_typeface(Fuzz *fuzz)
static std::string make_fuzz_string(Fuzz *fuzz)
static SkSamplingOptions next_sampling(Fuzz *fuzz)
static sk_sp< SkMaskFilter > make_fuzz_maskfilter(Fuzz *fuzz)
T make_fuzz_t(Fuzz *fuzz)
static void fuzz_paint(Fuzz *fuzz, SkPaint *paint, int depth)
static SkTDArray< uint8_t > make_fuzz_text(Fuzz *fuzz, const SkFont &font, SkTextEncoding encoding)
static void fuzz_gradient_stops(Fuzz *fuzz, SkScalar *pos, int colorCount)
static sk_sp< SkImageFilter > make_fuzz_lighting_imagefilter(Fuzz *fuzz, int depth)
static SkTextEncoding fuzz_paint_text_encoding(Fuzz *fuzz)
static sk_sp< SkShader > make_fuzz_shader(Fuzz *fuzz, int depth)
static sk_sp< SkColorFilter > make_fuzz_colorfilter(Fuzz *fuzz, int depth)
static sk_sp< SkImageFilter > make_fuzz_imageFilter(Fuzz *fuzz, int depth)
static sk_sp< SkTextBlob > make_fuzz_textblob(Fuzz *fuzz)
constexpr SkISize kCanvasSize
static sk_sp< SkImage > make_fuzz_image(Fuzz *)
void FuzzNiceRRect(Fuzz *fuzz, SkRRect *rr)
void FuzzNiceMatrix(Fuzz *fuzz, SkMatrix *m)
void FuzzNicePath(Fuzz *fuzz, SkPath *path, int maxOps)
#define DEF_FUZZ(name, f)
#define GR_GL_CALL_RET(IFACE, RET, X)
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kSrcOver
r = s + (1-sa)*d
@ kLastMode
last valid value
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
SK_API SkPMColor SkPreMultiplyColor(SkColor c)
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
@ kFull
modifies glyph outlines for maximum constrast
@ kUTF8
uses bytes to represent UTF-8 or ASCII
@ kUTF16
uses two byte words to represent most of Unicode
@ kUTF32
uses four byte words to represent all of Unicode
@ kGlyphID
uses two byte words to represent glyph indices
SK_API void sk_free(void *)
SK_API std::unique_ptr< SkCanvas > SkMakeNullCanvas()
static bool left(const SkPoint &p0, const SkPoint &p1)
constexpr size_t SkToSizeT(S x)
static SkScalar center(float pos0, float pos1)
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager, SkCanvas *)
void nextRange(T *, Min, Max)
void nextEnum(T *ptr, T max)
void nextN(T *ptr, int n)
GrDirectContextPriv priv()
int saveLayer(const SkRect *bounds, const SkPaint *paint)
void drawRect(const SkRect &rect, const SkPaint &paint)
void drawOval(const SkRect &oval, const SkPaint &paint)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint &paint)
void drawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], SkBlendMode mode, const SkPaint &paint)
void drawSimpleText(const void *text, size_t byteLength, SkTextEncoding encoding, SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
void drawImageNine(const SkImage *image, const SkIRect ¢er, const SkRect &dst, SkFilterMode filter, const SkPaint *paint=nullptr)
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
virtual GrRecordingContext * recordingContext() const
void drawPaint(const SkPaint &paint)
void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint &paint)
int saveLayerAlpha(const SkRect *bounds, U8CPU alpha)
@ kStrict_SrcRectConstraint
sample only inside bounds; slower
@ kFast_SrcRectConstraint
sample outside bounds; faster
void clipRegion(const SkRegion &deviceRgn, SkClipOp op=SkClipOp::kIntersect)
void drawIRect(const SkIRect &rect, const SkPaint &paint)
void rotate(SkScalar degrees)
void restoreToCount(int saveCount)
void drawRRect(const SkRRect &rrect, const SkPaint &paint)
void drawRoundRect(const SkRect &rect, SkScalar rx, SkScalar ry, const SkPaint &paint)
void drawArc(const SkRect &oval, SkScalar startAngle, SkScalar sweepAngle, bool useCenter, const SkPaint &paint)
void drawImageLattice(const SkImage *image, const Lattice &lattice, const SkRect &dst, SkFilterMode filter, const SkPaint *paint=nullptr)
void clipPath(const SkPath &path, SkClipOp op, bool doAntiAlias)
void drawRegion(const SkRegion ®ion, const SkPaint &paint)
void drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
void drawPath(const SkPath &path, const SkPaint &paint)
void setMatrix(const SkM44 &matrix)
void drawDRRect(const SkRRect &outer, const SkRRect &inner, const SkPaint &paint)
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 drawPicture(const SkPicture *picture)
void drawVertices(const SkVertices *vertices, SkBlendMode mode, const SkPaint &paint)
@ kPolygon_PointMode
draw the array of points as a open polygon
@ kPoints_PointMode
draw each point separately
void skew(SkScalar sx, SkScalar sy)
void drawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
void clipRRect(const SkRRect &rrect, SkClipOp op, bool doAntiAlias)
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
static sk_sp< SkColorFilter > Blend(const SkColor4f &c, sk_sp< SkColorSpace >, SkBlendMode mode)
static sk_sp< SkColorFilter > Table(const uint8_t table[256])
static sk_sp< SkColorFilter > Matrix(const SkColorMatrix &)
static sk_sp< SkColorFilter > Lighting(SkColor mul, SkColor add)
static sk_sp< SkColorFilter > TableARGB(const uint8_t tableA[256], const uint8_t tableR[256], const uint8_t tableG[256], const uint8_t tableB[256])
static sk_sp< SkPathEffect > Make(SkScalar radius)
static sk_sp< SkPathEffect > Make(const SkScalar intervals[], int count, SkScalar phase)
static sk_sp< SkPathEffect > Make(SkScalar segLength, SkScalar dev, uint32_t seedAssist=0)
@ kAntiAlias
may have transparent pixels on glyph edges
@ kAlias
no transparent pixels on glyph edges
@ kSubpixelAntiAlias
glyph positioned in pixel using transparency
static sk_sp< SkShader > MakeTwoPointConical(const SkPoint &start, SkScalar startRadius, const SkPoint &end, SkScalar endRadius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
static sk_sp< SkShader > MakeSweep(SkScalar cx, SkScalar cy, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, SkScalar startAngle, SkScalar endAngle, uint32_t flags, const SkMatrix *localMatrix)
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< SkShader > MakeLinear(const SkPoint pts[2], const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
static sk_sp< SkImageFilter > Deserialize(const void *data, size_t size, const SkDeserialProcs *procs=nullptr)
static sk_sp< SkImageFilter > PointLitDiffuse(const SkPoint3 &location, SkColor lightColor, SkScalar surfaceScale, SkScalar kd, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
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 > 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 > DistantLitSpecular(const SkPoint3 &direction, SkColor lightColor, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > DistantLitDiffuse(const SkPoint3 &direction, SkColor lightColor, SkScalar surfaceScale, SkScalar kd, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Merge(sk_sp< SkImageFilter > *const filters, int count, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Arithmetic(SkScalar k1, SkScalar k2, SkScalar k3, SkScalar k4, bool enforcePMColor, sk_sp< SkImageFilter > background, sk_sp< SkImageFilter > foreground, 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 > Magnifier(const SkRect &lensBounds, SkScalar zoomAmount, SkScalar inset, const SkSamplingOptions &sampling, 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 > Picture(sk_sp< SkPicture > pic, const SkRect &targetRect)
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 > 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 sk_sp< SkImageFilter > Tile(const SkRect &src, const SkRect &dst, sk_sp< SkImageFilter > input)
static sk_sp< SkImageFilter > PointLitSpecular(const SkPoint3 &location, SkColor lightColor, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > SpotLitDiffuse(const SkPoint3 &location, const SkPoint3 &target, SkScalar falloffExponent, SkScalar cutoffAngle, SkColor lightColor, SkScalar surfaceScale, SkScalar kd, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > SpotLitSpecular(const SkPoint3 &location, const SkPoint3 &target, SkScalar falloffExponent, SkScalar cutoffAngle, SkColor lightColor, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
void beginObject(const char *name=nullptr, bool multiline=true)
static sk_sp< SkPathEffect > Make(SkScalar width, const SkMatrix &matrix)
static sk_sp< SkMaskFilter > MakeBlur(SkBlurStyle style, SkScalar sigma, bool respectCTM=true)
@ kLast_Cap
largest Cap value
@ kFill_Style
set to fill geometry
@ kStrokeAndFill_Style
sets to stroke and fill geometry
@ kLast_Join
equivalent to the largest value for Join
static sk_sp< SkPathEffect > Make(const SkPath &path, SkScalar advance, SkScalar phase, Style)
static sk_sp< SkPathEffect > Make(const SkMatrix &matrix, const SkPath &path)
static sk_sp< SkPathEffect > MakeCompose(sk_sp< SkPathEffect > outer, sk_sp< SkPathEffect > inner)
static sk_sp< SkPathEffect > MakeSum(sk_sp< SkPathEffect > first, sk_sp< SkPathEffect > second)
static sk_sp< SkPicture > MakeFromBuffer(SkReadBuffer &buffer)
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkPicture > finishRecordingAsPicture()
const SkRect & getBounds() const
static std::unique_ptr< SkCanvas > Make(const SkRect &bounds, SkWStream *, uint32_t flags=0)
const RunBuffer & allocRunPosH(const SkFont &font, int count, SkScalar y, const SkRect *bounds=nullptr)
const RunBuffer & allocRun(const SkFont &font, int count, SkScalar x, SkScalar y, const SkRect *bounds=nullptr)
sk_sp< SkTextBlob > make()
const RunBuffer & allocRunPos(const SkFont &font, int count, const SkRect *bounds=nullptr)
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
static const uint8_t buffer[]
SK_API sk_sp< SkImage > RasterFromPixmap(const SkPixmap &pixmap, RasterReleaseProc rasterReleaseProc, ReleaseContext releaseContext)
SK_API sk_sp< SkDocument > MakeDocument(SkWStream *stream, const Metadata &metadata)
constexpr SkCodecs::Decoder Decoder()
SK_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)
SK_API sk_sp< SkShader > MakeTurbulence(SkScalar baseFrequencyX, SkScalar baseFrequencyY, int numOctaves, SkScalar seed, const SkISize *tileSize=nullptr)
SK_API sk_sp< SkShader > MakeFractalNoise(SkScalar baseFrequencyX, SkScalar baseFrequencyY, int numOctaves, SkScalar seed, const SkISize *tileSize=nullptr)
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
SK_API sk_sp< SkSurface > RenderTarget(GrRecordingContext *context, skgpu::Budgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, GrSurfaceOrigin surfaceOrigin, const SkSurfaceProps *surfaceProps, bool shouldCreateWithMips=false, bool isProtected=false)
SK_SPI size_t ToUTF8(SkUnichar uni, char utf8[kMaxBytesInUTF8Sequence]=nullptr)
SK_SPI size_t ToUTF16(SkUnichar uni, uint16_t utf16[2]=nullptr)
static SkRect inset(const SkRect &r)
const SkImageFilter * fBackdrop
static constexpr SkCubicResampler Mitchell()
static sk_sp< SkColorFilter > Make(const SkHighContrastConfig &config)
constexpr int32_t width() const
constexpr int32_t height() const
static SkImageInfo MakeN32Premul(int width, int height)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static sk_sp< SkColorFilter > Make()
static SkRect Make(const SkISize &size)
static SkRect MakeIWH(int w, int h)
bool contains(SkScalar x, SkScalar y) const
static constexpr SkRect MakeWH(float w, float h)
SkSerialImageProc fImageProc