fix: copy pixels in AddImageSkiaRepFromBuffer (#17843)

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

View file

@ -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;