fix: copy pixels in AddImageSkiaRepFromBuffer (#17843)
This commit is contained in:
parent
3c2ff97a16
commit
5e7c828c9e
1 changed files with 1 additions and 1 deletions
|
@ -136,7 +136,7 @@ bool AddImageSkiaRepFromBuffer(gfx::ImageSkia* image,
|
|||
|
||||
SkBitmap bitmap;
|
||||
bitmap.allocN32Pixels(width, height, false);
|
||||
bitmap.setPixels(const_cast<void*>(reinterpret_cast<const void*>(data)));
|
||||
bitmap.writePixels({info, data, bitmap.rowBytes()});
|
||||
|
||||
image->AddRepresentation(gfx::ImageSkiaRep(bitmap, scale_factor));
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue