aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@google.com>2016-03-10 11:31:27 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-10 11:31:27 -0800
commit977c07dad26fbb56f6d4b5fc1ac1a324d28bd693 (patch)
tree93016a3da1a43ada575ff1557716e97833f5a87d /src
parent7e6fcf890a1a63249136b8e6d9f4d5a606ef7508 (diff)
Revert of Use std::unique_ptr. (patchset #7 id:120001 of https://codereview.chromium.org/1780933003/ )
Reason for revert: Now we remember! The problem was Clank: https://build.chromium.org/p/tryserver.chromium.android/builders/android_clang_dbg_recipe/builds/34329 Original issue's description: > Use std::unique_ptr. > > TBR=reed@google.com > > Committed: https://skia.googlesource.com/skia/+/20c1e3abfc681771f73eb19fde7284196e028940 TBR=bungeman@google.com,mtklein@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1782973002
Diffstat (limited to 'src')
-rw-r--r--src/core/SkGlyphCache.h4
-rw-r--r--src/core/SkSharedMutex.h8
-rw-r--r--src/gpu/GrLayerAtlas.cpp6
-rw-r--r--src/gpu/text/GrStencilAndCoverTextContext.cpp2
-rw-r--r--src/pdf/SkPDFDevice.cpp4
-rw-r--r--src/pdf/SkPDFDevice.h2
-rw-r--r--src/ports/SkFontHost_FreeType.cpp6
7 files changed, 16 insertions, 16 deletions
diff --git a/src/core/SkGlyphCache.h b/src/core/SkGlyphCache.h
index 8d6bae6992..2c49530e7c 100644
--- a/src/core/SkGlyphCache.h
+++ b/src/core/SkGlyphCache.h
@@ -272,7 +272,7 @@ private:
AuxProcRec* fAuxProcList;
};
-class SkAutoGlyphCache : public std::unique_ptr<SkGlyphCache, SkGlyphCache::AttachCacheFunctor> {
+class SkAutoGlyphCache : public skstd::unique_ptr<SkGlyphCache, SkGlyphCache::AttachCacheFunctor> {
public:
/** deprecated: use get() */
SkGlyphCache* getCache() const { return this->get(); }
@@ -294,7 +294,7 @@ public:
: INHERITED(paint.detachCache(surfaceProps, fakeGamma, matrix))
{}
private:
- using INHERITED = std::unique_ptr<SkGlyphCache, SkGlyphCache::AttachCacheFunctor>;
+ using INHERITED = skstd::unique_ptr<SkGlyphCache, SkGlyphCache::AttachCacheFunctor>;
};
class SkAutoGlyphCacheNoGamma : public SkAutoGlyphCache {
diff --git a/src/core/SkSharedMutex.h b/src/core/SkSharedMutex.h
index 21c9f46d64..840c2d36ad 100644
--- a/src/core/SkSharedMutex.h
+++ b/src/core/SkSharedMutex.h
@@ -14,7 +14,7 @@
#ifdef SK_DEBUG
#include "SkMutex.h"
- #include <memory>
+ #include "SkUniquePtr.h"
#endif // SK_DEBUG
// There are two shared lock implementations one debug the other is high performance. They implement
@@ -50,9 +50,9 @@ public:
private:
#ifdef SK_DEBUG
class ThreadIDSet;
- std::unique_ptr<ThreadIDSet> fCurrentShared;
- std::unique_ptr<ThreadIDSet> fWaitingExclusive;
- std::unique_ptr<ThreadIDSet> fWaitingShared;
+ skstd::unique_ptr<ThreadIDSet> fCurrentShared;
+ skstd::unique_ptr<ThreadIDSet> fWaitingExclusive;
+ skstd::unique_ptr<ThreadIDSet> fWaitingShared;
int fSharedQueueSelect{0};
mutable SkMutex fMu;
SkSemaphore fSharedQueue[2];
diff --git a/src/gpu/GrLayerAtlas.cpp b/src/gpu/GrLayerAtlas.cpp
index c1f8732b35..df8215a607 100644
--- a/src/gpu/GrLayerAtlas.cpp
+++ b/src/gpu/GrLayerAtlas.cpp
@@ -12,7 +12,7 @@
#include "GrTextureProvider.h"
///////////////////////////////////////////////////////////////////////////////
-GrLayerAtlas::Plot::Plot()
+GrLayerAtlas::Plot::Plot()
: fID(-1)
, fRects(nullptr) {
fOffset.set(0, 0);
@@ -54,7 +54,7 @@ bool GrLayerAtlas::reattachBackingTexture() {
SkASSERT(!fTexture);
fTexture.reset(fTexProvider->findAndRefTextureByUniqueKey(get_layer_atlas_key()));
- return fTexture != nullptr;
+ return SkToBool(fTexture);
}
void GrLayerAtlas::createBackingTexture() {
@@ -71,7 +71,7 @@ void GrLayerAtlas::createBackingTexture() {
fTexture->resourcePriv().setUniqueKey(get_layer_atlas_key());
}
-GrLayerAtlas::GrLayerAtlas(GrTextureProvider* texProvider, GrPixelConfig config,
+GrLayerAtlas::GrLayerAtlas(GrTextureProvider* texProvider, GrPixelConfig config,
GrSurfaceFlags flags,
const SkISize& backingTextureSize,
int numPlotsX, int numPlotsY) {
diff --git a/src/gpu/text/GrStencilAndCoverTextContext.cpp b/src/gpu/text/GrStencilAndCoverTextContext.cpp
index 661f22512d..ab9025d316 100644
--- a/src/gpu/text/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp
@@ -329,7 +329,7 @@ class GrStencilAndCoverTextContext::FallbackBlobBuilder {
public:
FallbackBlobBuilder() : fBuffIdx(0), fCount(0) {}
- bool isInitialized() const { return fBuilder != nullptr; }
+ bool isInitialized() const { return SkToBool(fBuilder); }
void init(const SkPaint& font, SkScalar textRatio);
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index 57b5269423..744d42d25e 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -1533,10 +1533,10 @@ sk_sp<SkPDFArray> SkPDFDevice::copyMediaBox() const {
return mediaBox;
}
-std::unique_ptr<SkStreamAsset> SkPDFDevice::content() const {
+skstd::unique_ptr<SkStreamAsset> SkPDFDevice::content() const {
SkDynamicMemoryWStream buffer;
this->writeContent(&buffer);
- return std::unique_ptr<SkStreamAsset>(
+ return skstd::unique_ptr<SkStreamAsset>(
buffer.bytesWritten() > 0
? buffer.detachAsStream()
: new SkMemoryStream);
diff --git a/src/pdf/SkPDFDevice.h b/src/pdf/SkPDFDevice.h
index b214839f5a..b1345a8e3f 100644
--- a/src/pdf/SkPDFDevice.h
+++ b/src/pdf/SkPDFDevice.h
@@ -168,7 +168,7 @@ public:
/** Returns a SkStream with the page contents.
*/
- std::unique_ptr<SkStreamAsset> content() const;
+ skstd::unique_ptr<SkStreamAsset> content() const;
/** Writes the page contents to the stream. */
void writeContent(SkWStream*) const;
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp
index f01c7d7cc5..9230507662 100644
--- a/src/ports/SkFontHost_FreeType.cpp
+++ b/src/ports/SkFontHost_FreeType.cpp
@@ -25,7 +25,7 @@
#include "SkString.h"
#include "SkTemplates.h"
#include "SkTypes.h"
-#include <memory>
+#include "SkUniquePtr.h"
#if defined(SK_CAN_USE_DLOPEN)
#include <dlfcn.h>
@@ -802,7 +802,7 @@ SkScalerContext_FreeType::SkScalerContext_FreeType(SkTypeface* typeface, const S
// load the font file
using UnrefFTFace = SkFunctionWrapper<void, skstd::remove_pointer_t<FT_Face>, unref_ft_face>;
- std::unique_ptr<skstd::remove_pointer_t<FT_Face>, UnrefFTFace> ftFace(ref_ft_face(typeface));
+ skstd::unique_ptr<skstd::remove_pointer_t<FT_Face>, UnrefFTFace> ftFace(ref_ft_face(typeface));
if (nullptr == ftFace) {
SkDEBUGF(("Could not create FT_Face.\n"));
return;
@@ -891,7 +891,7 @@ SkScalerContext_FreeType::SkScalerContext_FreeType(SkTypeface* typeface, const S
}
using DoneFTSize = SkFunctionWrapper<FT_Error, skstd::remove_pointer_t<FT_Size>, FT_Done_Size>;
- std::unique_ptr<skstd::remove_pointer_t<FT_Size>, DoneFTSize> ftSize([&ftFace]() -> FT_Size {
+ skstd::unique_ptr<skstd::remove_pointer_t<FT_Size>, DoneFTSize> ftSize([&ftFace]() -> FT_Size {
FT_Size size;
FT_Error err = FT_New_Size(ftFace.get(), &size);
if (err != 0) {