16 SkSurfaces::Raster(SkImageInfo::MakeN32Premul(w,
h));
17 SkCanvas* canvas =
surface->getCanvas();
19 p0.setStyle(SkPaint::kFill_Style);
20 p0.setColor(SK_ColorGREEN);
21 p1.setStyle(SkPaint::kFill_Style);
22 p1.setColor(SK_ColorBLUE);
24 for (
int y = 0;
y < w;
y += checker_size) {
25 for (
int x = 0;
x <
h;
x += checker_size) {
26 SkPaint& cellp = ((
x +
y) & 1) == 0 ? p0 :
p1;
27 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.