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

Side by Side Diff: third_party/WebKit/Source/core/layout/shapes/Shape.cpp

Issue 2494333002: Replace wrapUnique(new T(args)) by makeUnique<T>(args) in Blink (Closed)
Patch Set: Drop redundant WTF:: Created 4 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "platform/graphics/ImageBuffer.h" 46 #include "platform/graphics/ImageBuffer.h"
47 #include "wtf/MathExtras.h" 47 #include "wtf/MathExtras.h"
48 #include "wtf/PtrUtil.h" 48 #include "wtf/PtrUtil.h"
49 #include "wtf/typed_arrays/ArrayBufferContents.h" 49 #include "wtf/typed_arrays/ArrayBufferContents.h"
50 #include <memory> 50 #include <memory>
51 51
52 namespace blink { 52 namespace blink {
53 53
54 static std::unique_ptr<Shape> createInsetShape(const FloatRoundedRect& bounds) { 54 static std::unique_ptr<Shape> createInsetShape(const FloatRoundedRect& bounds) {
55 ASSERT(bounds.rect().width() >= 0 && bounds.rect().height() >= 0); 55 ASSERT(bounds.rect().width() >= 0 && bounds.rect().height() >= 0);
56 return wrapUnique(new BoxShape(bounds)); 56 return makeUnique<BoxShape>(bounds);
57 } 57 }
58 58
59 static std::unique_ptr<Shape> createCircleShape(const FloatPoint& center, 59 static std::unique_ptr<Shape> createCircleShape(const FloatPoint& center,
60 float radius) { 60 float radius) {
61 ASSERT(radius >= 0); 61 ASSERT(radius >= 0);
62 return wrapUnique( 62 return wrapUnique(
63 new RectangleShape(FloatRect(center.x() - radius, center.y() - radius, 63 new RectangleShape(FloatRect(center.x() - radius, center.y() - radius,
64 radius * 2, radius * 2), 64 radius * 2, radius * 2),
65 FloatSize(radius, radius))); 65 FloatSize(radius, radius)));
66 } 66 }
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 206
207 shape->m_writingMode = writingMode; 207 shape->m_writingMode = writingMode;
208 shape->m_margin = margin; 208 shape->m_margin = margin;
209 209
210 return shape; 210 return shape;
211 } 211 }
212 212
213 std::unique_ptr<Shape> Shape::createEmptyRasterShape(WritingMode writingMode, 213 std::unique_ptr<Shape> Shape::createEmptyRasterShape(WritingMode writingMode,
214 float margin) { 214 float margin) {
215 std::unique_ptr<RasterShapeIntervals> intervals = 215 std::unique_ptr<RasterShapeIntervals> intervals =
216 wrapUnique(new RasterShapeIntervals(0, 0)); 216 makeUnique<RasterShapeIntervals>(0, 0);
217 std::unique_ptr<RasterShape> rasterShape = 217 std::unique_ptr<RasterShape> rasterShape =
218 wrapUnique(new RasterShape(std::move(intervals), IntSize())); 218 wrapUnique(new RasterShape(std::move(intervals), IntSize()));
219 rasterShape->m_writingMode = writingMode; 219 rasterShape->m_writingMode = writingMode;
220 rasterShape->m_margin = margin; 220 rasterShape->m_margin = margin;
221 return std::move(rasterShape); 221 return std::move(rasterShape);
222 } 222 }
223 223
224 std::unique_ptr<Shape> Shape::createRasterShape(Image* image, 224 std::unique_ptr<Shape> Shape::createRasterShape(Image* image,
225 float threshold, 225 float threshold,
226 const LayoutRect& imageR, 226 const LayoutRect& imageR,
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 FloatRect rect(0, 0, roundedRect.rect().width(), roundedRect.rect().height()); 296 FloatRect rect(0, 0, roundedRect.rect().width(), roundedRect.rect().height());
297 FloatRoundedRect bounds(rect, roundedRect.getRadii()); 297 FloatRoundedRect bounds(rect, roundedRect.getRadii());
298 std::unique_ptr<Shape> shape = createInsetShape(bounds); 298 std::unique_ptr<Shape> shape = createInsetShape(bounds);
299 shape->m_writingMode = writingMode; 299 shape->m_writingMode = writingMode;
300 shape->m_margin = margin; 300 shape->m_margin = margin;
301 301
302 return shape; 302 return shape;
303 } 303 }
304 304
305 } // namespace blink 305 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698