fix: copy pixels in NativeImage::CreateFromBitmap (#17844)
This commit is contained in:
parent
f1ee35e281
commit
3c2ff97a16
1 changed files with 1 additions and 1 deletions
|
@ -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));
|
||||||
|
|
Loading…
Reference in a new issue