mirror of
https://github.com/electron/electron.git
synced 2026-01-27 08:18:28 -05:00
fix: copy pixels in NativeImage::CreateFromBitmap (#17844)
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user