Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: ui/gfx/icon_util.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/icon_util.h ('k') | ui/gfx/icon_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/icon_util.cc
diff --git a/ui/gfx/icon_util.cc b/ui/gfx/icon_util.cc
index 092ab68c14530dc820d9fdc62d01e5ec845600bd..8276a20ce99e29261807471b38010b31d33a2cea 100644
--- a/ui/gfx/icon_util.cc
+++ b/ui/gfx/icon_util.cc
@@ -4,11 +4,12 @@
#include "ui/gfx/icon_util.h"
+#include <memory>
+
#include "base/files/file_util.h"
#include "base/files/important_file_writer.h"
#include "base/logging.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "base/trace_event/trace_event.h"
#include "base/win/resource_util.h"
#include "base/win/scoped_gdi_object.h"
@@ -204,7 +205,7 @@ base::win::ScopedHICON IconUtil::CreateHICONFromSkBitmap(
PixelsHaveAlpha(static_cast<const uint32_t*>(bitmap.getPixels()),
bitmap.width() * bitmap.height());
- scoped_ptr<uint8_t[]> mask_bits;
+ std::unique_ptr<uint8_t[]> mask_bits;
if (!bitmap_has_alpha_channel) {
// Bytes per line with paddings to make it word alignment.
size_t bytes_per_line = (bitmap.width() + 0xF) / 16 * 2;
@@ -246,7 +247,7 @@ SkBitmap* IconUtil::CreateSkBitmapFromHICON(HICON icon, const gfx::Size& s) {
}
// static
-scoped_ptr<gfx::ImageFamily> IconUtil::CreateImageFamilyFromIconResource(
+std::unique_ptr<gfx::ImageFamily> IconUtil::CreateImageFamilyFromIconResource(
HMODULE module,
int resource_id) {
// Read the resource directly so we can get the icon image sizes. This data
@@ -262,7 +263,7 @@ scoped_ptr<gfx::ImageFamily> IconUtil::CreateImageFamilyFromIconResource(
const GRPICONDIR* icon_dir =
reinterpret_cast<const GRPICONDIR*>(icon_dir_data);
- scoped_ptr<gfx::ImageFamily> result(new gfx::ImageFamily);
+ std::unique_ptr<gfx::ImageFamily> result(new gfx::ImageFamily);
for (size_t i = 0; i < icon_dir->idCount; ++i) {
const GRPICONDIRENTRY* entry = &icon_dir->idEntries[i];
if (entry->bWidth != 0 || entry->bHeight != 0) {
@@ -274,7 +275,7 @@ scoped_ptr<gfx::ImageFamily> IconUtil::CreateImageFamilyFromIconResource(
base::win::ScopedHICON icon_handle(static_cast<HICON>(LoadImage(
module, MAKEINTRESOURCE(resource_id), IMAGE_ICON, entry->bWidth,
entry->bHeight, LR_DEFAULTCOLOR | LR_DEFAULTSIZE)));
- scoped_ptr<SkBitmap> bitmap(
+ std::unique_ptr<SkBitmap> bitmap(
IconUtil::CreateSkBitmapFromHICON(icon_handle.get()));
result->Add(gfx::Image::CreateFrom1xBitmap(*bitmap));
} else {
@@ -412,7 +413,7 @@ SkBitmap IconUtil::CreateSkBitmapFromHICONHelper(HICON icon,
// Capture boolean opacity. We may not use it if we find out the bitmap has
// an alpha channel.
- scoped_ptr<bool[]> opaque(new bool[num_pixels]);
+ std::unique_ptr<bool[]> opaque(new bool[num_pixels]);
for (size_t i = 0; i < num_pixels; ++i)
opaque[i] = !bits[i];
« no previous file with comments | « ui/gfx/icon_util.h ('k') | ui/gfx/icon_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698