switch to simplified version of copy_to

This commit is contained in:
Shelley Vohr 2018-04-16 08:47:34 -04:00
parent 43a9092c16
commit 90a7b5ebce
No known key found for this signature in database
GPG key ID: F13993A75599653C

View file

@ -14,10 +14,6 @@
#include "atom/common/node_includes.h"
namespace sk_tool_utils {
bool copy_to(SkBitmap* dst, SkColorType dstCT, const SkBitmap& src);
}
namespace atom {
namespace api {
@ -176,8 +172,8 @@ void Clipboard::WriteImage(const gfx::Image& image, mate::Arguments* args) {
SkBitmap orig = image.AsBitmap();
SkBitmap bmp;
if (sk_tool_utils::copy_to(&bmp, orig.colorType(), orig)) {
writer.WriteImage(bmp);
if (bmp.tryAllocPixels(orig.info())) {
orig.readPixels(bmp.info(), bmp.getPixels(), bmp.rowBytes(), 0, 0);
} else {
writer.WriteImage(orig);
}