Skip to content

Commit

Permalink
Avoid capturing raw pointers to the SkPicture/DisplayList used by the…
Browse files Browse the repository at this point in the history
… RasterizeToImage draw callback (flutter#27123)
  • Loading branch information
jason-simmons committed Jul 1, 2021
1 parent d552b00 commit 56b2627
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/ui/painting/picture.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Dart_Handle Picture::toImage(uint32_t width,
Dart_Handle raw_image_callback) {
if (display_list_) {
return RasterizeToImage(
[display_list = display_list_.get()](SkCanvas* canvas) {
[display_list = display_list_](SkCanvas* canvas) {
display_list->RenderTo(canvas);
},
width, height, raw_image_callback);
Expand Down Expand Up @@ -91,10 +91,8 @@ Dart_Handle Picture::RasterizeToImage(sk_sp<SkPicture> picture,
uint32_t height,
Dart_Handle raw_image_callback) {
return RasterizeToImage(
[sk_picture = picture.get()](SkCanvas* canvas) {
canvas->drawPicture(sk_picture);
},
width, height, raw_image_callback);
[picture](SkCanvas* canvas) { canvas->drawPicture(picture); }, width,
height, raw_image_callback);
}

Dart_Handle Picture::RasterizeToImage(
Expand Down

0 comments on commit 56b2627

Please sign in to comment.