Skip to content

Commit

Permalink
fix: copy pixels in AddImageSkiaRepFromBuffer (#17843) (#17862)
Browse files Browse the repository at this point in the history
  • Loading branch information
miniak authored and codebytere committed Apr 18, 2019
1 parent 4175e94 commit 2360f3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion atom/common/api/atom_api_native_image.cc
Expand Up @@ -137,7 +137,7 @@ bool AddImageSkiaRepFromBuffer(gfx::ImageSkia* image,

SkBitmap bitmap;
bitmap.allocN32Pixels(width, height, false);
bitmap.setPixels(const_cast<void*>(reinterpret_cast<const void*>(data)));
bitmap.writePixels({info, data, bitmap.rowBytes()});

image->AddRepresentation(gfx::ImageSkiaRep(bitmap, scale_factor));
return true;
Expand Down

0 comments on commit 2360f3e

Please sign in to comment.