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

Side by Side Diff: ui/gfx/path_win.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 unified diff | Download patch
« no previous file with comments | « ui/gfx/mac/coordinate_conversion_unittest.mm ('k') | ui/gfx/path_x11.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gfx/path_win.h" 5 #include "ui/gfx/path_win.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include <memory>
8
8 #include "base/win/scoped_gdi_object.h" 9 #include "base/win/scoped_gdi_object.h"
9 #include "third_party/skia/include/core/SkRegion.h" 10 #include "third_party/skia/include/core/SkRegion.h"
10 #include "ui/gfx/path.h" 11 #include "ui/gfx/path.h"
11 12
12 namespace gfx { 13 namespace gfx {
13 14
14 HRGN CreateHRGNFromSkRegion(const SkRegion& region) { 15 HRGN CreateHRGNFromSkRegion(const SkRegion& region) {
15 base::win::ScopedRegion temp(::CreateRectRgn(0, 0, 0, 0)); 16 base::win::ScopedRegion temp(::CreateRectRgn(0, 0, 0, 0));
16 base::win::ScopedRegion result(::CreateRectRgn(0, 0, 0, 0)); 17 base::win::ScopedRegion result(::CreateRectRgn(0, 0, 0, 0));
17 18
18 for (SkRegion::Iterator i(region); !i.done(); i.next()) { 19 for (SkRegion::Iterator i(region); !i.done(); i.next()) {
19 const SkIRect& rect = i.rect(); 20 const SkIRect& rect = i.rect();
20 ::SetRectRgn(temp.get(), 21 ::SetRectRgn(temp.get(),
21 rect.left(), rect.top(), rect.right(), rect.bottom()); 22 rect.left(), rect.top(), rect.right(), rect.bottom());
22 ::CombineRgn(result.get(), result.get(), temp.get(), RGN_OR); 23 ::CombineRgn(result.get(), result.get(), temp.get(), RGN_OR);
23 } 24 }
24 25
25 return result.release(); 26 return result.release();
26 } 27 }
27 28
28 HRGN CreateHRGNFromSkPath(const SkPath& path) { 29 HRGN CreateHRGNFromSkPath(const SkPath& path) {
29 SkRegion clip_region; 30 SkRegion clip_region;
30 clip_region.setRect(path.getBounds().round()); 31 clip_region.setRect(path.getBounds().round());
31 SkRegion region; 32 SkRegion region;
32 region.setPath(path, clip_region); 33 region.setPath(path, clip_region);
33 return CreateHRGNFromSkRegion(region); 34 return CreateHRGNFromSkRegion(region);
34 } 35 }
35 36
36 } // namespace gfx 37 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/mac/coordinate_conversion_unittest.mm ('k') | ui/gfx/path_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698