From 9d72bd4de4a36ef360a3cccf74c2a849a245f12b Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Sun, 28 Oct 2018 11:11:20 +1100 Subject: [PATCH] chore: update CreateSkBitmapFromHICON usage for new API (no pointer) refs: https://chromium-review.googlesource.com/c/chromium/src/+/1234372 --- atom/common/api/atom_api_native_image.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/atom/common/api/atom_api_native_image.cc b/atom/common/api/atom_api_native_image.cc index d7293bf9b79b..38a937405564 100644 --- a/atom/common/api/atom_api_native_image.cc +++ b/atom/common/api/atom_api_native_image.cc @@ -195,11 +195,11 @@ base::win::ScopedHICON ReadICOFromPath(int size, const base::FilePath& path) { bool ReadImageSkiaFromICO(gfx::ImageSkia* image, HICON icon) { // Convert the icon from the Windows specific HICON to gfx::ImageSkia. - std::unique_ptr bitmap(IconUtil::CreateSkBitmapFromHICON(icon)); - if (!bitmap) + SkBitmap bitmap = IconUtil::CreateSkBitmapFromHICON(icon); + if (bitmap.isNull()) return false; - image->AddRepresentation(gfx::ImageSkiaRep(*bitmap, 1.0f)); + image->AddRepresentation(gfx::ImageSkiaRep(bitmap, 1.0f)); return true; } #endif