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"
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue