65 for (
int i = 0;
i < 2;
i++) {
69 s.setScale(1.5f, 1.5f);
70 s.postTranslate(2, 2);
89 paint.setShader(
nullptr);
111 using INHERITED =
GM;
124 if (
auto ctx = canvas->recordingContext()) {
125 bitmapH = ctx->priv().caps()->maxTextureSize() + 1;
128 uint8_t* pixels =
new uint8_t[bitmapH];
129 for(
int i = 0;
i < bitmapH; ++
i) {
130 pixels[
i] =
i & 0xff;
137 paint.setAntiAlias(
true);
138 canvas->drawCircle(50, 50, 50,
paint);
144DEF_GM(
return new BitmapShaderGM; )
constexpr SkColor SK_ColorTRANSPARENT
constexpr SkColor SK_ColorGRAY
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
void allocPixels(const SkImageInfo &info, size_t rowBytes)
sk_sp< SkImage > asImage() const
void allocN32Pixels(int width, int height, bool isOpaque=false)
void eraseColor(SkColor4f) const
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
void setColor(SkColor color)
void onOnceBeforeDraw() override
SkISize getISize() override
void onDraw(SkCanvas *canvas) override
SkString getName() const override
GM(SkColor backgroundColor=SK_ColorWHITE)
DEF_GM(return F(C(clipbox), 0.0f, 0.0f, {})) DEF_GM(return F(C(clipbox)
DEF_SIMPLE_GM(hugebitmapshader, canvas, 100, 100)
static sk_sp< SkImage > draw_bm()
SkSamplingOptions(SkFilterMode::kLinear))
static sk_sp< SkImage > draw_mask()
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo MakeA8(int width, int height)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)