37 float colorMatrix[20] = {
53 paint.setColorFilter(
nullptr);
60 paint.setMaskFilter(
nullptr);
72 for (
int x = 0;
x < bm.
width(); ++
x) {
80 paint.setColor4f({ 0, 1, 0, 0.5f });
82 canvas->translate(8, 8);
85 canvas->translate(72, 0);
87 canvas->drawRect({ 0, 0, 64, 64 },
paint);
90#if defined(SK_SUPPORT_LEGACY_ALPHA_BITMAP_AS_COVERAGE)
95DEF_SIMPLE_GM(alpha_bitmap_is_coverage_ANDROID, canvas, 128, 128) {
106 maskCanvas.drawRoundRect({0, 0, 128, 128}, 16, 16, maskPaint);
112 SkCanvas offscreenCanvas(offscreenBitmap);
124 canvas->drawImage(offscreenBitmap.
asImage(), 0, 0);
@ kNormal_SkBlurStyle
fuzzy inside and outside
constexpr SkColor SK_ColorCYAN
constexpr SkColor SK_ColorGRAY
constexpr SkColor SK_ColorWHITE
static SkBitmap make_alpha_image(int w, int h)
DEF_SIMPLE_GM(alpha_image, canvas, 256, 256)
static sk_sp< SkColorFilter > make_color_filter()
void allocPixels(const SkImageInfo &info, size_t rowBytes)
void eraseARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b) const
sk_sp< SkImage > asImage() const
uint8_t * getAddr8(int x, int y) const
void allocN32Pixels(int width, int height, bool isOpaque=false)
static sk_sp< SkColorFilter > Matrix(const SkColorMatrix &)
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
static sk_sp< SkMaskFilter > MakeBlur(SkBlurStyle style, SkScalar sigma, bool respectCTM=true)
void setColor(SkColor color)
void setAntiAlias(bool aa)
void setBlendMode(SkBlendMode mode)
sk_sp< const SkImage > image
SK_API sk_sp< SkShader > Color(SkColor)
static SkImageInfo MakeA8(int width, int height)