fix copy_to conditional

This commit is contained in:
Shelley Vohr 2018-04-16 12:14:35 -04:00
parent 90a7b5ebce
commit a19ddfc578
No known key found for this signature in database
GPG key ID: F13993A75599653C

View file

@ -172,10 +172,9 @@ void Clipboard::WriteImage(const gfx::Image& image, mate::Arguments* args) {
SkBitmap orig = image.AsBitmap(); SkBitmap orig = image.AsBitmap();
SkBitmap bmp; SkBitmap bmp;
if (bmp.tryAllocPixels(orig.info())) { if (bmp.tryAllocPixels(orig.info()) &&
orig.readPixels(bmp.info(), bmp.getPixels(), bmp.rowBytes(), 0, 0); orig.readPixels(bmp.info(), bmp.getPixels(), bmp.rowBytes(), 0, 0)) {
} else { writer.WriteImage(bmp);
writer.WriteImage(orig);
} }
} }