62 for (
auto shProc : shaders) {
63 paint.setShader(shProc());
64 for (
auto cfProc : filters) {
65 paint.setColorFilter(cfProc());
73 canvas->translate(10, 10);
88 surface->getCanvas()->drawPaint(bg);
91 canvas->translate(0, 120);
98 canvas->translate(10, 10);
101 auto spin = srgb->makeColorSpin();
107 { 0.5, 0.5, 0.5, 1 },
113 for (
const auto& c4 :
colors) {
121 for (
const auto&
s : shaders) {
123 canvas->drawRect(r,
paint);
124 canvas->translate(r.
width() * 6 / 5, 0);
127 canvas->translate(0, r.
height() * 6 / 5);
132 canvas->translate(10, 10);
135 auto spin = srgb->makeColorSpin();
141 { 0.5, 0.5, 0.5, 1 },
148 for (
const auto& c4 :
colors) {
158 for (
const auto&
f : filters) {
160 canvas->drawRect(r,
paint);
161 canvas->translate(r.
width() * 6 / 5, 0);
164 canvas->translate(0, r.
height() * 6 / 5);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kSrcATop
r = s*da + d*(1-sa)
constexpr SkColor SK_ColorWHITE
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
static sk_sp< SkColorFilter > Blend(const SkColor4f &c, sk_sp< SkColorSpace >, SkBlendMode mode)
static sk_sp< SkColorFilter > Matrix(const SkColorMatrix &)
void setSaturation(float sat)
void setScale(float rScale, float gScale, float bScale, float aScale=1.0f)
static sk_sp< SkColorSpace > MakeSRGB()
void setColor(SkColor color)
DEF_SIMPLE_GM(color4f, canvas, 1024, 260)
static sk_sp< SkShader > make_opaque_color()
static sk_sp< SkShader > make_alpha_color()
static sk_sp< SkColorFilter > make_cf_null()
static sk_sp< SkColorFilter > make_cf0()
static sk_sp< SkColorFilter > make_cf1()
static void draw_into_canvas(SkCanvas *canvas)
static sk_sp< SkColorFilter > make_cf2()
PODArray< SkColor > colors
SK_API sk_sp< SkShader > Color(SkColor)
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
constexpr float height() const
constexpr float width() const
static constexpr SkRect MakeWH(float w, float h)
static sk_sp< SkColorFilter > spin(sk_sp< SkColorFilter > cf)