sk_sp<SkSurface> surface_base = SkSurface::MakeRasterN32Premul(3000, 3000);
sk_sp<SkSurface> surface_front = SkSurface::MakeRasterN32Premul(3000, 3000);
SkCanvas *canvas0 = surface_base->getCanvas();
SkCanvas *canvas1 = surface_front->getCanvas();
//set front transparent color
canvas1->clear(SK_ColorTRANSPARENT);
//draw some to canvas0 and canvas1
...
//merge front to base
SkImageInfo info2 = SkImageInfo::MakeN32Premul(500, 500);
SkPixmap skPixmap;
surface_base->peekPixels(&skPixmap);
surface_front->readPixels(info2, skPixmap.addr(), skPixmap.rowBytes(), 100, 100); //got black background color.