From 3c2ff97a162e05a173a6d86aa3ceb6a516a6efad Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Thu, 18 Apr 2019 02:16:06 +0200 Subject: [PATCH] fix: copy pixels in NativeImage::CreateFromBitmap (#17844) --- atom/common/api/atom_api_native_image.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atom/common/api/atom_api_native_image.cc b/atom/common/api/atom_api_native_image.cc index e202e174d9a0..27ee37682825 100644 --- a/atom/common/api/atom_api_native_image.cc +++ b/atom/common/api/atom_api_native_image.cc @@ -568,7 +568,7 @@ mate::Handle 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));