// create a new SkPaint object sk_sppaint = sk_sp (new SkPaint()); // call a method on the SkPaint object paint->setColor(SK_ColorRED);
// create a new SkBitmap object sk_spIn this example, sk_make_sp is used to create a new SkBitmap object. The code then allocates pixels for the bitmap and sets the image info to a 100x100 N32 premultiplied format. The SkBitmap object is automatically deleted when the sk_sp object goes out of scope. Overall, sk_sp is a useful smart pointer class in the Skia Library for managing memory allocation and deallocation for objects in C++. It helps to prevent memory leaks and simplifies the process of deleting objects when they are no longer needed.bitmap = sk_make_sp (); // call a method on the SkBitmap object bitmap->allocPixels(SkImageInfo::MakeN32Premul(100, 100));