14 SkSurfaces::Raster(SkImageInfo::MakeN32Premul(w,
h));
15 SkCanvas* canvas =
surface->getCanvas();
17 p0.setStyle(SkPaint::kFill_Style);
18 p0.setColor(SK_ColorGREEN);
19 p1.setStyle(SkPaint::kFill_Style);
20 p1.setColor(SK_ColorBLUE);
22 for (
int y = 0;
y < w;
y += checker_size) {
23 for (
int x = 0;
x <
h;
x += checker_size) {
24 SkPaint& cellp = ((
x +
y) & 1) == 0 ? p0 : p1;
25 canvas->drawRect(SkRect::MakeXYWH(
x,
y, checker_size, checker_size),
virtual void DrawImageRect(const sk_sp< DlImage > &image, const DlRect &src, const DlRect &dst, DlImageSampling sampling, const DlPaint *paint=nullptr, DlSrcRectConstraint constraint=DlSrcRectConstraint::kFast)=0
void Paint(PaintContext &context, const DlRect &bounds, bool freeze, const DlImageSampling sampling) override
MockTexture(int64_t textureId, const sk_sp< DlImage > &texture=nullptr)
static sk_sp< DlImage > MakeTestTexture(int w, int h, int checker_size)
constexpr TRect< T > Expand(T left, T top, T right, T bottom) const
Returns a rectangle with expanded edges. Negative expansion results in shrinking.