fix copy_to conditional
This commit is contained in:
parent
90a7b5ebce
commit
a19ddfc578
1 changed files with 3 additions and 4 deletions
|
@ -172,10 +172,9 @@ void Clipboard::WriteImage(const gfx::Image& image, mate::Arguments* args) {
|
|||
SkBitmap orig = image.AsBitmap();
|
||||
SkBitmap bmp;
|
||||
|
||||
if (bmp.tryAllocPixels(orig.info())) {
|
||||
orig.readPixels(bmp.info(), bmp.getPixels(), bmp.rowBytes(), 0, 0);
|
||||
} else {
|
||||
writer.WriteImage(orig);
|
||||
if (bmp.tryAllocPixels(orig.info()) &&
|
||||
orig.readPixels(bmp.info(), bmp.getPixels(), bmp.rowBytes(), 0, 0)) {
|
||||
writer.WriteImage(bmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue