fix: copy pixels in NativeImage::CreateFromBitmap (#17844)

This commit is contained in:
Milan Burda 2019-04-18 02:16:06 +02:00 committed by Cheng Zhao
parent f1ee35e281
commit 3c2ff97a16

View file

@ -568,7 +568,7 @@ mate::Handle<NativeImage> NativeImage::CreateFromBitmap(
SkBitmap bitmap; SkBitmap bitmap;
bitmap.allocN32Pixels(width, height, false); bitmap.allocN32Pixels(width, height, false);
bitmap.setPixels(node::Buffer::Data(buffer)); bitmap.writePixels({info, node::Buffer::Data(buffer), bitmap.rowBytes()});
gfx::ImageSkia image_skia; gfx::ImageSkia image_skia;
image_skia.AddRepresentation(gfx::ImageSkiaRep(bitmap, scale_factor)); image_skia.AddRepresentation(gfx::ImageSkiaRep(bitmap, scale_factor));