19static DEFINE_bool2(verbose, v,
false,
"log verbose linear gradient description");
42 for (
int i = 0; i <
count; i++) {
50 std::sort(
pos->begin(),
pos->end());
52 (*pos)[
count - 1] = 1;
63 for (
int i = 0; i < 9; ++i) {
70 const std::vector<SkColor>& colors,
71 const std::vector<SkScalar>&
pos,
80 SkDebugf(
"--- fuzzLinearGradient ---\n");
81 SkDebugf(
" pts:\t\t[ (%.9g %.9g) (%.9g %.9g) ]\n",
82 pts[0].
x(), pts[0].
y(), pts[1].
x(), pts[1].
y());
84 for (
auto color : colors) {
107 fuzz->
next(&pts[0].fX, &pts[0].fY, &pts[1].fX, &pts[1].fY);
108 bool useLocalMatrix, useGlobalMatrix;
109 fuzz->
next(&useLocalMatrix, &useGlobalMatrix);
111 std::vector<SkColor> colors;
112 std::vector<SkScalar>
pos;
121 if (useLocalMatrix) {
128 if (useGlobalMatrix) {
137 surface->getCanvas()->drawPaint(p);
145 bool useLocalMatrix, useGlobalMatrix;
146 fuzz->
next(&radius, &useLocalMatrix, &useGlobalMatrix);
149 std::vector<SkColor> colors;
150 std::vector<SkScalar>
pos;
159 if (useLocalMatrix) {
166 if (useGlobalMatrix) {
173 surface->getCanvas()->drawPaint(p);
183 bool useLocalMatrix, useGlobalMatrix;
184 fuzz->
next(&startRadius, &endRadius, &useLocalMatrix, &useGlobalMatrix);
186 std::vector<SkColor> colors;
187 std::vector<SkScalar>
pos;
196 if (useLocalMatrix) {
200 end, endRadius, colors.data(),
pos.data(), colors.size(), mode,
204 if (useGlobalMatrix) {
211 surface->getCanvas()->drawPaint(p);
217 bool useLocalMatrix, useGlobalMatrix;
218 fuzz->
next(&cx, &cy, &useLocalMatrix, &useGlobalMatrix);
220 std::vector<SkColor> colors;
221 std::vector<SkScalar>
pos;
226 if (useLocalMatrix) {
233 pos.data(), colors.size(),
flags, &m));
236 pos.data(), colors.size()));
240 if (useGlobalMatrix) {
247 surface->getCanvas()->drawPaint(p);
265 SkDEBUGF(
"TwoPointConicalGradient\n");
#define DEFINE_bool2(name, shortName, defaultValue, helpString)
static void logLinearGradient(const SkPoint pts[2], const std::vector< SkColor > &colors, const std::vector< SkScalar > &pos, SkTileMode mode, uint32_t flags, const SkMatrix *localMatrix, const SkMatrix *globalMatrix)
void fuzzLinearGradient(Fuzz *fuzz)
void initGradientParams(Fuzz *fuzz, std::vector< SkColor > *colors, std::vector< SkScalar > *pos, SkTileMode *mode)
void makeMatrix(Fuzz *fuzz, SkMatrix *m)
void fuzzTwoPointConicalGradient(Fuzz *fuzz)
void fuzzRadialGradient(Fuzz *fuzz)
void fuzzSweepGradient(Fuzz *fuzz)
static void logOptionalMatrix(const char *label, const SkMatrix *m)
#define DEF_FUZZ(name, f)
static constexpr const char * SkTileModeToStr(SkTileMode tm)
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static SkScalar center(float pos0, float pos1)
void nextRange(T *, Min, Max)
void nextN(T *ptr, int n)
void drawPaint(const SkPaint &paint)
void setMatrix(const SkM44 &matrix)
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)
T * init(Args &&... args)
const T * getMaybeNull() const
FlutterSemanticsFlag flags
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static SkImageInfo MakeN32Premul(int width, int height)