use std::make_unique
Change-Id: I7c672ff6b8eb95ec8c1123a5bfdb202e1644f494
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259281
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
diff --git a/bench/TypefaceBench.cpp b/bench/TypefaceBench.cpp
index 6d9579d..6c1c5de 100644
--- a/bench/TypefaceBench.cpp
+++ b/bench/TypefaceBench.cpp
@@ -10,7 +10,6 @@
#include "bench/Benchmark.h"
#include "include/core/SkFont.h"
#include "include/core/SkTypeface.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkUtils.h"
#include "src/utils/SkUTF.h"
@@ -255,7 +254,7 @@
};
std::unique_ptr<Line> convertLine(int lineIndex) {
- std::unique_ptr<Line> result = skstd::make_unique<Line>();
+ std::unique_ptr<Line> result = std::make_unique<Line>();
const char* cursor = fText[lineIndex];
size_t len = strlen(cursor);
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 1fbe250..5aa583f 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -32,7 +32,6 @@
#include "src/codec/SkSwizzler.h"
#include "src/core/SkAutoMalloc.h"
#include "src/core/SkAutoPixmapStorage.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkOSFile.h"
#include "src/core/SkOpts.h"
#include "src/core/SkPictureCommon.h"
diff --git a/gm/aaclip.cpp b/gm/aaclip.cpp
index cceb11d..e4001fc 100644
--- a/gm/aaclip.cpp
+++ b/gm/aaclip.cpp
@@ -159,7 +159,6 @@
#ifdef SK_BUILD_FOR_MAC
#include "include/utils/mac/SkCGUtils.h"
-#include "src/core/SkMakeUnique.h"
static std::unique_ptr<SkCanvas> make_canvas(const SkBitmap& bm) {
const SkImageInfo& info = bm.info();
@@ -168,7 +167,7 @@
(SkPMColor*)bm.getPixels(),
bm.rowBytes());
} else {
- return skstd::make_unique<SkCanvas>(bm);
+ return std::make_unique<SkCanvas>(bm);
}
}
diff --git a/gm/animated_gif.cpp b/gm/animated_gif.cpp
index 8d0dfee..97b9388 100644
--- a/gm/animated_gif.cpp
+++ b/gm/animated_gif.cpp
@@ -17,7 +17,6 @@
#include "include/core/SkString.h"
#include "include/core/SkTypes.h"
#include "include/utils/SkAnimCodecPlayer.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkOSFile.h"
#include "tools/Resources.h"
#include "tools/ToolUtils.h"
@@ -197,7 +196,7 @@
completepath.printf("%s%s", root, path.c_str());
auto codec = load_codec(completepath.c_str());
if (codec) {
- fPlayers.push_back(skstd::make_unique<SkAnimCodecPlayer>(std::move(codec)));
+ fPlayers.push_back(std::make_unique<SkAnimCodecPlayer>(std::move(codec)));
}
}
}
diff --git a/gm/image_pict.cpp b/gm/image_pict.cpp
index 023e369..b62aba9 100644
--- a/gm/image_pict.cpp
+++ b/gm/image_pict.cpp
@@ -28,7 +28,6 @@
#include "include/gpu/GrContext.h"
#include "include/gpu/GrTypes.h"
#include "include/private/GrTypesPriv.h"
-#include "src/core/SkMakeUnique.h"
#include "src/gpu/GrContextPriv.h"
#include "src/gpu/GrSamplerState.h"
#include "src/gpu/GrSurfaceContext.h"
@@ -156,7 +155,7 @@
canvas.clear(0);
canvas.translate(-100, -100);
canvas.drawPicture(pic);
- return skstd::make_unique<RasterGenerator>(bm);
+ return std::make_unique<RasterGenerator>(bm);
}
class EmptyGenerator : public SkImageGenerator {
@@ -212,9 +211,9 @@
const SkImageInfo info = SkImageInfo::MakeN32Premul(100, 100);
if (!ctx) {
- return skstd::make_unique<EmptyGenerator>(info);
+ return std::make_unique<EmptyGenerator>(info);
}
- return skstd::make_unique<TextureGenerator>(ctx, info, pic);
+ return std::make_unique<TextureGenerator>(ctx, info, pic);
}
class ImageCacheratorGM : public skiagm::GM {
diff --git a/gm/imagemasksubset.cpp b/gm/imagemasksubset.cpp
index 6487eec..a163403 100644
--- a/gm/imagemasksubset.cpp
+++ b/gm/imagemasksubset.cpp
@@ -17,7 +17,6 @@
#include "include/core/SkSize.h"
#include "include/core/SkSurface.h"
#include "include/core/SkTypes.h"
-#include "src/core/SkMakeUnique.h"
#include "tools/ToolUtils.h"
namespace {
@@ -66,7 +65,7 @@
// SkImage_Lazy
[](SkCanvas*, const SkImageInfo& info) -> sk_sp<SkImage> {
- return SkImage::MakeFromGenerator(skstd::make_unique<MaskGenerator>(info));
+ return SkImage::MakeFromGenerator(std::make_unique<MaskGenerator>(info));
},
};
diff --git a/gm/rasterhandleallocator.cpp b/gm/rasterhandleallocator.cpp
index 3a549b8..3e3b597 100644
--- a/gm/rasterhandleallocator.cpp
+++ b/gm/rasterhandleallocator.cpp
@@ -11,7 +11,6 @@
#include "include/core/SkPixmap.h"
#include "include/core/SkRasterHandleAllocator.h"
#include "include/core/SkSurface.h"
-#include "src/core/SkMakeUnique.h"
class GraphicsPort {
protected:
@@ -298,7 +297,7 @@
const SkImageInfo info = SkImageInfo::MakeN32Premul(256, 256);
std::unique_ptr<SkCanvas> nativeCanvas =
- SkRasterHandleAllocator::MakeCanvas(skstd::make_unique<MyAllocator>(), info);
+ SkRasterHandleAllocator::MakeCanvas(std::make_unique<MyAllocator>(), info);
MyPort nativePort(nativeCanvas.get());
doDraw(&nativePort);
diff --git a/gn/core.gni b/gn/core.gni
index 030ca4b..ae0e219 100644
--- a/gn/core.gni
+++ b/gn/core.gni
@@ -241,7 +241,6 @@
"$_src/core/SkLocalMatrixImageFilter.h",
"$_src/core/SkMD5.cpp",
"$_src/core/SkMD5.h",
- "$_src/core/SkMakeUnique.h",
"$_src/core/SkMalloc.cpp",
"$_src/core/SkMallocPixelRef.cpp",
"$_src/core/SkMask.cpp",
diff --git a/include/core/SkRasterHandleAllocator.h b/include/core/SkRasterHandleAllocator.h
index 6f5fe68..7735da9 100644
--- a/include/core/SkRasterHandleAllocator.h
+++ b/include/core/SkRasterHandleAllocator.h
@@ -24,7 +24,7 @@
*
* std::unique_ptr<SkCanvas> canvas = SkRasterHandleAllocator::MakeCanvas(
* SkImageInfo::Make(...),
- * skstd::make_unique<MySubclassRasterHandleAllocator>(...),
+ * std::make_unique<MySubclassRasterHandleAllocator>(...),
* nullptr);
*
* If you have already allocated the base layer (and its handle, release-proc etc.) then you
diff --git a/modules/canvaskit/canvaskit_bindings.cpp b/modules/canvaskit/canvaskit_bindings.cpp
index 8987fe0..ff59eb5 100644
--- a/modules/canvaskit/canvaskit_bindings.cpp
+++ b/modules/canvaskit/canvaskit_bindings.cpp
@@ -51,7 +51,6 @@
#include "include/utils/SkShadowUtils.h"
#include "modules/skshaper/include/SkShaper.h"
#include "src/core/SkFontMgrPriv.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkResourceCache.h"
#include "src/shaders/SkRTShader.h"
diff --git a/modules/canvaskit/skottie_bindings.cpp b/modules/canvaskit/skottie_bindings.cpp
index 7d54914..a7e44ae 100644
--- a/modules/canvaskit/skottie_bindings.cpp
+++ b/modules/canvaskit/skottie_bindings.cpp
@@ -11,7 +11,6 @@
#include "include/core/SkTypes.h"
#include "modules/skottie/include/Skottie.h"
#include "modules/sksg/include/SkSGInvalidationController.h"
-#include "src/core/SkMakeUnique.h"
#include <string>
#include <vector>
@@ -86,7 +85,7 @@
public:
static sk_sp<ManagedAnimation> Make(const std::string& json,
sk_sp<skottie::ResourceProvider> rp) {
- auto mgr = skstd::make_unique<skottie_utils::CustomPropertyManager>();
+ auto mgr = std::make_unique<skottie_utils::CustomPropertyManager>();
auto animation = skottie::Animation::Builder()
.setMarkerObserver(mgr->getMarkerObserver())
.setPropertyObserver(mgr->getPropertyObserver())
diff --git a/modules/particles/src/SkParticleEffect.cpp b/modules/particles/src/SkParticleEffect.cpp
index fe00f5c..a1d39d0 100644
--- a/modules/particles/src/SkParticleEffect.cpp
+++ b/modules/particles/src/SkParticleEffect.cpp
@@ -12,7 +12,6 @@
#include "modules/particles/include/SkParticleDrawable.h"
#include "modules/particles/include/SkReflected.h"
#include "modules/skresources/include/SkResources.h"
-#include "src/core/SkMakeUnique.h"
#include "src/sksl/SkSLByteCode.h"
#include "src/sksl/SkSLCompiler.h"
@@ -126,7 +125,7 @@
SkTArray<std::unique_ptr<SkParticleExternalValue>> externalValues;
- auto rand = skstd::make_unique<SkRandomExternalValue>("rand", compiler);
+ auto rand = std::make_unique<SkRandomExternalValue>("rand", compiler);
compiler.registerExternalValue(rand.get());
externalValues.push_back(std::move(rand));
diff --git a/modules/skottie/gm/SkottieGM.cpp b/modules/skottie/gm/SkottieGM.cpp
index f0d8c50..03b0b75 100644
--- a/modules/skottie/gm/SkottieGM.cpp
+++ b/modules/skottie/gm/SkottieGM.cpp
@@ -12,7 +12,6 @@
#include "modules/skottie/include/SkottieProperty.h"
#include "modules/skottie/utils/SkottieUtils.h"
#include "modules/skresources/include/SkResources.h"
-#include "src/core/SkMakeUnique.h"
#include "tools/Resources.h"
#include <cmath>
@@ -102,7 +101,7 @@
void onOnceBeforeDraw() override {
if (auto stream = GetResourceAsStream("skottie/skottie_sample_search.json")) {
- fPropManager = skstd::make_unique<skottie_utils::CustomPropertyManager>();
+ fPropManager = std::make_unique<skottie_utils::CustomPropertyManager>();
fAnimation = skottie::Animation::Builder()
.setPropertyObserver(fPropManager->getPropertyObserver())
.make(stream.get());
diff --git a/modules/skottie/src/SkottieTool.cpp b/modules/skottie/src/SkottieTool.cpp
index 501290a..4be4a10 100644
--- a/modules/skottie/src/SkottieTool.cpp
+++ b/modules/skottie/src/SkottieTool.cpp
@@ -13,7 +13,6 @@
#include "include/encode/SkPngEncoder.h"
#include "modules/skottie/include/Skottie.h"
#include "modules/skresources/include/SkResources.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkOSFile.h"
#include "src/core/SkTaskGroup.h"
#include "src/utils/SkOSPath.h"
@@ -48,7 +47,7 @@
std::unique_ptr<SkFILEWStream> MakeFrameStream(size_t idx, const char* ext) {
const auto frame_file = SkStringPrintf("0%06d.%s", idx, ext);
- auto stream = skstd::make_unique<SkFILEWStream>(SkOSPath::Join(FLAGS_writePath[0],
+ auto stream = std::make_unique<SkFILEWStream>(SkOSPath::Join(FLAGS_writePath[0],
frame_file.c_str()).c_str());
if (!stream->isValid()) {
return nullptr;
@@ -235,7 +234,7 @@
if (0 == strcmp(fmt, "png")) return PNGSink::Make(scale_matrix);
if (0 == strcmp(fmt, "skp")) return SKPSink::Make(scale_matrix);
if (0 == strcmp(fmt, "null")) return NullSink::Make(scale_matrix);
- if (0 == strcmp(fmt, "mp4")) return skstd::make_unique<MP4Sink>(scale_matrix);
+ if (0 == strcmp(fmt, "mp4")) return std::make_unique<MP4Sink>(scale_matrix);
SkDebugf("Unknown format: %s\n", FLAGS_format[0]);
return nullptr;
diff --git a/modules/skparagraph/src/ParagraphBuilderImpl.cpp b/modules/skparagraph/src/ParagraphBuilderImpl.cpp
index 4a11404..4c3e90c 100644
--- a/modules/skparagraph/src/ParagraphBuilderImpl.cpp
+++ b/modules/skparagraph/src/ParagraphBuilderImpl.cpp
@@ -3,7 +3,6 @@
#include "modules/skparagraph/include/ParagraphStyle.h"
#include "modules/skparagraph/src/ParagraphBuilderImpl.h"
#include "modules/skparagraph/src/ParagraphImpl.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkSpan.h"
#include "unicode/unistr.h"
@@ -12,7 +11,7 @@
std::unique_ptr<ParagraphBuilder> ParagraphBuilder::make(
const ParagraphStyle& style, sk_sp<FontCollection> fontCollection) {
- return skstd::make_unique<ParagraphBuilderImpl>(style, fontCollection);
+ return std::make_unique<ParagraphBuilderImpl>(style, fontCollection);
}
ParagraphBuilderImpl::ParagraphBuilderImpl(
@@ -146,7 +145,7 @@
// Add one fake placeholder with the rest of the text
addPlaceholder(PlaceholderStyle(), true);
- return skstd::make_unique<ParagraphImpl>(
+ return std::make_unique<ParagraphImpl>(
fUtf8, fParagraphStyle, fStyledBlocks, fPlaceholders, fFontCollection);
}
diff --git a/modules/skparagraph/src/TextLine.cpp b/modules/skparagraph/src/TextLine.cpp
index 52dc8d9..57d6379 100644
--- a/modules/skparagraph/src/TextLine.cpp
+++ b/modules/skparagraph/src/TextLine.cpp
@@ -7,7 +7,6 @@
#include "include/core/SkMaskFilter.h"
#include "include/effects/SkDashPathEffect.h"
#include "include/effects/SkDiscretePathEffect.h"
-#include "src/core/SkMakeUnique.h"
namespace skia {
namespace textlayout {
diff --git a/modules/skresources/src/SkResources.cpp b/modules/skresources/src/SkResources.cpp
index 38b04d2..e297f12 100644
--- a/modules/skresources/src/SkResources.cpp
+++ b/modules/skresources/src/SkResources.cpp
@@ -12,7 +12,6 @@
#include "include/core/SkImage.h"
#include "include/utils/SkAnimCodecPlayer.h"
#include "include/utils/SkBase64.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkOSFile.h"
#include "src/utils/SkOSPath.h"
@@ -21,7 +20,7 @@
sk_sp<MultiFrameImageAsset> MultiFrameImageAsset::Make(sk_sp<SkData> data, bool predecode) {
if (auto codec = SkCodec::MakeFromData(std::move(data))) {
return sk_sp<MultiFrameImageAsset>(
- new MultiFrameImageAsset(skstd::make_unique<SkAnimCodecPlayer>(std::move(codec)),
+ new MultiFrameImageAsset(std::make_unique<SkAnimCodecPlayer>(std::move(codec)),
predecode));
}
diff --git a/modules/sksg/src/SkSGRenderEffect.cpp b/modules/sksg/src/SkSGRenderEffect.cpp
index 1af4713..c4fb932 100644
--- a/modules/sksg/src/SkSGRenderEffect.cpp
+++ b/modules/sksg/src/SkSGRenderEffect.cpp
@@ -10,7 +10,6 @@
#include "include/core/SkCanvas.h"
#include "include/core/SkMaskFilter.h"
#include "include/core/SkShader.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkMaskFilterBase.h"
namespace sksg {
@@ -178,7 +177,7 @@
}
ImageFilter::ImageFilter(sk_sp<ImageFilter> input)
- : ImageFilter(input ? skstd::make_unique<InputsT>(1, std::move(input)) : nullptr) {}
+ : ImageFilter(input ? std::make_unique<InputsT>(1, std::move(input)) : nullptr) {}
ImageFilter::ImageFilter(std::unique_ptr<InputsT> inputs)
: INHERITED(kBubbleDamage_Trait)
diff --git a/modules/skshaper/src/SkShaper.cpp b/modules/skshaper/src/SkShaper.cpp
index 8e93fec..4ef76e8 100644
--- a/modules/skshaper/src/SkShaper.cpp
+++ b/modules/skshaper/src/SkShaper.cpp
@@ -13,7 +13,6 @@
#include "include/core/SkTypeface.h"
#include "include/private/SkTFitsIn.h"
#include "modules/skshaper/include/SkShaper.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkTextBlobPriv.h"
#include "src/utils/SkUTF.h"
@@ -42,7 +41,7 @@
return bidi;
}
#endif
- return skstd::make_unique<SkShaper::TrivialBiDiRunIterator>(bidiLevel, utf8Bytes);
+ return std::make_unique<SkShaper::TrivialBiDiRunIterator>(bidiLevel, utf8Bytes);
}
std::unique_ptr<SkShaper::ScriptRunIterator>
@@ -54,7 +53,7 @@
return script;
}
#endif
- return skstd::make_unique<SkShaper::TrivialScriptRunIterator>(scriptTag, utf8Bytes);
+ return std::make_unique<SkShaper::TrivialScriptRunIterator>(scriptTag, utf8Bytes);
}
SkShaper::SkShaper() {}
@@ -165,7 +164,7 @@
SkShaper::MakeFontMgrRunIterator(const char* utf8, size_t utf8Bytes,
const SkFont& font, sk_sp<SkFontMgr> fallback)
{
- return skstd::make_unique<FontMgrRunIterator>(utf8, utf8Bytes, font, std::move(fallback));
+ return std::make_unique<FontMgrRunIterator>(utf8, utf8Bytes, font, std::move(fallback));
}
std::unique_ptr<SkShaper::FontRunIterator>
@@ -174,13 +173,13 @@
const char* requestName, SkFontStyle requestStyle,
const SkShaper::LanguageRunIterator* language)
{
- return skstd::make_unique<FontMgrRunIterator>(utf8, utf8Bytes, font, std::move(fallback),
+ return std::make_unique<FontMgrRunIterator>(utf8, utf8Bytes, font, std::move(fallback),
requestName, requestStyle, language);
}
std::unique_ptr<SkShaper::LanguageRunIterator>
SkShaper::MakeStdLanguageRunIterator(const char* utf8, size_t utf8Bytes) {
- return skstd::make_unique<TrivialLanguageRunIterator>(std::locale().name().c_str(), utf8Bytes);
+ return std::make_unique<TrivialLanguageRunIterator>(std::locale().name().c_str(), utf8Bytes);
}
void SkTextBlobBuilderRunHandler::beginLine() {
diff --git a/modules/skshaper/src/SkShaper_harfbuzz.cpp b/modules/skshaper/src/SkShaper_harfbuzz.cpp
index 926101b..1d85659 100644
--- a/modules/skshaper/src/SkShaper_harfbuzz.cpp
+++ b/modules/skshaper/src/SkShaper_harfbuzz.cpp
@@ -25,7 +25,6 @@
#include "include/private/SkTemplates.h"
#include "include/private/SkTo.h"
#include "modules/skshaper/include/SkShaper.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkSpan.h"
#include "src/core/SkTDPQueue.h"
#include "src/utils/SkUTF.h"
@@ -762,12 +761,12 @@
}
if (correct) {
- return skstd::make_unique<ShaperDrivenWrapper>(std::move(buffer),
+ return std::make_unique<ShaperDrivenWrapper>(std::move(buffer),
std::move(lineBreakIterator),
std::move(graphemeBreakIterator),
std::move(fontmgr));
} else {
- return skstd::make_unique<ShapeThenWrap>(std::move(buffer),
+ return std::make_unique<ShapeThenWrap>(std::move(buffer),
std::move(lineBreakIterator),
std::move(graphemeBreakIterator),
std::move(fontmgr));
@@ -1432,12 +1431,12 @@
return nullptr;
}
- return skstd::make_unique<IcuBiDiRunIterator>(utf8, utf8 + utf8Bytes, std::move(bidi));
+ return std::make_unique<IcuBiDiRunIterator>(utf8, utf8 + utf8Bytes, std::move(bidi));
}
std::unique_ptr<SkShaper::ScriptRunIterator>
SkShaper::MakeHbIcuScriptRunIterator(const char* utf8, size_t utf8Bytes) {
- return skstd::make_unique<HbIcuScriptRunIterator>(utf8, utf8Bytes);
+ return std::make_unique<HbIcuScriptRunIterator>(utf8, utf8Bytes);
}
std::unique_ptr<SkShaper> SkShaper::MakeShaperDrivenWrapper(sk_sp<SkFontMgr> fontmgr) {
@@ -1459,6 +1458,6 @@
return nullptr;
}
- return skstd::make_unique<ShapeDontWrapOrReorder>(std::move(buffer), nullptr, nullptr,
+ return std::make_unique<ShapeDontWrapOrReorder>(std::move(buffer), nullptr, nullptr,
std::move(fontmgr));
}
diff --git a/modules/skshaper/src/SkShaper_primitive.cpp b/modules/skshaper/src/SkShaper_primitive.cpp
index fffeefa..ba29b06 100644
--- a/modules/skshaper/src/SkShaper_primitive.cpp
+++ b/modules/skshaper/src/SkShaper_primitive.cpp
@@ -10,7 +10,6 @@
#include "include/core/SkTypeface.h"
#include "include/private/SkTo.h"
#include "modules/skshaper/include/SkShaper.h"
-#include "src/core/SkMakeUnique.h"
#include "src/utils/SkUTF.h"
class SkShaperPrimitive : public SkShaper {
@@ -42,7 +41,7 @@
};
std::unique_ptr<SkShaper> SkShaper::MakePrimitive() {
- return skstd::make_unique<SkShaperPrimitive>();
+ return std::make_unique<SkShaperPrimitive>();
}
static inline bool is_breaking_whitespace(SkUnichar c) {
diff --git a/samplecode/SampleCCPRGeometry.cpp b/samplecode/SampleCCPRGeometry.cpp
index dff8ed9..fe3b280 100644
--- a/samplecode/SampleCCPRGeometry.cpp
+++ b/samplecode/SampleCCPRGeometry.cpp
@@ -13,7 +13,6 @@
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "samplecode/Sample.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkRectPriv.h"
#include "src/gpu/GrClip.h"
#include "src/gpu/GrContextPriv.h"
@@ -112,7 +111,7 @@
return "[Testing/Sample code] CCPRGeometryView::VisualizeCoverageCountFP";
}
std::unique_ptr<GrFragmentProcessor> clone() const override {
- return skstd::make_unique<VisualizeCoverageCountFP>();
+ return std::make_unique<VisualizeCoverageCountFP>();
}
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override {}
bool onIsEqual(const GrFragmentProcessor&) const override { return true; }
@@ -198,7 +197,7 @@
GrSimpleTextureEffect::Make(sk_ref_sp(ccbuff->asTextureProxy()),
ccbuff->colorInfo().alphaType(), SkMatrix::I()));
paint.addColorFragmentProcessor(
- skstd::make_unique<VisualizeCoverageCountFP>());
+ std::make_unique<VisualizeCoverageCountFP>());
paint.setPorterDuffXPFactory(SkBlendMode::kSrcOver);
rtc->drawRect(GrNoClip(), std::move(paint), GrAA::kNo, SkMatrix::I(),
SkRect::MakeIWH(this->width(), this->height()));
@@ -340,9 +339,9 @@
std::unique_ptr<GrCCCoverageProcessor> proc;
if (state->caps().shaderCaps()->geometryShaderSupport()) {
- proc = skstd::make_unique<GrGSCoverageProcessor>();
+ proc = std::make_unique<GrGSCoverageProcessor>();
} else {
- proc = skstd::make_unique<GrVSCoverageProcessor>();
+ proc = std::make_unique<GrVSCoverageProcessor>();
}
if (!fView->fDoStroke) {
diff --git a/src/codec/SkAndroidCodec.cpp b/src/codec/SkAndroidCodec.cpp
index b90dbe7..ecd3195 100644
--- a/src/codec/SkAndroidCodec.cpp
+++ b/src/codec/SkAndroidCodec.cpp
@@ -11,7 +11,6 @@
#include "src/codec/SkAndroidCodecAdapter.h"
#include "src/codec/SkCodecPriv.h"
#include "src/codec/SkSampledCodec.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkPixmapPriv.h"
static bool is_valid_sample_size(int sampleSize) {
@@ -97,7 +96,7 @@
case SkEncodedImageFormat::kBMP:
case SkEncodedImageFormat::kWBMP:
case SkEncodedImageFormat::kHEIF:
- return skstd::make_unique<SkSampledCodec>(codec.release(), orientationBehavior);
+ return std::make_unique<SkSampledCodec>(codec.release(), orientationBehavior);
#ifdef SK_HAS_WUFFS_LIBRARY
case SkEncodedImageFormat::kGIF:
#endif
@@ -108,7 +107,7 @@
case SkEncodedImageFormat::kDNG:
#endif
#if defined(SK_HAS_WEBP_LIBRARY) || defined(SK_CODEC_DECODES_RAW) || defined(SK_HAS_WUFFS_LIBRARY)
- return skstd::make_unique<SkAndroidCodecAdapter>(codec.release(), orientationBehavior);
+ return std::make_unique<SkAndroidCodecAdapter>(codec.release(), orientationBehavior);
#endif
default:
diff --git a/src/codec/SkCodecImageGenerator.cpp b/src/codec/SkCodecImageGenerator.cpp
index b790947..da90145 100644
--- a/src/codec/SkCodecImageGenerator.cpp
+++ b/src/codec/SkCodecImageGenerator.cpp
@@ -7,7 +7,6 @@
#include "include/core/SkYUVAIndex.h"
#include "src/codec/SkCodecImageGenerator.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkPixmapPriv.h"
std::unique_ptr<SkImageGenerator> SkCodecImageGenerator::MakeFromEncodedCodec(sk_sp<SkData> data) {
diff --git a/src/codec/SkRawCodec.cpp b/src/codec/SkRawCodec.cpp
index f8dff7a..bcbf32b 100644
--- a/src/codec/SkRawCodec.cpp
+++ b/src/codec/SkRawCodec.cpp
@@ -18,7 +18,6 @@
#include "src/codec/SkJpegCodec.h"
#include "src/codec/SkRawCodec.h"
#include "src/core/SkColorSpacePriv.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkStreamPriv.h"
#include "src/core/SkTaskGroup.h"
diff --git a/src/codec/SkWebpCodec.cpp b/src/codec/SkWebpCodec.cpp
index 9e2dead..8a889b5 100644
--- a/src/codec/SkWebpCodec.cpp
+++ b/src/codec/SkWebpCodec.cpp
@@ -16,7 +16,6 @@
#include "src/codec/SkCodecPriv.h"
#include "src/codec/SkParseEncodedOrigin.h"
#include "src/codec/SkSampler.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkRasterPipeline.h"
#include "src/core/SkStreamPriv.h"
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
index 285ff54..03a3e77 100644
--- a/src/core/SkBitmapDevice.cpp
+++ b/src/core/SkBitmapDevice.cpp
@@ -19,7 +19,6 @@
#include "src/core/SkGlyphRun.h"
#include "src/core/SkImageFilterCache.h"
#include "src/core/SkImageFilter_Base.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkRasterClip.h"
#include "src/core/SkSpecialImage.h"
#include "src/core/SkStrikeCache.h"
@@ -242,7 +241,7 @@
if (coverage) {
SkASSERT(coverage->width() == bitmap.width());
SkASSERT(coverage->height() == bitmap.height());
- fCoverage = skstd::make_unique<SkBitmap>(*coverage);
+ fCoverage = std::make_unique<SkBitmap>(*coverage);
}
}
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 26a30d1..2cd4c8f 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -31,7 +31,6 @@
#include "src/core/SkImageFilter_Base.h"
#include "src/core/SkLatticeIter.h"
#include "src/core/SkMSAN.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkMatrixUtils.h"
#include "src/core/SkPaintPriv.h"
#include "src/core/SkRasterClip.h"
@@ -195,7 +194,7 @@
const SkImage* clipImage, const SkMatrix* clipMatrix)
: fNext(nullptr)
, fDevice(std::move(device))
- , fPaint(paint ? skstd::make_unique<SkPaint>(*paint) : nullptr)
+ , fPaint(paint ? std::make_unique<SkPaint>(*paint) : nullptr)
, fStashedMatrix(stashed)
, fClipImage(sk_ref_sp(const_cast<SkImage*>(clipImage)))
, fClipMatrix(clipMatrix ? *clipMatrix : SkMatrix::I())
@@ -519,7 +518,7 @@
device->androidFramework_setDeviceClipRestriction(&fClipRestrictionRect);
}
- fScratchGlyphRunBuilder = skstd::make_unique<SkGlyphRunBuilder>();
+ fScratchGlyphRunBuilder = std::make_unique<SkGlyphRunBuilder>();
}
SkCanvas::SkCanvas()
@@ -3069,8 +3068,8 @@
}
return props ?
- skstd::make_unique<SkCanvas>(bitmap, *props) :
- skstd::make_unique<SkCanvas>(bitmap);
+ std::make_unique<SkCanvas>(bitmap, *props) :
+ std::make_unique<SkCanvas>(bitmap);
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/SkDeferredDisplayListRecorder.cpp b/src/core/SkDeferredDisplayListRecorder.cpp
index 1149c15..5533a91 100644
--- a/src/core/SkDeferredDisplayListRecorder.cpp
+++ b/src/core/SkDeferredDisplayListRecorder.cpp
@@ -61,7 +61,6 @@
#include "include/core/SkPromiseImageTexture.h"
#include "include/core/SkYUVASizeInfo.h"
#include "include/gpu/GrTexture.h"
-#include "src/core/SkMakeUnique.h"
#include "src/gpu/GrContextPriv.h"
#include "src/gpu/GrProxyProvider.h"
#include "src/gpu/GrRenderTargetContext.h"
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp
index 6a31aee..219ec0f 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -20,7 +20,6 @@
#include "src/core/SkImageFilterCache.h"
#include "src/core/SkImagePriv.h"
#include "src/core/SkLatticeIter.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkMatrixPriv.h"
#include "src/core/SkPathPriv.h"
#include "src/core/SkRasterClip.h"
diff --git a/src/core/SkExecutor.cpp b/src/core/SkExecutor.cpp
index ce2ded2..9d90aa0 100644
--- a/src/core/SkExecutor.cpp
+++ b/src/core/SkExecutor.cpp
@@ -10,7 +10,6 @@
#include "include/private/SkSemaphore.h"
#include "include/private/SkSpinlock.h"
#include "include/private/SkTArray.h"
-#include "src/core/SkMakeUnique.h"
#include <deque>
#include <thread>
@@ -143,9 +142,9 @@
std::unique_ptr<SkExecutor> SkExecutor::MakeFIFOThreadPool(int threads) {
using WorkList = std::deque<std::function<void(void)>>;
- return skstd::make_unique<SkThreadPool<WorkList>>(threads > 0 ? threads : num_cores());
+ return std::make_unique<SkThreadPool<WorkList>>(threads > 0 ? threads : num_cores());
}
std::unique_ptr<SkExecutor> SkExecutor::MakeLIFOThreadPool(int threads) {
using WorkList = SkTArray<std::function<void(void)>>;
- return skstd::make_unique<SkThreadPool<WorkList>>(threads > 0 ? threads : num_cores());
+ return std::make_unique<SkThreadPool<WorkList>>(threads > 0 ? threads : num_cores());
}
diff --git a/src/core/SkFontDescriptor.cpp b/src/core/SkFontDescriptor.cpp
index c47781e..6e8bb80 100644
--- a/src/core/SkFontDescriptor.cpp
+++ b/src/core/SkFontDescriptor.cpp
@@ -8,7 +8,6 @@
#include "include/core/SkData.h"
#include "include/core/SkStream.h"
#include "src/core/SkFontDescriptor.h"
-#include "src/core/SkMakeUnique.h"
enum {
kInvalid = 0x00,
@@ -110,7 +109,7 @@
SkDEBUGFAIL("Could not read font data");
return false;
}
- result->fFontData = skstd::make_unique<SkFontData>(
+ result->fFontData = std::make_unique<SkFontData>(
SkMemoryStream::Make(std::move(data)), index, axis, axisCount);
}
return true;
diff --git a/src/core/SkGlyph.cpp b/src/core/SkGlyph.cpp
index 7e10915..b0c7523 100644
--- a/src/core/SkGlyph.cpp
+++ b/src/core/SkGlyph.cpp
@@ -8,7 +8,6 @@
#include "src/core/SkGlyph.h"
#include "src/core/SkArenaAlloc.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkScalerContext.h"
#include "src/pathops/SkPathOpsCubic.h"
#include "src/pathops/SkPathOpsQuad.h"
diff --git a/src/core/SkMakeUnique.h b/src/core/SkMakeUnique.h
deleted file mode 100644
index 860ea2e..0000000
--- a/src/core/SkMakeUnique.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2016 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SkMakeUnique_DEFINED
-#define SkMakeUnique_DEFINED
-
-#include <memory>
-
-namespace skstd {
-
-// std::make_unique is in C++14
-template<typename T, typename... Args>
-std::unique_ptr<T> make_unique(Args&&... args) {
- return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
-}
-
-template<typename T>
-std::unique_ptr<T> make_unique_default(size_t n) {
- return std::unique_ptr<T>(new typename std::remove_extent<T>::type[n]);
-}
-
-}
-
-#endif // SkMakeUnique_DEFINED
diff --git a/src/core/SkPictureData.cpp b/src/core/SkPictureData.cpp
index 9fd2768..bb6d67c 100644
--- a/src/core/SkPictureData.cpp
+++ b/src/core/SkPictureData.cpp
@@ -11,7 +11,6 @@
#include "include/core/SkTypeface.h"
#include "include/private/SkTo.h"
#include "src/core/SkAutoMalloc.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkPicturePriv.h"
#include "src/core/SkPictureRecord.h"
#include "src/core/SkReadBuffer.h"
@@ -300,7 +299,7 @@
break;
case SK_PICT_FACTORY_TAG: {
if (!stream->readU32(&size)) { return false; }
- fFactoryPlayback = skstd::make_unique<SkFactoryPlayback>(size);
+ fFactoryPlayback = std::make_unique<SkFactoryPlayback>(size);
for (size_t i = 0; i < size; i++) {
SkString str;
size_t len;
diff --git a/src/core/SkPictureImageGenerator.cpp b/src/core/SkPictureImageGenerator.cpp
index 21987f1..b796e9a 100644
--- a/src/core/SkPictureImageGenerator.cpp
+++ b/src/core/SkPictureImageGenerator.cpp
@@ -11,7 +11,6 @@
#include "include/core/SkPaint.h"
#include "include/core/SkPicture.h"
#include "include/core/SkSurface.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkTLazy.h"
#include "src/image/SkImage_Base.h"
diff --git a/src/core/SkRWBuffer.cpp b/src/core/SkRWBuffer.cpp
index 84e56e4..462532f 100644
--- a/src/core/SkRWBuffer.cpp
+++ b/src/core/SkRWBuffer.cpp
@@ -10,7 +10,6 @@
#include "include/core/SkStream.h"
#include "include/private/SkMalloc.h"
#include "include/private/SkTo.h"
-#include "src/core/SkMakeUnique.h"
#include <atomic>
#include <new>
@@ -360,5 +359,5 @@
};
std::unique_ptr<SkStreamAsset> SkRWBuffer::makeStreamSnapshot() const {
- return skstd::make_unique<SkROBufferStreamAsset>(this->makeROBufferSnapshot());
+ return std::make_unique<SkROBufferStreamAsset>(this->makeROBufferSnapshot());
}
diff --git a/src/core/SkReadBuffer.cpp b/src/core/SkReadBuffer.cpp
index ff78b74..041f6f0 100644
--- a/src/core/SkReadBuffer.cpp
+++ b/src/core/SkReadBuffer.cpp
@@ -12,7 +12,6 @@
#include "include/core/SkStream.h"
#include "include/core/SkTypeface.h"
#include "src/core/SkAutoMalloc.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkMathPriv.h"
#include "src/core/SkMatrixPriv.h"
#include "src/core/SkReadBuffer.h"
@@ -33,7 +32,7 @@
static sk_sp<SkImage> MakeEmptyImage(int width, int height) {
return SkImage::MakeFromGenerator(
- skstd::make_unique<EmptyImageGenerator>(SkImageInfo::MakeN32Premul(width, height)));
+ std::make_unique<EmptyImageGenerator>(SkImageInfo::MakeN32Premul(width, height)));
}
} // anonymous namespace
diff --git a/src/core/SkRemoteGlyphCache.cpp b/src/core/SkRemoteGlyphCache.cpp
index e88b02d..cd4fa89 100644
--- a/src/core/SkRemoteGlyphCache.cpp
+++ b/src/core/SkRemoteGlyphCache.cpp
@@ -639,7 +639,7 @@
auto context = typeface.createScalerContext(effects, &desc);
auto newHandle = fDiscardableHandleManager->createHandle(); // Locked on creation
- auto remoteStrike = skstd::make_unique<RemoteStrike>(desc, std::move(context), newHandle);
+ auto remoteStrike = std::make_unique<RemoteStrike>(desc, std::move(context), newHandle);
remoteStrike->setTypefaceAndEffects(&typeface, effects);
auto remoteStrikePtr = remoteStrike.get();
fRemoteStrikesToSend.add(remoteStrikePtr);
@@ -956,7 +956,7 @@
auto scaler = SkStrikeCache::CreateScalerContext(*client_desc, effects, *tf);
strike = fStrikeCache->createStrikeExclusive(
*client_desc, std::move(scaler), &fontMetrics,
- skstd::make_unique<DiscardableStrikePinner>(spec.discardableHandleId,
+ std::make_unique<DiscardableStrikePinner>(spec.discardableHandleId,
fDiscardableHandleManager));
auto proxyContext = static_cast<SkScalerContextProxy*>(strike->getScalerContext());
proxyContext->initCache(strike.get(), fStrikeCache);
diff --git a/src/core/SkRemoteGlyphCache.h b/src/core/SkRemoteGlyphCache.h
index 540f792..d78b431 100644
--- a/src/core/SkRemoteGlyphCache.h
+++ b/src/core/SkRemoteGlyphCache.h
@@ -26,7 +26,6 @@
#include "include/private/SkTHash.h"
#include "include/utils/SkNoDrawCanvas.h"
#include "src/core/SkDevice.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkStrikeForGPU.h"
#include "src/core/SkTLazy.h"
#include "src/core/SkTextBlobTrace.h"
diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp
index 2cef146..152c3cd 100644
--- a/src/core/SkScalerContext.cpp
+++ b/src/core/SkScalerContext.cpp
@@ -20,7 +20,6 @@
#include "src/core/SkDraw.h"
#include "src/core/SkFontPriv.h"
#include "src/core/SkGlyph.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkMaskGamma.h"
#include "src/core/SkPaintPriv.h"
#include "src/core/SkPathPriv.h"
@@ -903,7 +902,7 @@
{
std::unique_ptr<SkScalerContext> c(this->onCreateScalerContext(effects, desc));
if (!c && !allowFailure) {
- c = skstd::make_unique<SkScalerContext_Empty>(sk_ref_sp(const_cast<SkTypeface*>(this)),
+ c = std::make_unique<SkScalerContext_Empty>(sk_ref_sp(const_cast<SkTypeface*>(this)),
effects, desc);
}
diff --git a/src/core/SkSpecialSurface.cpp b/src/core/SkSpecialSurface.cpp
index 2f34fa0..6deca8c 100644
--- a/src/core/SkSpecialSurface.cpp
+++ b/src/core/SkSpecialSurface.cpp
@@ -118,7 +118,6 @@
#if SK_SUPPORT_GPU
///////////////////////////////////////////////////////////////////////////////
#include "include/private/GrRecordingContext.h"
-#include "src/core/SkMakeUnique.h"
#include "src/gpu/GrRecordingContextPriv.h"
#include "src/gpu/SkGpuDevice.h"
diff --git a/src/core/SkStream.cpp b/src/core/SkStream.cpp
index 2bdd47f..755414e 100644
--- a/src/core/SkStream.cpp
+++ b/src/core/SkStream.cpp
@@ -13,7 +13,6 @@
#include "include/private/SkFixed.h"
#include "include/private/SkTFitsIn.h"
#include "include/private/SkTo.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkOSFile.h"
#include "src/core/SkSafeMath.h"
#include "src/core/SkStreamPriv.h"
@@ -286,15 +285,15 @@
}
std::unique_ptr<SkMemoryStream> SkMemoryStream::MakeCopy(const void* data, size_t length) {
- return skstd::make_unique<SkMemoryStream>(data, length, true);
+ return std::make_unique<SkMemoryStream>(data, length, true);
}
std::unique_ptr<SkMemoryStream> SkMemoryStream::MakeDirect(const void* data, size_t length) {
- return skstd::make_unique<SkMemoryStream>(data, length, false);
+ return std::make_unique<SkMemoryStream>(data, length, false);
}
std::unique_ptr<SkMemoryStream> SkMemoryStream::Make(sk_sp<SkData> data) {
- return skstd::make_unique<SkMemoryStream>(std::move(data));
+ return std::make_unique<SkMemoryStream>(std::move(data));
}
void SkMemoryStream::setMemoryOwned(const void* src, size_t size) {
@@ -872,7 +871,7 @@
SkASSERT(0 == fBytesWrittenBeforeTail);
}
std::unique_ptr<SkStreamAsset> stream
- = skstd::make_unique<SkBlockMemoryStream>(sk_make_sp<SkBlockMemoryRefCnt>(fHead),
+ = std::make_unique<SkBlockMemoryStream>(sk_make_sp<SkBlockMemoryRefCnt>(fHead),
this->bytesWritten());
fHead = nullptr; // signal reset() to not free anything
this->reset();
@@ -896,11 +895,11 @@
std::unique_ptr<SkStreamAsset> SkStream::MakeFromFile(const char path[]) {
auto data(mmap_filename(path));
if (data) {
- return skstd::make_unique<SkMemoryStream>(std::move(data));
+ return std::make_unique<SkMemoryStream>(std::move(data));
}
// If we get here, then our attempt at using mmap failed, so try normal file access.
- auto stream = skstd::make_unique<SkFILEStream>(path);
+ auto stream = std::make_unique<SkFILEStream>(path);
if (!stream->isValid()) {
return nullptr;
}
diff --git a/src/core/SkStrike.cpp b/src/core/SkStrike.cpp
index db05511..cf49926 100644
--- a/src/core/SkStrike.cpp
+++ b/src/core/SkStrike.cpp
@@ -14,7 +14,6 @@
#include "include/private/SkOnce.h"
#include "include/private/SkTemplates.h"
#include "src/core/SkEnumerate.h"
-#include "src/core/SkMakeUnique.h"
#include <cctype>
SkStrike::SkStrike(
diff --git a/src/core/SkTypeface.cpp b/src/core/SkTypeface.cpp
index 17159be..69e5de6 100644
--- a/src/core/SkTypeface.cpp
+++ b/src/core/SkTypeface.cpp
@@ -14,7 +14,6 @@
#include "src/core/SkAdvancedTypefaceMetrics.h"
#include "src/core/SkEndian.h"
#include "src/core/SkFontDescriptor.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkSurfacePriv.h"
#include "src/core/SkTypefaceCache.h"
#include "src/sfnt/SkOTTable_OS_2.h"
@@ -291,7 +290,7 @@
if (!stream) {
return nullptr;
}
- return skstd::make_unique<SkFontData>(std::move(stream), index, nullptr, 0);
+ return std::make_unique<SkFontData>(std::move(stream), index, nullptr, 0);
};
void SkTypeface::unicharsToGlyphs(const SkUnichar uni[], int count, SkGlyphID glyphs[]) const {
diff --git a/src/gpu/GrClipStackClip.cpp b/src/gpu/GrClipStackClip.cpp
index 2db564f..094a49e 100644
--- a/src/gpu/GrClipStackClip.cpp
+++ b/src/gpu/GrClipStackClip.cpp
@@ -7,7 +7,6 @@
#include "include/private/SkTo.h"
#include "src/core/SkClipOpPriv.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkTaskGroup.h"
#include "src/core/SkTraceEvent.h"
#include "src/gpu/GrAppliedClip.h"
@@ -508,7 +507,7 @@
SkBudgeted::kYes,
GrProtected::kNo);
- auto uploader = skstd::make_unique<GrTDeferredProxyUploader<ClipMaskData>>(reducedClip);
+ auto uploader = std::make_unique<GrTDeferredProxyUploader<ClipMaskData>>(reducedClip);
GrTDeferredProxyUploader<ClipMaskData>* uploaderRaw = uploader.get();
auto drawAndUploadMask = [uploaderRaw, maskSpaceIBounds] {
TRACE_EVENT0("skia.gpu", "Threaded SW Clip Mask Render");
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 0ab948c..d150ed4 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -11,7 +11,6 @@
#include "include/gpu/GrBackendSemaphore.h"
#include "include/private/SkDeferredDisplayList.h"
#include "include/private/SkImageInfoPriv.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkMipMap.h"
#include "src/core/SkTaskGroup.h"
#include "src/gpu/GrClientMappedBufferManager.h"
@@ -82,7 +81,7 @@
if (fGpu) {
fResourceCache = new GrResourceCache(this->caps(), this->singleOwner(), this->contextID());
fResourceProvider = new GrResourceProvider(fGpu.get(), fResourceCache, this->singleOwner());
- fMappedBufferManager = skstd::make_unique<GrClientMappedBufferManager>(this->contextID());
+ fMappedBufferManager = std::make_unique<GrClientMappedBufferManager>(this->contextID());
}
if (fResourceCache) {
@@ -94,7 +93,7 @@
// DDL TODO: we need to think through how the task group & persistent cache
// get passed on to/shared between all the DDLRecorders created with this context.
if (this->options().fExecutor) {
- fTaskGroup = skstd::make_unique<SkTaskGroup>(*this->options().fExecutor);
+ fTaskGroup = std::make_unique<SkTaskGroup>(*this->options().fExecutor);
}
fPersistentCache = this->options().fPersistentCache;
diff --git a/src/gpu/GrDeferredProxyUploader.h b/src/gpu/GrDeferredProxyUploader.h
index c0047c0..33e62a5 100644
--- a/src/gpu/GrDeferredProxyUploader.h
+++ b/src/gpu/GrDeferredProxyUploader.h
@@ -11,7 +11,6 @@
#include "include/core/SkRefCnt.h"
#include "include/private/SkSemaphore.h"
#include "src/core/SkAutoPixmapStorage.h"
-#include "src/core/SkMakeUnique.h"
#include "src/gpu/GrOpFlushState.h"
#include "src/gpu/GrTextureProxyPriv.h"
@@ -98,7 +97,7 @@
public:
template <typename... Args>
GrTDeferredProxyUploader(Args&&... args)
- : fData(skstd::make_unique<T>(std::forward<Args>(args)...)) {
+ : fData(std::make_unique<T>(std::forward<Args>(args)...)) {
}
~GrTDeferredProxyUploader() override {
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index dc5c60c..2b3b574 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -17,7 +17,6 @@
#include "src/core/SkDrawShadowInfo.h"
#include "src/core/SkGlyphRunPainter.h"
#include "src/core/SkLatticeIter.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkMatrixPriv.h"
#include "src/core/SkRRectPriv.h"
#include "src/core/SkSurfacePriv.h"
@@ -1676,7 +1675,7 @@
auto ii = SkImageInfo::Make(rect.size(), colorType,
this->colorInfo().alphaType(),
this->colorInfo().refColorSpace());
- auto result = skstd::make_unique<AsyncReadResult>(0);
+ auto result = std::make_unique<AsyncReadResult>(0);
std::unique_ptr<char[]> data(new char[ii.computeMinByteSize()]);
SkPixmap pm(ii, data.get(), ii.minRowBytes());
result->addCpuPlane(std::move(data), pm.rowBytes());
@@ -1707,7 +1706,7 @@
std::move(transferResult)};
auto finishCallback = [](GrGpuFinishedContext c) {
const auto* context = reinterpret_cast<const FinishContext*>(c);
- auto result = skstd::make_unique<AsyncReadResult>(context->fMappedBufferManager->inboxID());
+ auto result = std::make_unique<AsyncReadResult>(context->fMappedBufferManager->inboxID());
size_t rowBytes = context->fSize.width() * SkColorTypeBytesPerPixel(context->fColorType);
if (!result->addTransferResult(context->fTransferResult, context->fSize, rowBytes,
context->fMappedBufferManager)) {
@@ -1906,7 +1905,7 @@
std::move(vTransfer)};
auto finishCallback = [](GrGpuFinishedContext c) {
const auto* context = reinterpret_cast<const FinishContext*>(c);
- auto result = skstd::make_unique<AsyncReadResult>(context->fMappedBufferManager->inboxID());
+ auto result = std::make_unique<AsyncReadResult>(context->fMappedBufferManager->inboxID());
auto manager = context->fMappedBufferManager;
size_t rowBytes = SkToSizeT(context->fSize.width());
if (!result->addTransferResult(context->fYTransfer, context->fSize, rowBytes, manager)) {
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp
index e4ae6c0..59b54b8 100644
--- a/src/gpu/GrSoftwarePathRenderer.cpp
+++ b/src/gpu/GrSoftwarePathRenderer.cpp
@@ -6,7 +6,6 @@
*/
#include "include/private/SkSemaphore.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkTaskGroup.h"
#include "src/core/SkTraceEvent.h"
#include "src/gpu/GrAuditTrail.h"
@@ -343,7 +342,7 @@
return false;
}
- auto uploader = skstd::make_unique<GrTDeferredProxyUploader<SoftwarePathData>>(
+ auto uploader = std::make_unique<GrTDeferredProxyUploader<SoftwarePathData>>(
*boundsForMask, *args.fViewMatrix, *args.fShape, aa);
GrTDeferredProxyUploader<SoftwarePathData>* uploaderRaw = uploader.get();
diff --git a/src/gpu/GrTestUtils.cpp b/src/gpu/GrTestUtils.cpp
index b348c78..88b6af4 100644
--- a/src/gpu/GrTestUtils.cpp
+++ b/src/gpu/GrTestUtils.cpp
@@ -11,7 +11,6 @@
#include "include/core/SkPath.h"
#include "include/core/SkRRect.h"
#include "include/gpu/GrContext.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkRectPriv.h"
#include "src/gpu/GrColorInfo.h"
#include "src/gpu/GrProcessorUnitTest.h"
@@ -338,7 +337,7 @@
TestAsFPArgs::TestAsFPArgs(GrProcessorTestData* d)
: fViewMatrixStorage(TestMatrix(d->fRandom))
- , fColorInfoStorage(skstd::make_unique<GrColorInfo>(
+ , fColorInfoStorage(std::make_unique<GrColorInfo>(
GrColorType::kRGBA_8888, kPremul_SkAlphaType, TestColorSpace(d->fRandom)))
, fArgs(d->context(), &fViewMatrixStorage, kNone_SkFilterQuality, fColorInfoStorage.get()) {
}
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 058f280..bbde9af 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -22,7 +22,6 @@
#include "src/core/SkImageFilterCache.h"
#include "src/core/SkImageFilter_Base.h"
#include "src/core/SkLatticeIter.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkPictureData.h"
#include "src/core/SkRRectPriv.h"
#include "src/core/SkRasterClip.h"
@@ -1316,7 +1315,7 @@
const SkIRect& center, const SkRect& dst, const SkPaint& paint) {
ASSERT_SINGLE_OWNER
uint32_t pinnedUniqueID;
- auto iter = skstd::make_unique<SkLatticeIter>(image->width(), image->height(), center, dst);
+ auto iter = std::make_unique<SkLatticeIter>(image->width(), image->height(), center, dst);
if (sk_sp<GrTextureProxy> proxy = as_IB(image)->refPinnedTextureProxy(this->context(),
&pinnedUniqueID)) {
GrTextureAdjuster adjuster(this->context(), std::move(proxy),
@@ -1337,7 +1336,7 @@
void SkGpuDevice::drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst, const SkPaint& paint) {
ASSERT_SINGLE_OWNER
- auto iter = skstd::make_unique<SkLatticeIter>(bitmap.width(), bitmap.height(), center, dst);
+ auto iter = std::make_unique<SkLatticeIter>(bitmap.width(), bitmap.height(), center, dst);
GrBitmapTextureMaker maker(fContext.get(), bitmap);
this->drawProducerLattice(&maker, std::move(iter), dst, paint);
}
@@ -1380,7 +1379,7 @@
const SkPaint& paint) {
ASSERT_SINGLE_OWNER
uint32_t pinnedUniqueID;
- auto iter = skstd::make_unique<SkLatticeIter>(lattice, dst);
+ auto iter = std::make_unique<SkLatticeIter>(lattice, dst);
if (sk_sp<GrTextureProxy> proxy = as_IB(image)->refPinnedTextureProxy(this->context(),
&pinnedUniqueID)) {
GrTextureAdjuster adjuster(this->context(), std::move(proxy),
@@ -1402,7 +1401,7 @@
const SkCanvas::Lattice& lattice, const SkRect& dst,
const SkPaint& paint) {
ASSERT_SINGLE_OWNER
- auto iter = skstd::make_unique<SkLatticeIter>(lattice, dst);
+ auto iter = std::make_unique<SkLatticeIter>(lattice, dst);
GrBitmapTextureMaker maker(fContext.get(), bitmap);
this->drawProducerLattice(&maker, std::move(iter), dst, paint);
}
diff --git a/src/gpu/ccpr/GrCCAtlas.cpp b/src/gpu/ccpr/GrCCAtlas.cpp
index ea7e6b9..5657b00 100644
--- a/src/gpu/ccpr/GrCCAtlas.cpp
+++ b/src/gpu/ccpr/GrCCAtlas.cpp
@@ -9,7 +9,6 @@
#include "include/gpu/GrTexture.h"
#include "src/core/SkIPoint16.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkMathPriv.h"
#include "src/gpu/GrCaps.h"
#include "src/gpu/GrOnFlushResourceProvider.h"
@@ -111,7 +110,7 @@
fHeight = SkTMin(specs.fMinHeight + kPadding, fMaxTextureSize);
}
- fTopNode = skstd::make_unique<Node>(nullptr, 0, 0, fWidth, fHeight);
+ fTopNode = std::make_unique<Node>(nullptr, 0, 0, fWidth, fHeight);
fTextureProxy = MakeLazyAtlasProxy(
[this](GrResourceProvider* resourceProvider, GrPixelConfig pixelConfig,
@@ -163,11 +162,11 @@
if (fHeight <= fWidth) {
int top = fHeight;
fHeight = SkTMin(fHeight * 2, fMaxTextureSize);
- fTopNode = skstd::make_unique<Node>(std::move(fTopNode), 0, top, fWidth, fHeight);
+ fTopNode = std::make_unique<Node>(std::move(fTopNode), 0, top, fWidth, fHeight);
} else {
int left = fWidth;
fWidth = SkTMin(fWidth * 2, fMaxTextureSize);
- fTopNode = skstd::make_unique<Node>(std::move(fTopNode), left, 0, fWidth, fHeight);
+ fTopNode = std::make_unique<Node>(std::move(fTopNode), left, 0, fWidth, fHeight);
}
} while (!fTopNode->addRect(w, h, loc, fMaxTextureSize));
diff --git a/src/gpu/ccpr/GrCCClipProcessor.cpp b/src/gpu/ccpr/GrCCClipProcessor.cpp
index 76293e2..5bf6a57 100644
--- a/src/gpu/ccpr/GrCCClipProcessor.cpp
+++ b/src/gpu/ccpr/GrCCClipProcessor.cpp
@@ -8,7 +8,6 @@
#include "src/gpu/ccpr/GrCCClipProcessor.h"
#include "include/gpu/GrTexture.h"
-#include "src/core/SkMakeUnique.h"
#include "src/gpu/GrTextureProxy.h"
#include "src/gpu/ccpr/GrCCClipPath.h"
#include "src/gpu/glsl/GrGLSLFragmentProcessor.h"
@@ -26,7 +25,7 @@
}
std::unique_ptr<GrFragmentProcessor> GrCCClipProcessor::clone() const {
- return skstd::make_unique<GrCCClipProcessor>(
+ return std::make_unique<GrCCClipProcessor>(
fClipPath, IsCoverageCount(fIsCoverageCount), MustCheckBounds(fMustCheckBounds));
}
diff --git a/src/gpu/ccpr/GrCCCoverageProcessor.cpp b/src/gpu/ccpr/GrCCCoverageProcessor.cpp
index be90497..bbe0bdd 100644
--- a/src/gpu/ccpr/GrCCCoverageProcessor.cpp
+++ b/src/gpu/ccpr/GrCCCoverageProcessor.cpp
@@ -7,7 +7,6 @@
#include "src/gpu/ccpr/GrCCCoverageProcessor.h"
-#include "src/core/SkMakeUnique.h"
#include "src/gpu/GrOpFlushState.h"
#include "src/gpu/GrOpsRenderPass.h"
#include "src/gpu/GrProgramInfo.h"
@@ -181,16 +180,16 @@
switch (fPrimitiveType) {
case PrimitiveType::kTriangles:
case PrimitiveType::kWeightedTriangles:
- shader = skstd::make_unique<TriangleShader>();
+ shader = std::make_unique<TriangleShader>();
break;
case PrimitiveType::kQuadratics:
- shader = skstd::make_unique<GrCCQuadraticShader>();
+ shader = std::make_unique<GrCCQuadraticShader>();
break;
case PrimitiveType::kCubics:
- shader = skstd::make_unique<GrCCCubicShader>();
+ shader = std::make_unique<GrCCCubicShader>();
break;
case PrimitiveType::kConics:
- shader = skstd::make_unique<GrCCConicShader>();
+ shader = std::make_unique<GrCCConicShader>();
break;
}
return this->onCreateGLSLInstance(std::move(shader));
diff --git a/src/gpu/ccpr/GrCCPerFlushResources.cpp b/src/gpu/ccpr/GrCCPerFlushResources.cpp
index 1469dfe..2043702 100644
--- a/src/gpu/ccpr/GrCCPerFlushResources.cpp
+++ b/src/gpu/ccpr/GrCCPerFlushResources.cpp
@@ -8,7 +8,6 @@
#include "src/gpu/ccpr/GrCCPerFlushResources.h"
#include "include/private/GrRecordingContext.h"
-#include "src/core/SkMakeUnique.h"
#include "src/gpu/GrClip.h"
#include "src/gpu/GrMemoryPool.h"
#include "src/gpu/GrOnFlushResourceProvider.h"
diff --git a/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp b/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
index a1c044e..ab13d86 100644
--- a/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
+++ b/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
@@ -8,7 +8,6 @@
#include "src/gpu/ccpr/GrCoverageCountingPathRenderer.h"
#include "include/pathops/SkPathOps.h"
-#include "src/core/SkMakeUnique.h"
#include "src/gpu/GrCaps.h"
#include "src/gpu/GrClip.h"
#include "src/gpu/GrProxyProvider.h"
@@ -67,7 +66,7 @@
CoverageType coverageType, AllowCaching allowCaching, uint32_t contextUniqueID)
: fCoverageType(coverageType) {
if (AllowCaching::kYes == allowCaching) {
- fPathCache = skstd::make_unique<GrCCPathCache>(contextUniqueID);
+ fPathCache = std::make_unique<GrCCPathCache>(contextUniqueID);
}
}
@@ -224,7 +223,7 @@
CoverageType::kFP16_CoverageCount == fCoverageType);
auto mustCheckBounds = GrCCClipProcessor::MustCheckBounds(
!clipPath.pathDevIBounds().contains(accessRect));
- return skstd::make_unique<GrCCClipProcessor>(&clipPath, isCoverageCount, mustCheckBounds);
+ return std::make_unique<GrCCClipProcessor>(&clipPath, isCoverageCount, mustCheckBounds);
}
void GrCoverageCountingPathRenderer::preFlush(
diff --git a/src/gpu/gl/GrGLExtensions.cpp b/src/gpu/gl/GrGLExtensions.cpp
index e5a989f..3f9dbfc 100644
--- a/src/gpu/gl/GrGLExtensions.cpp
+++ b/src/gpu/gl/GrGLExtensions.cpp
@@ -9,7 +9,6 @@
#include "src/gpu/gl/GrGLDefines.h"
#include "src/gpu/gl/GrGLUtil.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkTSearch.h"
#include "src/core/SkTSort.h"
#include "src/utils/SkJSONWriter.h"
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 5aae886..61db596 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -16,7 +16,6 @@
#include "include/private/SkTo.h"
#include "src/core/SkAutoMalloc.h"
#include "src/core/SkConvertPixels.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkMipMap.h"
#include "src/core/SkTraceEvent.h"
#include "src/gpu/GrContextPriv.h"
diff --git a/src/gpu/text/GrTextContext.cpp b/src/gpu/text/GrTextContext.cpp
index f8a23fb..8924b21 100644
--- a/src/gpu/text/GrTextContext.cpp
+++ b/src/gpu/text/GrTextContext.cpp
@@ -14,7 +14,6 @@
#include "src/core/SkDraw.h"
#include "src/core/SkDrawProcs.h"
#include "src/core/SkGlyphRun.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkMaskFilterBase.h"
#include "src/core/SkPaintPriv.h"
#include "src/gpu/GrCaps.h"
diff --git a/src/image/SkSurface.cpp b/src/image/SkSurface.cpp
index a5c9ac0..866bb7a 100644
--- a/src/image/SkSurface.cpp
+++ b/src/image/SkSurface.cpp
@@ -12,7 +12,6 @@
#include "include/gpu/GrBackendSurface.h"
#include "src/core/SkAutoPixmapStorage.h"
#include "src/core/SkImagePriv.h"
-#include "src/core/SkMakeUnique.h"
#include "src/image/SkSurface_Base.h"
static SkPixelGeometry compute_default_geometry() {
@@ -212,7 +211,7 @@
std::unique_ptr<const char[]> fData;
size_t fRowBytes;
};
- callback(context, skstd::make_unique<Result>(std::move(data), rowBytes));
+ callback(context, std::make_unique<Result>(std::move(data), rowBytes));
} else {
callback(context, nullptr);
}
diff --git a/src/lazy/SkDiscardableMemoryPool.cpp b/src/lazy/SkDiscardableMemoryPool.cpp
index bf6df9f..e147586 100644
--- a/src/lazy/SkDiscardableMemoryPool.cpp
+++ b/src/lazy/SkDiscardableMemoryPool.cpp
@@ -9,7 +9,6 @@
#include "include/private/SkMutex.h"
#include "include/private/SkTemplates.h"
#include "src/core/SkDiscardableMemory.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkTInternalLList.h"
#include "src/lazy/SkDiscardableMemoryPool.h"
@@ -168,7 +167,7 @@
if (nullptr == addr) {
return nullptr;
}
- auto dm = skstd::make_unique<PoolDiscardableMemory>(sk_ref_sp(this), std::move(addr), bytes);
+ auto dm = std::make_unique<PoolDiscardableMemory>(sk_ref_sp(this), std::move(addr), bytes);
SkAutoMutexExclusive autoMutexAcquire(fMutex);
fList.addToHead(dm.get());
fUsed += bytes;
diff --git a/src/pdf/SkDeflate.cpp b/src/pdf/SkDeflate.cpp
index f803c17..097f85e 100644
--- a/src/pdf/SkDeflate.cpp
+++ b/src/pdf/SkDeflate.cpp
@@ -10,7 +10,6 @@
#include "include/core/SkData.h"
#include "include/private/SkMalloc.h"
#include "include/private/SkTo.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkTraceEvent.h"
#include "zlib.h"
@@ -66,7 +65,7 @@
SkDeflateWStream::SkDeflateWStream(SkWStream* out,
int compressionLevel,
bool gzip)
- : fImpl(skstd::make_unique<SkDeflateWStream::Impl>()) {
+ : fImpl(std::make_unique<SkDeflateWStream::Impl>()) {
fImpl->fOut = out;
fImpl->fInBufferIndex = 0;
if (!fImpl->fOut) {
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index 7e88509..615dc14 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -30,7 +30,6 @@
#include "src/core/SkGlyphRun.h"
#include "src/core/SkImageFilterCache.h"
#include "src/core/SkImageFilter_Base.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkMaskFilterBase.h"
#include "src/core/SkRasterClip.h"
#include "src/core/SkScopeExit.h"
@@ -1020,7 +1019,7 @@
fActiveStackState = SkPDFGraphicStackState();
}
if (fContent.bytesWritten() == 0) {
- return skstd::make_unique<SkMemoryStream>();
+ return std::make_unique<SkMemoryStream>();
}
SkDynamicMemoryWStream buffer;
if (fInitialTransform.getType() != SkMatrix::kIdentity_Mask) {
diff --git a/src/pdf/SkPDFDocument.cpp b/src/pdf/SkPDFDocument.cpp
index abf3015..e16b732 100644
--- a/src/pdf/SkPDFDocument.cpp
+++ b/src/pdf/SkPDFDocument.cpp
@@ -11,7 +11,6 @@
#include "include/core/SkStream.h"
#include "include/docs/SkPDFDocument.h"
#include "include/private/SkTo.h"
-#include "src/core/SkMakeUnique.h"
#include "src/pdf/SkPDFDevice.h"
#include "src/pdf/SkPDFFont.h"
#include "src/pdf/SkPDFGradientShader.h"
diff --git a/src/pdf/SkPDFFont.cpp b/src/pdf/SkPDFFont.cpp
index f1c0142..502050f 100644
--- a/src/pdf/SkPDFFont.cpp
+++ b/src/pdf/SkPDFFont.cpp
@@ -29,7 +29,6 @@
#include "include/private/SkTo.h"
#include "src/core/SkGlyph.h"
#include "src/core/SkImagePriv.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkMask.h"
#include "src/core/SkScalerContext.h"
#include "src/core/SkStrike.h"
@@ -119,7 +118,7 @@
}
std::unique_ptr<SkAdvancedTypefaceMetrics> metrics = typeface->getAdvancedMetrics();
if (!metrics) {
- metrics = skstd::make_unique<SkAdvancedTypefaceMetrics>();
+ metrics = std::make_unique<SkAdvancedTypefaceMetrics>();
}
if (0 == metrics->fStemV || 0 == metrics->fCapHeight) {
diff --git a/src/pdf/SkPDFTypes.cpp b/src/pdf/SkPDFTypes.cpp
index 9a74fd2..ec92b82 100644
--- a/src/pdf/SkPDFTypes.cpp
+++ b/src/pdf/SkPDFTypes.cpp
@@ -11,7 +11,6 @@
#include "include/core/SkExecutor.h"
#include "include/core/SkStream.h"
#include "include/private/SkTo.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkStreamPriv.h"
#include "src/pdf/SkDeflate.h"
#include "src/pdf/SkPDFDocumentPriv.h"
diff --git a/src/pdf/SkPDFTypes.h b/src/pdf/SkPDFTypes.h
index 06c90e2..1555a4c 100644
--- a/src/pdf/SkPDFTypes.h
+++ b/src/pdf/SkPDFTypes.h
@@ -13,7 +13,6 @@
#include "include/core/SkTypes.h"
#include "include/private/SkTHash.h"
#include "include/private/SkTo.h"
-#include "src/core/SkMakeUnique.h"
#include <new>
#include <type_traits>
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp
index 34f9f47..da0d497 100644
--- a/src/ports/SkFontHost_FreeType.cpp
+++ b/src/ports/SkFontHost_FreeType.cpp
@@ -22,7 +22,6 @@
#include "src/core/SkFDot6.h"
#include "src/core/SkFontDescriptor.h"
#include "src/core/SkGlyph.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkMask.h"
#include "src/core/SkMaskGamma.h"
#include "src/core/SkScalerContext.h"
@@ -699,7 +698,7 @@
SkScalerContext* SkTypeface_FreeType::onCreateScalerContext(const SkScalerContextEffects& effects,
const SkDescriptor* desc) const {
- auto c = skstd::make_unique<SkScalerContext_FreeType>(
+ auto c = std::make_unique<SkScalerContext_FreeType>(
sk_ref_sp(const_cast<SkTypeface_FreeType*>(this)), effects, desc);
if (!c->success()) {
return nullptr;
@@ -722,7 +721,7 @@
axisValues, name);
int ttcIndex;
std::unique_ptr<SkStreamAsset> stream = this->openStream(&ttcIndex);
- return skstd::make_unique<SkFontData>(std::move(stream), ttcIndex, axisValues.get(),
+ return std::make_unique<SkFontData>(std::move(stream), ttcIndex, axisValues.get(),
axisDefinitions.count());
}
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index 3a997ec..7650b04 100644
--- a/src/ports/SkFontHost_mac.cpp
+++ b/src/ports/SkFontHost_mac.cpp
@@ -39,7 +39,6 @@
#include "src/core/SkEndian.h"
#include "src/core/SkFontDescriptor.h"
#include "src/core/SkGlyph.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkMaskGamma.h"
#include "src/core/SkMathPriv.h"
#include "src/core/SkTypefaceCache.h"
@@ -2086,10 +2085,10 @@
CFIndex cgAxisCount;
SkAutoSTMalloc<4, SkFixed> axisValues;
if (get_variations(fFontRef.get(), &cgAxisCount, &axisValues)) {
- return skstd::make_unique<SkFontData>(std::move(stream), index,
+ return std::make_unique<SkFontData>(std::move(stream), index,
axisValues.get(), cgAxisCount);
}
- return skstd::make_unique<SkFontData>(std::move(stream), index, nullptr, 0);
+ return std::make_unique<SkFontData>(std::move(stream), index, nullptr, 0);
}
/** Creates a CT variation dictionary {tag, value} from a CG variation dictionary {name, value}. */
diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp
index 115ca2d..873c3f3 100644
--- a/src/ports/SkFontHost_win.cpp
+++ b/src/ports/SkFontHost_win.cpp
@@ -25,7 +25,6 @@
#include "src/core/SkFontDescriptor.h"
#include "src/core/SkGlyph.h"
#include "src/core/SkLeanWindows.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkMaskGamma.h"
#include "src/core/SkTypefaceCache.h"
#include "src/core/SkUtils.h"
@@ -2026,7 +2025,7 @@
SkScalerContext* LogFontTypeface::onCreateScalerContext(const SkScalerContextEffects& effects,
const SkDescriptor* desc) const {
- auto ctx = skstd::make_unique<SkScalerContext_GDI>(
+ auto ctx = std::make_unique<SkScalerContext_GDI>(
sk_ref_sp(const_cast<LogFontTypeface*>(this)), effects, desc);
if (!ctx->isValid()) {
return nullptr;
diff --git a/src/ports/SkFontMgr_FontConfigInterface.cpp b/src/ports/SkFontMgr_FontConfigInterface.cpp
index 23986cb..aec2863 100644
--- a/src/ports/SkFontMgr_FontConfigInterface.cpp
+++ b/src/ports/SkFontMgr_FontConfigInterface.cpp
@@ -13,7 +13,6 @@
#include "include/ports/SkFontMgr_FontConfigInterface.h"
#include "include/private/SkMutex.h"
#include "src/core/SkFontDescriptor.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkResourceCache.h"
#include "src/core/SkTypefaceCache.h"
#include "src/ports/SkFontConfigTypeface.h"
@@ -35,11 +34,11 @@
std::unique_ptr<SkFontData> SkTypeface_FCI::onMakeFontData() const {
if (fFontData) {
- return skstd::make_unique<SkFontData>(*fFontData);
+ return std::make_unique<SkFontData>(*fFontData);
}
const SkFontConfigInterface::FontIdentity& id = this->getIdentity();
- return skstd::make_unique<SkFontData>(std::unique_ptr<SkStreamAsset>(fFCI->openStream(id)),
+ return std::make_unique<SkFontData>(std::unique_ptr<SkStreamAsset>(fFCI->openStream(id)),
id.fTTCIndex, nullptr, 0);
}
@@ -243,7 +242,7 @@
return nullptr;
}
- auto fontData = skstd::make_unique<SkFontData>(std::move(stream), ttcIndex, nullptr, 0);
+ auto fontData = std::make_unique<SkFontData>(std::move(stream), ttcIndex, nullptr, 0);
return sk_sp<SkTypeface>(SkTypeface_FCI::Create(std::move(fontData), std::move(name),
style, isFixedPitch));
}
@@ -273,7 +272,7 @@
Scanner::computeAxisValues(axisDefinitions, args.getVariationDesignPosition(),
axisValues, name);
- auto fontData = skstd::make_unique<SkFontData>(std::move(stream),
+ auto fontData = std::make_unique<SkFontData>(std::move(stream),
args.getCollectionIndex(),
axisValues.get(),
axisDefinitions.count());
diff --git a/src/ports/SkFontMgr_android.cpp b/src/ports/SkFontMgr_android.cpp
index 5642402..0931fbf 100644
--- a/src/ports/SkFontMgr_android.cpp
+++ b/src/ports/SkFontMgr_android.cpp
@@ -20,7 +20,6 @@
#include "include/private/SkTDArray.h"
#include "include/private/SkTemplates.h"
#include "src/core/SkFontDescriptor.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkOSFile.h"
#include "src/core/SkTSearch.h"
#include "src/core/SkTypefaceCache.h"
@@ -78,7 +77,7 @@
std::unique_ptr<SkStreamAsset> makeStream() const {
if (fFile) {
sk_sp<SkData> data(SkData::MakeFromFILE(fFile));
- return data ? skstd::make_unique<SkMemoryStream>(std::move(data)) : nullptr;
+ return data ? std::make_unique<SkMemoryStream>(std::move(data)) : nullptr;
}
return SkStream::MakeFromFile(fPathName.c_str());
}
@@ -95,7 +94,7 @@
return this->makeStream();
}
std::unique_ptr<SkFontData> onMakeFontData() const override {
- return skstd::make_unique<SkFontData>(this->makeStream(), fIndex,
+ return std::make_unique<SkFontData>(this->makeStream(), fIndex,
fAxes.begin(), fAxes.count());
}
sk_sp<SkTypeface> onMakeClone(const SkFontArguments& args) const override {
@@ -149,7 +148,7 @@
}
std::unique_ptr<SkFontData> onMakeFontData() const override {
- return skstd::make_unique<SkFontData>(*fData);
+ return std::make_unique<SkFontData>(*fData);
}
sk_sp<SkTypeface> onMakeClone(const SkFontArguments& args) const override {
@@ -463,7 +462,7 @@
if (!fScanner.scanFont(stream.get(), ttcIndex, &name, &style, &isFixedPitch, nullptr)) {
return nullptr;
}
- auto data = skstd::make_unique<SkFontData>(std::move(stream), ttcIndex, nullptr, 0);
+ auto data = std::make_unique<SkFontData>(std::move(stream), ttcIndex, nullptr, 0);
return sk_sp<SkTypeface>(new SkTypeface_AndroidStream(std::move(data),
style, isFixedPitch, name));
}
@@ -485,7 +484,7 @@
Scanner::computeAxisValues(axisDefinitions, args.getVariationDesignPosition(),
axisValues, name);
- auto data = skstd::make_unique<SkFontData>(std::move(stream), args.getCollectionIndex(),
+ auto data = std::make_unique<SkFontData>(std::move(stream), args.getCollectionIndex(),
axisValues.get(), axisDefinitions.count());
return sk_sp<SkTypeface>(new SkTypeface_AndroidStream(std::move(data),
style, isFixedPitch, name));
diff --git a/src/ports/SkFontMgr_custom.cpp b/src/ports/SkFontMgr_custom.cpp
index 6ee4e54..8be11e8 100644
--- a/src/ports/SkFontMgr_custom.cpp
+++ b/src/ports/SkFontMgr_custom.cpp
@@ -16,7 +16,6 @@
#include "include/private/SkTArray.h"
#include "include/private/SkTemplates.h"
#include "src/core/SkFontDescriptor.h"
-#include "src/core/SkMakeUnique.h"
#include "src/ports/SkFontHost_FreeType_common.h"
#include "src/ports/SkFontMgr_custom.h"
@@ -67,7 +66,7 @@
}
std::unique_ptr<SkFontData> SkTypeface_Stream::onMakeFontData() const {
- return skstd::make_unique<SkFontData>(*fData);
+ return std::make_unique<SkFontData>(*fData);
}
sk_sp<SkTypeface> SkTypeface_Stream::onMakeClone(const SkFontArguments& args) const {
@@ -227,7 +226,7 @@
}
sk_sp<SkTypeface> SkFontMgr_Custom::onMakeFromData(sk_sp<SkData> data, int ttcIndex) const {
- return this->makeFromStream(skstd::make_unique<SkMemoryStream>(std::move(data)), ttcIndex);
+ return this->makeFromStream(std::make_unique<SkMemoryStream>(std::move(data)), ttcIndex);
}
sk_sp<SkTypeface> SkFontMgr_Custom::onMakeFromStreamIndex(std::unique_ptr<SkStreamAsset> stream,
@@ -252,7 +251,7 @@
SkAutoSTMalloc<4, SkFixed> axisValues(axisDefinitions.count());
Scanner::computeAxisValues(axisDefinitions, position, axisValues, name);
- auto data = skstd::make_unique<SkFontData>(std::move(stream), args.getCollectionIndex(),
+ auto data = std::make_unique<SkFontData>(std::move(stream), args.getCollectionIndex(),
axisValues.get(), axisDefinitions.count());
return sk_sp<SkTypeface>(new SkTypeface_Stream(std::move(data), style, isFixedPitch, false, name));
}
diff --git a/src/ports/SkFontMgr_custom_embedded.cpp b/src/ports/SkFontMgr_custom_embedded.cpp
index 45a3151..924dc5a 100644
--- a/src/ports/SkFontMgr_custom_embedded.cpp
+++ b/src/ports/SkFontMgr_custom_embedded.cpp
@@ -7,7 +7,6 @@
#include "include/core/SkStream.h"
#include "src/core/SkFontDescriptor.h"
-#include "src/core/SkMakeUnique.h"
#include "src/ports/SkFontMgr_custom.h"
struct SkEmbeddedResource { const uint8_t* data; size_t size; };
@@ -77,7 +76,7 @@
const uint8_t* data, size_t size, int index,
SkFontMgr_Custom::Families* families)
{
- auto stream = skstd::make_unique<SkMemoryStream>(data, size, false);
+ auto stream = std::make_unique<SkMemoryStream>(data, size, false);
int numFaces;
if (!scanner.recognizedFont(stream.get(), &numFaces)) {
@@ -101,7 +100,7 @@
addTo = new SkFontStyleSet_Custom(realname);
families->push_back().reset(addTo);
}
- auto data = skstd::make_unique<SkFontData>(std::move(stream), faceIndex, nullptr, 0);
+ auto data = std::make_unique<SkFontData>(std::move(stream), faceIndex, nullptr, 0);
addTo->appendTypeface(sk_make_sp<SkTypeface_Stream>(std::move(data),
style, isFixedPitch,
true, realname));
diff --git a/src/ports/SkFontMgr_fontconfig.cpp b/src/ports/SkFontMgr_fontconfig.cpp
index 5131562..6e8d1b0 100644
--- a/src/ports/SkFontMgr_fontconfig.cpp
+++ b/src/ports/SkFontMgr_fontconfig.cpp
@@ -20,7 +20,6 @@
#include "include/private/SkTemplates.h"
#include "src/core/SkAdvancedTypefaceMetrics.h"
#include "src/core/SkFontDescriptor.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkOSFile.h"
#include "src/core/SkTypefaceCache.h"
#include "src/ports/SkFontHost_FreeType_common.h"
@@ -443,7 +442,7 @@
}
std::unique_ptr<SkFontData> onMakeFontData() const override {
- return skstd::make_unique<SkFontData>(*fData);
+ return std::make_unique<SkFontData>(*fData);
}
sk_sp<SkTypeface> onMakeClone(const SkFontArguments& args) const override {
@@ -972,7 +971,7 @@
return nullptr;
}
- auto data = skstd::make_unique<SkFontData>(std::move(stream), ttcIndex, nullptr, 0);
+ auto data = std::make_unique<SkFontData>(std::move(stream), ttcIndex, nullptr, 0);
return sk_sp<SkTypeface>(new SkTypeface_stream(std::move(data), std::move(name),
style, isFixedWidth));
}
@@ -994,14 +993,14 @@
Scanner::computeAxisValues(axisDefinitions, args.getVariationDesignPosition(),
axisValues, name);
- auto data = skstd::make_unique<SkFontData>(std::move(stream), args.getCollectionIndex(),
+ auto data = std::make_unique<SkFontData>(std::move(stream), args.getCollectionIndex(),
axisValues.get(), axisDefinitions.count());
return sk_sp<SkTypeface>(new SkTypeface_stream(std::move(data), std::move(name),
style, isFixedPitch));
}
sk_sp<SkTypeface> onMakeFromData(sk_sp<SkData> data, int ttcIndex) const override {
- return this->makeFromStream(skstd::make_unique<SkMemoryStream>(std::move(data)), ttcIndex);
+ return this->makeFromStream(std::make_unique<SkMemoryStream>(std::move(data)), ttcIndex);
}
sk_sp<SkTypeface> onMakeFromFile(const char path[], int ttcIndex) const override {
diff --git a/src/ports/SkFontMgr_win_dw.cpp b/src/ports/SkFontMgr_win_dw.cpp
index acf5919..9f9c26f 100644
--- a/src/ports/SkFontMgr_win_dw.cpp
+++ b/src/ports/SkFontMgr_win_dw.cpp
@@ -15,7 +15,6 @@
#include "include/core/SkTypes.h"
#include "include/private/SkMutex.h"
#include "src/core/SkEndian.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkTypefaceCache.h"
#include "src/ports/SkTypeface_win_dw.h"
#include "src/utils/SkUTF.h"
@@ -1038,7 +1037,7 @@
}
sk_sp<SkTypeface> SkFontMgr_DirectWrite::onMakeFromData(sk_sp<SkData> data, int ttcIndex) const {
- return this->makeFromStream(skstd::make_unique<SkMemoryStream>(std::move(data)), ttcIndex);
+ return this->makeFromStream(std::make_unique<SkMemoryStream>(std::move(data)), ttcIndex);
}
sk_sp<SkTypeface> SkFontMgr_DirectWrite::onMakeFromFile(const char path[], int ttcIndex) const {
diff --git a/src/ports/SkImageGeneratorWIC.cpp b/src/ports/SkImageGeneratorWIC.cpp
index cea31ad..c49f9db 100644
--- a/src/ports/SkImageGeneratorWIC.cpp
+++ b/src/ports/SkImageGeneratorWIC.cpp
@@ -8,7 +8,6 @@
#include "include/core/SkStream.h"
#include "include/ports/SkImageGeneratorWIC.h"
#include "include/private/SkTemplates.h"
-#include "src/core/SkMakeUnique.h"
#include "src/utils/win/SkIStream.h"
#include "src/utils/win/SkTScopedComPtr.h"
@@ -60,7 +59,7 @@
SkTScopedComPtr<IStream> iStream;
// Note that iStream will take ownership of the new memory stream because
// we set |deleteOnRelease| to true.
- hr = SkIStream::CreateFromSkStream(skstd::make_unique<SkMemoryStream>(data), &iStream);
+ hr = SkIStream::CreateFromSkStream(std::make_unique<SkMemoryStream>(data), &iStream);
if (FAILED(hr)) {
return nullptr;
}
diff --git a/src/shaders/SkPerlinNoiseShader.cpp b/src/shaders/SkPerlinNoiseShader.cpp
index 46cf30c..307d2d8 100644
--- a/src/shaders/SkPerlinNoiseShader.cpp
+++ b/src/shaders/SkPerlinNoiseShader.cpp
@@ -12,7 +12,6 @@
#include "include/core/SkString.h"
#include "include/core/SkUnPreMultiply.h"
#include "src/core/SkArenaAlloc.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkReadBuffer.h"
#include "src/core/SkWriteBuffer.h"
@@ -1414,7 +1413,7 @@
SkASSERT(!fStitchTiles || !fTileSize.isEmpty());
std::unique_ptr<SkPerlinNoiseShaderImpl::PaintingData> paintingData =
- skstd::make_unique<SkPerlinNoiseShaderImpl::PaintingData>(fTileSize,
+ std::make_unique<SkPerlinNoiseShaderImpl::PaintingData>(fTileSize,
fSeed,
fBaseFrequencyX,
fBaseFrequencyY,
diff --git a/src/svg/SkSVGCanvas.cpp b/src/svg/SkSVGCanvas.cpp
index 30c9198..631c2c2 100644
--- a/src/svg/SkSVGCanvas.cpp
+++ b/src/svg/SkSVGCanvas.cpp
@@ -6,7 +6,6 @@
*/
#include "include/svg/SkSVGCanvas.h"
-#include "src/core/SkMakeUnique.h"
#include "src/svg/SkSVGDevice.h"
#include "src/xml/SkXMLWriter.h"
@@ -18,9 +17,9 @@
: 0;
auto svgDevice = SkSVGDevice::Make(size,
- skstd::make_unique<SkXMLStreamWriter>(writer, xml_flags),
+ std::make_unique<SkXMLStreamWriter>(writer, xml_flags),
flags);
- return svgDevice ? skstd::make_unique<SkCanvas>(std::move(svgDevice))
+ return svgDevice ? std::make_unique<SkCanvas>(std::move(svgDevice))
: nullptr;
}
diff --git a/src/svg/SkSVGDevice.cpp b/src/svg/SkSVGDevice.cpp
index cb84960..62b6f6f 100644
--- a/src/svg/SkSVGDevice.cpp
+++ b/src/svg/SkSVGDevice.cpp
@@ -30,7 +30,6 @@
#include "src/core/SkClipStack.h"
#include "src/core/SkDraw.h"
#include "src/core/SkFontPriv.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkUtils.h"
#include "src/shaders/SkShaderBase.h"
#include "src/xml/SkXMLWriter.h"
@@ -741,7 +740,7 @@
while (elem) {
const auto cid = define_clip(elem);
- auto clip_grp = skstd::make_unique<AutoElement>("g", fWriter);
+ auto clip_grp = std::make_unique<AutoElement>("g", fWriter);
clip_grp->addAttribute("clip-path", SkStringPrintf("url(#%s)", cid.c_str()));
fClipStack.push_back({ std::move(clip_grp), elem->getGenID() });
diff --git a/src/utils/SkLua.cpp b/src/utils/SkLua.cpp
index c634d5b..a42489d 100644
--- a/src/utils/SkLua.cpp
+++ b/src/utils/SkLua.cpp
@@ -32,7 +32,6 @@
#include "include/effects/SkImageFilters.h"
#include "include/private/SkTo.h"
#include "modules/skshaper/include/SkShaper.h"
-#include "src/core/SkMakeUnique.h"
#include <new>
extern "C" {
@@ -1771,7 +1770,7 @@
if (!filename) {
return 0;
}
- auto file = skstd::make_unique<SkFILEWStream>(filename);
+ auto file = std::make_unique<SkFILEWStream>(filename);
if (!file->isValid()) {
return 0;
}
diff --git a/src/utils/SkNullCanvas.cpp b/src/utils/SkNullCanvas.cpp
index b01a4c4..3179282 100644
--- a/src/utils/SkNullCanvas.cpp
+++ b/src/utils/SkNullCanvas.cpp
@@ -9,7 +9,6 @@
#include "include/core/SkCanvas.h"
#include "include/utils/SkNWayCanvas.h"
-#include "src/core/SkMakeUnique.h"
std::unique_ptr<SkCanvas> SkMakeNullCanvas() {
// An N-Way canvas forwards calls to N canvas's. When N == 0 it's
diff --git a/src/xps/SkXPSDevice.cpp b/src/xps/SkXPSDevice.cpp
index b789651..554c58c 100644
--- a/src/xps/SkXPSDevice.cpp
+++ b/src/xps/SkXPSDevice.cpp
@@ -40,7 +40,6 @@
#include "src/core/SkEndian.h"
#include "src/core/SkGeometry.h"
#include "src/core/SkImagePriv.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkMaskFilterBase.h"
#include "src/core/SkRasterClip.h"
#include "src/core/SkStrikeCache.h"
diff --git a/tests/CachedDecodingPixelRefTest.cpp b/tests/CachedDecodingPixelRefTest.cpp
index f4fa442..284960e 100644
--- a/tests/CachedDecodingPixelRefTest.cpp
+++ b/tests/CachedDecodingPixelRefTest.cpp
@@ -14,7 +14,6 @@
#include "include/core/SkRefCnt.h"
#include "include/core/SkTypes.h"
#include "include/private/SkColorData.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkUtils.h"
#include "tests/Test.h"
#include "tools/ToolUtils.h"
@@ -100,7 +99,7 @@
for (size_t i = 0; i < SK_ARRAY_COUNT(testTypes); ++i) {
TestImageGenerator::TestType test = testTypes[i];
for (const SkColorType testColorType : testColorTypes) {
- auto gen = skstd::make_unique<TestImageGenerator>(test, r, testColorType);
+ auto gen = std::make_unique<TestImageGenerator>(test, r, testColorType);
sk_sp<SkImage> image(SkImage::MakeFromGenerator(std::move(gen)));
if (nullptr == image) {
ERRORF(r, "SkImage::NewFromGenerator unexpecedly failed ["
diff --git a/tests/CodecAnimTest.cpp b/tests/CodecAnimTest.cpp
index 44446bc..3555441 100644
--- a/tests/CodecAnimTest.cpp
+++ b/tests/CodecAnimTest.cpp
@@ -18,7 +18,6 @@
#include "include/core/SkString.h"
#include "include/core/SkTypes.h"
#include "include/utils/SkAnimCodecPlayer.h"
-#include "src/core/SkMakeUnique.h"
#include "tests/CodecPriv.h"
#include "tests/Test.h"
#include "tools/Resources.h"
@@ -481,7 +480,7 @@
auto codec = SkCodec::MakeFromData(GetResourceAsData(test.fFile));
REPORTER_ASSERT(r, codec);
- auto player = skstd::make_unique<SkAnimCodecPlayer>(std::move(codec));
+ auto player = std::make_unique<SkAnimCodecPlayer>(std::move(codec));
if (player->duration() != test.fDuration) {
printf("*** %d vs %d\n", player->duration(), test.fDuration);
}
diff --git a/tests/CodecExactReadTest.cpp b/tests/CodecExactReadTest.cpp
index 6b77120..5bf4f00 100644
--- a/tests/CodecExactReadTest.cpp
+++ b/tests/CodecExactReadTest.cpp
@@ -12,7 +12,6 @@
#include "include/core/SkRefCnt.h"
#include "include/core/SkStream.h"
#include "include/private/SkTemplates.h"
-#include "src/core/SkMakeUnique.h"
#include "tests/Test.h"
#include "tools/Resources.h"
@@ -76,7 +75,7 @@
SkMemoryStream stream(std::move(multiData));
for (int i = 0; i < kNumImages; ++i) {
std::unique_ptr<SkCodec> codec(SkCodec::MakeFromStream(
- skstd::make_unique<UnowningStream>(&stream)));
+ std::make_unique<UnowningStream>(&stream)));
if (!codec) {
ERRORF(r, "Failed to create a codec from %s, iteration %i", path, i);
continue;
diff --git a/tests/CodecPartialTest.cpp b/tests/CodecPartialTest.cpp
index 62b744d..0ab6bdf 100644
--- a/tests/CodecPartialTest.cpp
+++ b/tests/CodecPartialTest.cpp
@@ -13,7 +13,6 @@
#include "include/core/SkStream.h"
#include "include/core/SkString.h"
#include "include/core/SkTypes.h"
-#include "src/core/SkMakeUnique.h"
#include "tests/CodecPriv.h"
#include "tests/FakeStreams.h"
#include "tests/Test.h"
@@ -260,7 +259,7 @@
// This stream will be owned by fullCodec, but we hang on to the pointer
// to determine frame offsets.
- std::unique_ptr<SkCodec> fullCodec(SkCodec::MakeFromStream(skstd::make_unique<SkMemoryStream>(file)));
+ std::unique_ptr<SkCodec> fullCodec(SkCodec::MakeFromStream(std::make_unique<SkMemoryStream>(file)));
const auto info = standardize_info(fullCodec.get());
// frameByteCounts stores the number of bytes to decode a particular frame.
@@ -362,7 +361,7 @@
}
const size_t halfSize = file->size() / 2;
std::unique_ptr<SkCodec> partialCodec(SkCodec::MakeFromStream(
- skstd::make_unique<HaltingStream>(std::move(file), halfSize)));
+ std::make_unique<HaltingStream>(std::move(file), halfSize)));
if (!partialCodec) {
ERRORF(r, "Failed to create codec for %s", name);
return;
@@ -532,7 +531,7 @@
for (size_t len = 14; len <= file->size(); len += 5) {
SkCodec::Result result;
std::unique_ptr<SkCodec> codec(SkCodec::MakeFromStream(
- skstd::make_unique<SkMemoryStream>(file->data(), len), &result));
+ std::make_unique<SkMemoryStream>(file->data(), len), &result));
if (codec) {
if (result != SkCodec::kSuccess) {
ERRORF(r, "Created an SkCodec for %s with %lu bytes, but "
diff --git a/tests/CodecTest.cpp b/tests/CodecTest.cpp
index f597e06..a51da73 100644
--- a/tests/CodecTest.cpp
+++ b/tests/CodecTest.cpp
@@ -38,7 +38,6 @@
#include "src/core/SkAutoMalloc.h"
#include "src/core/SkColorSpacePriv.h"
#include "src/core/SkMD5.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkStreamPriv.h"
#include "tests/FakeStreams.h"
#include "tests/Test.h"
@@ -542,9 +541,9 @@
static void test_invalid_stream(skiatest::Reporter* r, const void* stream, size_t len) {
// Neither of these calls should return a codec. Bots should catch us if we leaked anything.
REPORTER_ASSERT(r, !SkCodec::MakeFromStream(
- skstd::make_unique<SkMemoryStream>(stream, len, false)));
+ std::make_unique<SkMemoryStream>(stream, len, false)));
REPORTER_ASSERT(r, !SkAndroidCodec::MakeFromStream(
- skstd::make_unique<SkMemoryStream>(stream, len, false)));
+ std::make_unique<SkMemoryStream>(stream, len, false)));
}
// Ensure that SkCodec::NewFromStream handles freeing the passed in SkStream,
@@ -877,7 +876,7 @@
}
std::unique_ptr<SkCodec> codec(SkCodec::MakeFromStream(
- skstd::make_unique<NotAssetMemStream>(std::move(data))));
+ std::make_unique<NotAssetMemStream>(std::move(data))));
REPORTER_ASSERT(r, codec);
test_info(r, codec.get(), codec->getInfo(), SkCodec::kSuccess, nullptr);
@@ -896,13 +895,13 @@
// The limit is less than webp needs to peek or read.
std::unique_ptr<SkCodec> codec(SkCodec::MakeFromStream(
- skstd::make_unique<LimitedPeekingMemStream>(data, 25)));
+ std::make_unique<LimitedPeekingMemStream>(data, 25)));
REPORTER_ASSERT(r, codec);
test_info(r, codec.get(), codec->getInfo(), SkCodec::kSuccess, nullptr);
// Similarly, a stream which does not peek should still succeed.
- codec = SkCodec::MakeFromStream(skstd::make_unique<LimitedPeekingMemStream>(data, 0));
+ codec = SkCodec::MakeFromStream(std::make_unique<LimitedPeekingMemStream>(data, 0));
REPORTER_ASSERT(r, codec);
test_info(r, codec.get(), codec->getInfo(), SkCodec::kSuccess, nullptr);
diff --git a/tests/GrMeshTest.cpp b/tests/GrMeshTest.cpp
index 3363768..e6ba1c7 100644
--- a/tests/GrMeshTest.cpp
+++ b/tests/GrMeshTest.cpp
@@ -12,7 +12,6 @@
#include "include/core/SkBitmap.h"
#include "include/gpu/GrContext.h"
#include "include/private/GrResourceKey.h"
-#include "src/core/SkMakeUnique.h"
#include "src/gpu/GrCaps.h"
#include "src/gpu/GrContextPriv.h"
#include "src/gpu/GrGeometryProcessor.h"
diff --git a/tests/GrPipelineDynamicStateTest.cpp b/tests/GrPipelineDynamicStateTest.cpp
index 9ab35f0..13c4628 100644
--- a/tests/GrPipelineDynamicStateTest.cpp
+++ b/tests/GrPipelineDynamicStateTest.cpp
@@ -10,7 +10,6 @@
#include "include/gpu/GrContext.h"
#include "include/private/GrRecordingContext.h"
-#include "src/core/SkMakeUnique.h"
#include "src/gpu/GrColor.h"
#include "src/gpu/GrContextPriv.h"
#include "src/gpu/GrGeometryProcessor.h"
diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp
index 5675236..02d7d1d 100644
--- a/tests/ImageTest.cpp
+++ b/tests/ImageTest.cpp
@@ -25,7 +25,6 @@
#include "src/core/SkAutoPixmapStorage.h"
#include "src/core/SkColorSpacePriv.h"
#include "src/core/SkImagePriv.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkUtils.h"
#include "src/gpu/GrContextPriv.h"
#include "src/gpu/GrGpu.h"
@@ -614,7 +613,7 @@
REPORTER_ASSERT(reporter, nullptr == SkImage::MakeRasterData(info, nullptr, 0));
REPORTER_ASSERT(reporter, nullptr == SkImage::MakeFromRaster(pmap, nullptr, nullptr));
REPORTER_ASSERT(reporter, nullptr == SkImage::MakeFromGenerator(
- skstd::make_unique<EmptyGenerator>()));
+ std::make_unique<EmptyGenerator>()));
}
DEF_TEST(ImageDataRef, reporter) {
diff --git a/tests/LazyProxyTest.cpp b/tests/LazyProxyTest.cpp
index 25499d0..3045cd0 100644
--- a/tests/LazyProxyTest.cpp
+++ b/tests/LazyProxyTest.cpp
@@ -10,7 +10,6 @@
#include "include/gpu/GrTexture.h"
#include "include/gpu/mock/GrMockTypes.h"
#include "src/core/SkExchange.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkRectPriv.h"
#include "src/gpu/GrClip.h"
#include "src/gpu/GrContextPriv.h"
@@ -154,7 +153,7 @@
private:
const char* name() const override { return "LazyProxyTest::ClipFP"; }
std::unique_ptr<GrFragmentProcessor> clone() const override {
- return skstd::make_unique<ClipFP>(fContext, fProxyProvider, fTest, fAtlas);
+ return std::make_unique<ClipFP>(fContext, fProxyProvider, fTest, fAtlas);
}
GrGLSLFragmentProcessor* onCreateGLSLInstance() const override { return nullptr; }
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override {}
@@ -180,7 +179,7 @@
bool apply(GrRecordingContext* context, GrRenderTargetContext*, bool useHWAA,
bool hasUserStencilSettings, GrAppliedClip* out, SkRect* bounds) const override {
GrProxyProvider* proxyProvider = context->priv().proxyProvider();
- out->addCoverageFP(skstd::make_unique<ClipFP>(context, proxyProvider, fTest, fAtlas));
+ out->addCoverageFP(std::make_unique<ClipFP>(context, proxyProvider, fTest, fAtlas));
return true;
}
bool quickContains(const SkRect&) const final { return false; }
diff --git a/tests/PDFPrimitivesTest.cpp b/tests/PDFPrimitivesTest.cpp
index f85e67e..f6169b3 100644
--- a/tests/PDFPrimitivesTest.cpp
+++ b/tests/PDFPrimitivesTest.cpp
@@ -22,7 +22,6 @@
#include "include/private/SkTo.h"
#include "src/core/SkGlyphRun.h"
#include "src/core/SkImageFilter_Base.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkReadBuffer.h"
#include "src/core/SkSpecialImage.h"
#include "src/pdf/SkClusterator.h"
diff --git a/tests/SVGDeviceTest.cpp b/tests/SVGDeviceTest.cpp
index 71d1fba..5e61bbd 100644
--- a/tests/SVGDeviceTest.cpp
+++ b/tests/SVGDeviceTest.cpp
@@ -24,7 +24,6 @@
#include "include/private/SkTo.h"
#include "include/svg/SkSVGCanvas.h"
#include "include/utils/SkParse.h"
-#include "src/core/SkMakeUnique.h"
#include "src/shaders/SkImageShader.h"
#include "tests/Test.h"
#include "tools/ToolUtils.h"
@@ -39,9 +38,9 @@
static std::unique_ptr<SkCanvas> MakeDOMCanvas(SkDOM* dom, uint32_t flags = 0) {
auto svgDevice = SkSVGDevice::Make(SkISize::Make(100, 100),
- skstd::make_unique<SkXMLParserWriter>(dom->beginParsing()),
+ std::make_unique<SkXMLParserWriter>(dom->beginParsing()),
flags);
- return svgDevice ? skstd::make_unique<SkCanvas>(svgDevice)
+ return svgDevice ? std::make_unique<SkCanvas>(svgDevice)
: nullptr;
}
diff --git a/tests/SerializationTest.cpp b/tests/SerializationTest.cpp
index 979d7b1..db6cd9d 100644
--- a/tests/SerializationTest.cpp
+++ b/tests/SerializationTest.cpp
@@ -18,7 +18,6 @@
#include "include/private/SkTemplates.h"
#include "src/core/SkAnnotationKeys.h"
#include "src/core/SkFontDescriptor.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkMatrixPriv.h"
#include "src/core/SkNormalSource.h"
#include "src/core/SkOSFile.h"
@@ -386,7 +385,7 @@
} else {
SkFixed axis = SK_FixedSqrt2;
sk_sp<SkTypeface> typeface(SkTypeface::MakeFromFontData(
- skstd::make_unique<SkFontData>(std::move(distortable), 0, &axis, 1)));
+ std::make_unique<SkFontData>(std::move(distortable), 0, &axis, 1)));
if (!typeface) {
INFOF(reporter, "Could not run fontstream test because Distortable.ttf not created.");
} else {
diff --git a/tests/SkResourceCacheTest.cpp b/tests/SkResourceCacheTest.cpp
index 57b781e..cfa6325 100644
--- a/tests/SkResourceCacheTest.cpp
+++ b/tests/SkResourceCacheTest.cpp
@@ -11,7 +11,6 @@
#include "include/core/SkPictureRecorder.h"
#include "include/core/SkSurface.h"
#include "src/core/SkBitmapCache.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkMipMap.h"
#include "src/core/SkResourceCache.h"
#include "src/image/SkImage_Base.h"
@@ -246,8 +245,8 @@
int flags0 = 0, flags1 = 0;
- auto rec0 = skstd::make_unique<TestRec>(sharedID, data, &flags0);
- auto rec1 = skstd::make_unique<TestRec>(sharedID, data, &flags1);
+ auto rec0 = std::make_unique<TestRec>(sharedID, data, &flags0);
+ auto rec1 = std::make_unique<TestRec>(sharedID, data, &flags1);
SkASSERT(rec0->getKey() == rec1->getKey());
TestRec* r0 = rec0.get(); // save the bare-pointer since we will release rec0
diff --git a/tests/StreamBufferTest.cpp b/tests/StreamBufferTest.cpp
index 67e596c..ce3c5f9 100644
--- a/tests/StreamBufferTest.cpp
+++ b/tests/StreamBufferTest.cpp
@@ -8,7 +8,6 @@
#include "include/core/SkData.h"
#include "include/core/SkStream.h"
#include "src/codec/SkStreamBuffer.h"
-#include "src/core/SkMakeUnique.h"
#include "src/utils/SkOSPath.h"
#include "tests/FakeStreams.h"
@@ -95,11 +94,11 @@
std::function<std::unique_ptr<SkStream>()> createStream;
bool skipIfNoTmpDir;
} factories[] = {
- { [&data]() { return skstd::make_unique<SkMemoryStream>(data); }, false },
- { [&data]() { return skstd::make_unique<NotAssetMemStream>(data); }, false },
+ { [&data]() { return std::make_unique<SkMemoryStream>(data); }, false },
+ { [&data]() { return std::make_unique<NotAssetMemStream>(data); }, false },
{ [&path]() { return path.isEmpty()
? nullptr
- : skstd::make_unique<SkFILEStream>(path.c_str()); }, true },
+ : std::make_unique<SkFILEStream>(path.c_str()); }, true },
};
for (auto f : factories) {
@@ -112,7 +111,7 @@
}
// Stream that will receive more data. Will be owned by the SkStreamBuffer.
- auto halting = skstd::make_unique<HaltingStream>(data, 6);
+ auto halting = std::make_unique<HaltingStream>(data, 6);
HaltingStream* peekHalting = halting.get();
SkStreamBuffer buffer(std::move(halting));
diff --git a/tests/TypefaceTest.cpp b/tests/TypefaceTest.cpp
index 84adbe1..a389c8f 100644
--- a/tests/TypefaceTest.cpp
+++ b/tests/TypefaceTest.cpp
@@ -16,7 +16,6 @@
#include "src/core/SkFontDescriptor.h"
#include "src/core/SkFontMgrPriv.h"
#include "src/core/SkFontPriv.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkTypefaceCache.h"
#include "src/sfnt/SkOTTable_OS_2.h"
#include "src/sfnt/SkSFNTHeader.h"
@@ -119,8 +118,8 @@
DEF_TEST(FontDescriptorNegativeVariationSerialize, reporter) {
SkFontDescriptor desc;
SkFixed axis = -SK_Fixed1;
- auto font = skstd::make_unique<SkMemoryStream>("a", 1, false);
- desc.setFontData(skstd::make_unique<SkFontData>(std::move(font), 0, &axis, 1));
+ auto font = std::make_unique<SkMemoryStream>("a", 1, false);
+ desc.setFontData(std::make_unique<SkFontData>(std::move(font), 0, &axis, 1));
SkDynamicMemoryWStream stream;
desc.serialize(&stream);
diff --git a/tests/VptrTest.cpp b/tests/VptrTest.cpp
index d6d52a8..4613d86 100644
--- a/tests/VptrTest.cpp
+++ b/tests/VptrTest.cpp
@@ -5,7 +5,6 @@
* found in the LICENSE file.
*/
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkVptr.h"
#include "tests/Test.h"
@@ -33,10 +32,10 @@
}
DEF_TEST(Vptr, r) {
- std::unique_ptr<Base> a = skstd::make_unique<SubclassA>(21),
- b = skstd::make_unique<SubclassB>(),
- c = skstd::make_unique<SubclassA>(22),
- d = skstd::make_unique<SubclassB>();
+ std::unique_ptr<Base> a = std::make_unique<SubclassA>(21),
+ b = std::make_unique<SubclassB>(),
+ c = std::make_unique<SubclassA>(22),
+ d = std::make_unique<SubclassB>();
// These 4 objects all have unique identities.
REPORTER_ASSERT(r, a != b);
diff --git a/tools/fonts/RandomScalerContext.cpp b/tools/fonts/RandomScalerContext.cpp
index 85430f5..1fe188a 100644
--- a/tools/fonts/RandomScalerContext.cpp
+++ b/tools/fonts/RandomScalerContext.cpp
@@ -10,7 +10,6 @@
#include "include/core/SkPath.h"
#include "src/core/SkAdvancedTypefaceMetrics.h"
#include "src/core/SkGlyph.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkRectPriv.h"
#include "tools/fonts/RandomScalerContext.h"
diff --git a/tools/viewer/SlideDir.cpp b/tools/viewer/SlideDir.cpp
index 27eed20..b532d00 100644
--- a/tools/viewer/SlideDir.cpp
+++ b/tools/viewer/SlideDir.cpp
@@ -19,7 +19,6 @@
#include "modules/sksg/include/SkSGScene.h"
#include "modules/sksg/include/SkSGText.h"
#include "modules/sksg/include/SkSGTransform.h"
-#include "src/core/SkMakeUnique.h"
#include "tools/timer/TimeUtils.h"
#include <cmath>
@@ -329,7 +328,7 @@
const auto focusRect = SkRect::MakeSize(fWinSize).makeInset(kFocusInset.width(),
kFocusInset.height());
- fFocusController = skstd::make_unique<FocusController>(this, focusRect);
+ fFocusController = std::make_unique<FocusController>(this, focusRect);
}
void SlideDir::unload() {
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index ec9d523..f28337f 100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -17,7 +17,6 @@
#include "src/core/SkColorSpacePriv.h"
#include "src/core/SkImagePriv.h"
#include "src/core/SkMD5.h"
-#include "src/core/SkMakeUnique.h"
#include "src/core/SkOSFile.h"
#include "src/core/SkScan.h"
#include "src/core/SkTaskGroup.h"