Skip to content

Commit

Permalink
fix: copy pixels in AddImageSkiaRepFromBuffer (#17843)
Browse files Browse the repository at this point in the history
  • Loading branch information
miniak authored and zcbenz committed Apr 18, 2019
1 parent 3c2ff97 commit 5e7c828
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 @@ -136,7 +136,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 5e7c828

Please sign in to comment.