fix: copy pixels in AddImageSkiaRepFromBuffer (#17843) (#17861)

This commit is contained in:
Milan Burda
2019-04-18 17:54:05 +02:00
committed by Shelley Vohr
parent 7897913161
commit 276ebca24c

View File

@@ -135,7 +135,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;