void draw(SkCanvas* canvas) {
canvas->clear(SK_ColorBLUE);
SkPaint paint;
canvas->drawCircle(15, 10, 10, paint);
SkImageInfo info = SkImageInfo::Make(30, 30, kBGRA_8888_SkColorType, kPremul_SkAlphaType);
sk_sp<SkData> data(SkData::MakeUninitialized(info.minRowBytes() * info.height()));
//sk_bzero(data->writable_data(), info.minRowBytes() * info.height());
canvas->readPixels(info, data->writable_data(), info.minRowBytes(), 0, 0);
sk_sp<SkImage> image = SkImage::MakeRasterData(info, data, info.minRowBytes());
canvas->drawImage(image, 10, 30);
}
Now , canvas can have multiple shapes . how i tell skia that i have to create shader for selected shape only ?
seems form the code , canvas->readPixels will read all shapes on the canvas.
I am new to skia and would appreciate little help to going with my leaning.
Thanks,