42 "half4 main(float2 xy) { return c; }"))
48 "half4 main(float2 xy) { return c; }"))
53 const SkPoint pts[] = {{0, 0}, {40, 40}};
60 "half4 main(half4 color) { return c; }"))
66 "half4 main(half4 color) { return c; }"))
74 "half4 main(half4 color) { return s.eval(float2(0)); }"))
95 if (!canvas->getSurface()) {
99 *errorMsg =
"Not supported in recording/DDL mode";
114 canvas->translate(5, 5);
121 paint.setColor(paintColor);
122 paint.setShader(shader);
123 paint.setColorFilter(colorFilter);
124 canvas->drawRect({0, 0, 40, 40},
paint);
125 canvas->translate(50, 0);
128 auto nextRow = [&]() {
130 canvas->translate(0, 50);
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
void allocPixels(const SkImageInfo &info, size_t rowBytes)
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
void eraseColor(SkColor4f) const
sk_sp< SkColorFilter > makeWithWorkingColorSpace(sk_sp< SkColorSpace >) const
static sk_sp< SkColorFilter > Blend(const SkColor4f &c, sk_sp< SkColorSpace >, SkBlendMode mode)
static sk_sp< SkColorSpace > MakeSRGB()
static sk_sp< SkColorSpace > MakeSRGBLinear()
static sk_sp< SkData > MakeWithCopy(const void *data, size_t length)
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)
sk_sp< SkShader > makeShader(sk_sp< const SkData > uniforms, sk_sp< SkShader > children[], size_t childCount, const SkMatrix *localMatrix=nullptr) const
static Result MakeForColorFilter(SkString sksl, const Options &)
static Result MakeForShader(SkString sksl, const Options &)
sk_sp< SkColorFilter > makeColorFilter(sk_sp< const SkData > uniforms) const
sk_sp< SkShader > makeWithWorkingColorSpace(sk_sp< SkColorSpace >) const
constexpr SkColor4f kGreen
constexpr SkColor4f kWhite
constexpr SkColor4f kBlack
PODArray< SkColor > colors
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static SkImageInfo MakeA8(int width, int height)
sk_sp< SkRuntimeEffect > effect
static sk_sp< SkColorFilter > mode_cf(SkColor4f color)
static sk_sp< SkColorFilter > raw_cf(SkColor4f color)
static sk_sp< SkColorFilter > spin(sk_sp< SkColorFilter > cf)
static sk_sp< SkShader > linear(sk_sp< SkShader > shader)
static sk_sp< SkShader > paint_color_shader()
static sk_sp< SkColorFilter > indirect_cf(SkColor4f color)
static sk_sp< SkShader > managed_shader(SkColor4f color)
static sk_sp< SkColorFilter > managed_cf(SkColor4f color)
static sk_sp< SkShader > gradient_shader()
DEF_SIMPLE_GM_CAN_FAIL(workingspace, canvas, errorMsg, 200, 350)
static sk_sp< SkShader > color_shader(SkColor4f color)
static sk_sp< SkShader > raw_shader(SkColor4f color)