Skip to content

Commit

Permalink
fix: copy pixels in NativeImage::CreateFromBitmap (electron#17844)
Browse files Browse the repository at this point in the history
  • Loading branch information
miniak authored and kiku-jw committed May 16, 2019
1 parent e5db435 commit 4bff4e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion atom/common/api/atom_api_native_image.cc
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ mate::Handle<NativeImage> NativeImage::CreateFromBitmap(

SkBitmap bitmap;
bitmap.allocN32Pixels(width, height, false);
bitmap.setPixels(node::Buffer::Data(buffer));
bitmap.writePixels({info, node::Buffer::Data(buffer), bitmap.rowBytes()});

gfx::ImageSkia image_skia;
image_skia.AddRepresentation(gfx::ImageSkiaRep(bitmap, scale_factor));
Expand Down

0 comments on commit 4bff4e8

Please sign in to comment.