Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit efd85b7

Browse files
[skwasm] Reify the SkPicture pointer as the right type. (#51991)
When recreating this `unique_ptr`, we need to ensure it matches the type in `Surface::renderPictures` which is released. See here: ``` std::unique_ptr<sk_sp<SkPicture>[]> picturePointers = std::make_unique<sk_sp<SkPicture>[]>(count); for (int i = 0; i < count; i++) { picturePointers[i] = sk_ref_sp(pictures[i]); } // Releasing picturePointers here and will recreate the unique_ptr on the // other thread See surface_renderPicturesOnWorker skwasm_dispatchRenderPictures(_thread, this, picturePointers.release(), count, callbackId); ```
1 parent bd171e7 commit efd85b7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/web_ui/skwasm/surface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ SKWASM_EXPORT void surface_renderPicturesOnWorker(Surface* surface,
259259
uint32_t callbackId,
260260
double rasterStart) {
261261
// This will release the pictures when they leave scope.
262-
std::unique_ptr<sk_sp<SkPicture>> picturesPointer =
263-
std::unique_ptr<sk_sp<SkPicture>>(pictures);
262+
std::unique_ptr<sk_sp<SkPicture>[]> picturesPointer =
263+
std::unique_ptr<sk_sp<SkPicture>[]>(pictures);
264264
surface->renderPicturesOnWorker(pictures, pictureCount, callbackId,
265265
rasterStart);
266266
}

0 commit comments

Comments
 (0)