switch to simplified version of copy_to
This commit is contained in:
parent
43a9092c16
commit
90a7b5ebce
1 changed files with 2 additions and 6 deletions
|
@ -14,10 +14,6 @@
|
||||||
|
|
||||||
#include "atom/common/node_includes.h"
|
#include "atom/common/node_includes.h"
|
||||||
|
|
||||||
namespace sk_tool_utils {
|
|
||||||
bool copy_to(SkBitmap* dst, SkColorType dstCT, const SkBitmap& src);
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
namespace api {
|
namespace api {
|
||||||
|
@ -176,8 +172,8 @@ void Clipboard::WriteImage(const gfx::Image& image, mate::Arguments* args) {
|
||||||
SkBitmap orig = image.AsBitmap();
|
SkBitmap orig = image.AsBitmap();
|
||||||
SkBitmap bmp;
|
SkBitmap bmp;
|
||||||
|
|
||||||
if (sk_tool_utils::copy_to(&bmp, orig.colorType(), orig)) {
|
if (bmp.tryAllocPixels(orig.info())) {
|
||||||
writer.WriteImage(bmp);
|
orig.readPixels(bmp.info(), bmp.getPixels(), bmp.rowBytes(), 0, 0);
|
||||||
} else {
|
} else {
|
||||||
writer.WriteImage(orig);
|
writer.WriteImage(orig);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue