From 6cac69238cef158d1bfbbb86af9cf3ca8bc892bb Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 23 Jun 2014 12:59:10 +0800 Subject: [PATCH] mac: Convert from ImageSkia to NSImage to reserve DPI info. --- atom/browser/ui/tray_icon_cocoa.mm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/atom/browser/ui/tray_icon_cocoa.mm b/atom/browser/ui/tray_icon_cocoa.mm index 03461634378c..ef456897e91f 100644 --- a/atom/browser/ui/tray_icon_cocoa.mm +++ b/atom/browser/ui/tray_icon_cocoa.mm @@ -6,7 +6,7 @@ #include "atom/browser/ui/cocoa/atom_menu_controller.h" #include "base/strings/sys_string_conversions.h" -#include "skia/ext/skia_utils_mac.h" +#include "ui/gfx/image/image.h" @interface StatusItemController : NSObject { atom::TrayIconCocoa* trayIcon_; // weak @@ -50,17 +50,17 @@ TrayIconCocoa::~TrayIconCocoa() { void TrayIconCocoa::SetImage(const gfx::ImageSkia& image) { if (!image.isNull()) { - NSImage* ns_image = gfx::SkBitmapToNSImage(*image.bitmap()); - if (ns_image) - [item_ setImage:ns_image]; + gfx::Image neutral(image); + if (!neutral.IsEmpty()) + [item_ setImage:neutral.ToNSImage()]; } } void TrayIconCocoa::SetPressedImage(const gfx::ImageSkia& image) { if (!image.isNull()) { - NSImage* ns_image = gfx::SkBitmapToNSImage(*image.bitmap()); - if (ns_image) - [item_ setAlternateImage:ns_image]; + gfx::Image neutral(image); + if (!neutral.IsEmpty()) + [item_ setAlternateImage:neutral.ToNSImage()]; } }