diff --git a/atom/common/api/atom_api_clipboard.cc b/atom/common/api/atom_api_clipboard.cc index 430d8629379a..f88df67cf0b5 100644 --- a/atom/common/api/atom_api_clipboard.cc +++ b/atom/common/api/atom_api_clipboard.cc @@ -7,6 +7,7 @@ #include "atom/common/native_mate_converters/image_converter.h" #include "atom/common/native_mate_converters/string16_converter.h" #include "base/strings/utf_string_conversions.h" +#include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/clipboard/scoped_clipboard_writer.h" #include "atom/common/node_includes.h" @@ -166,7 +167,12 @@ gfx::Image Clipboard::ReadImage(mate::Arguments* args) { void Clipboard::WriteImage(const gfx::Image& image, mate::Arguments* args) { ui::ScopedClipboardWriter writer(GetClipboardType(args)); - writer.WriteImage(image.AsBitmap()); + SkBitmap bmp; + if (image.AsBitmap().deepCopyTo(&bmp)) { + writer.WriteImage(bmp); + } else { + writer.WriteImage(image.AsBitmap()); + } } #if !defined(OS_MACOSX)