aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Kevin Lubick <kjlubick@google.com>2017-01-11 17:21:57 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-11 17:22:12 +0000
commitc456b73fef9589bbdc5eb83eaa83e53c357bb3da (patch)
treebcb8f75efaf1523bc781fa592f56d7ff86598c32 /src
parentbc6b99d22e8d9f6543ffffdc846e40e8075046c5 (diff)
Revert "SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h"
This reverts commit a5494f117086d712855e4b6289c58c92d1549bcf. Reason for revert: Broke Google3 Original change's description: > SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h > > * SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr). > > * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h > > * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);" > > Change-Id: Idacd86ca09e22bf092422228599ae0d9bedded88 > Reviewed-on: https://skia-review.googlesource.com/4543 > Reviewed-by: Ben Wagner <bungeman@google.com> > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Hal Canary <halcanary@google.com> > TBR=halcanary@google.com,bungeman@google.com,reed@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ie8bd176121c3ee83c110d66c0d0ac65e09bfc9c5 Reviewed-on: https://skia-review.googlesource.com/6884 Commit-Queue: Kevin Lubick <kjlubick@google.com> Reviewed-by: Kevin Lubick <kjlubick@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/core/SkAAClip.h1
-rw-r--r--src/core/SkAutoMalloc.h174
-rw-r--r--src/core/SkBlitter.h2
-rw-r--r--src/core/SkColorSpace_ICC.cpp3
-rw-r--r--src/core/SkDistanceFieldGen.cpp2
-rw-r--r--src/core/SkFontStream.cpp1
-rw-r--r--src/core/SkICC.cpp1
-rw-r--r--src/core/SkLinearBitmapPipeline_sample.h1
-rw-r--r--src/core/SkMaskFilter.cpp8
-rw-r--r--src/core/SkPictureData.cpp3
-rw-r--r--src/core/SkScalerContext.cpp9
-rw-r--r--src/core/SkScan_AAAPath.cpp5
-rw-r--r--src/effects/gradients/SkGradientShaderPriv.h10
-rw-r--r--src/gpu/GrDistanceFieldGenFromVector.cpp10
-rw-r--r--src/gpu/GrYUVProvider.cpp1
-rw-r--r--src/gpu/SkGr.cpp6
-rw-r--r--src/gpu/gl/GrGLGpu.cpp16
-rw-r--r--src/gpu/gl/builders/GrGLProgramBuilder.cpp1
-rw-r--r--src/gpu/gl/builders/GrGLShaderStringBuilder.cpp7
-rw-r--r--src/gpu/ops/GrAADistanceFieldPathRenderer.cpp1
-rw-r--r--src/gpu/ops/GrMSAAPathRenderer.cpp5
-rw-r--r--src/gpu/text/GrAtlasGlyphCache.cpp1
-rw-r--r--src/gpu/vk/GrVkBackendContext.cpp1
-rw-r--r--src/gpu/vk/GrVkPipelineStateDataManager.h1
-rw-r--r--src/pipe/SkPipeCanvas.cpp5
-rw-r--r--src/ports/SkFontConfigInterface_direct.cpp2
-rw-r--r--src/ports/SkFontHost_FreeType.cpp1
-rw-r--r--src/ports/SkFontHost_mac.cpp1
-rw-r--r--src/ports/SkImageEncoder_WIC.cpp4
29 files changed, 40 insertions, 243 deletions
diff --git a/src/core/SkAAClip.h b/src/core/SkAAClip.h
index c94756fd5f..7b29ef142a 100644
--- a/src/core/SkAAClip.h
+++ b/src/core/SkAAClip.h
@@ -8,7 +8,6 @@
#ifndef SkAAClip_DEFINED
#define SkAAClip_DEFINED
-#include "SkAutoMalloc.h"
#include "SkBlitter.h"
#include "SkRegion.h"
diff --git a/src/core/SkAutoMalloc.h b/src/core/SkAutoMalloc.h
deleted file mode 100644
index 7be882547d..0000000000
--- a/src/core/SkAutoMalloc.h
+++ /dev/null
@@ -1,174 +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 SkAutoMalloc_DEFINED
-#define SkAutoMalloc_DEFINED
-
-#include "SkTypes.h"
-
-#include <memory>
-
-/**
- * Manage an allocated block of heap memory. This object is the sole manager of
- * the lifetime of the block, so the caller must not call sk_free() or delete
- * on the block, unless release() was called.
- */
-class SkAutoMalloc : SkNoncopyable {
-public:
- explicit SkAutoMalloc(size_t size = 0)
- : fPtr(size ? sk_malloc_throw(size) : nullptr), fSize(size) {}
-
- /**
- * Passed to reset to specify what happens if the requested size is smaller
- * than the current size (and the current block was dynamically allocated).
- */
- enum OnShrink {
- /**
- * If the requested size is smaller than the current size, and the
- * current block is dynamically allocated, free the old block and
- * malloc a new block of the smaller size.
- */
- kAlloc_OnShrink,
-
- /**
- * If the requested size is smaller than the current size, and the
- * current block is dynamically allocated, just return the old
- * block.
- */
- kReuse_OnShrink
- };
-
- /**
- * Reallocates the block to a new size. The ptr may or may not change.
- */
- void* reset(size_t size = 0, OnShrink shrink = kAlloc_OnShrink) {
- if (size != fSize && (size > fSize || kReuse_OnShrink != shrink)) {
- fPtr.reset(size ? sk_malloc_throw(size) : nullptr);
- fSize = size;
- }
- return fPtr.get();
- }
-
- /**
- * Return the allocated block.
- */
- void* get() { return fPtr.get(); }
- const void* get() const { return fPtr.get(); }
-
- /** Transfer ownership of the current ptr to the caller, setting the
- internal reference to null. Note the caller is reponsible for calling
- sk_free on the returned address.
- */
- void* release() {
- fSize = 0;
- return fPtr.release();
- }
-
-private:
- struct WrapFree {
- void operator()(void* p) { sk_free(p); }
- };
- std::unique_ptr<void, WrapFree> fPtr;
- size_t fSize; // can be larger than the requested size (see kReuse)
-};
-#define SkAutoMalloc(...) SK_REQUIRE_LOCAL_VAR(SkAutoMalloc)
-
-/**
- * Manage an allocated block of memory. If the requested size is <= kSizeRequested (or slightly
- * more), then the allocation will come from the stack rather than the heap. This object is the
- * sole manager of the lifetime of the block, so the caller must not call sk_free() or delete on
- * the block.
- */
-template <size_t kSizeRequested> class SkAutoSMalloc : SkNoncopyable {
-public:
- /**
- * Creates initially empty storage. get() returns a ptr, but it is to a zero-byte allocation.
- * Must call reset(size) to return an allocated block.
- */
- SkAutoSMalloc() {
- fPtr = fStorage;
- fSize = kSize;
- }
-
- /**
- * Allocate a block of the specified size. If size <= kSizeRequested (or slightly more), then
- * the allocation will come from the stack, otherwise it will be dynamically allocated.
- */
- explicit SkAutoSMalloc(size_t size) {
- fPtr = fStorage;
- fSize = kSize;
- this->reset(size);
- }
-
- /**
- * Free the allocated block (if any). If the block was small enough to have been allocated on
- * the stack, then this does nothing.
- */
- ~SkAutoSMalloc() {
- if (fPtr != (void*)fStorage) {
- sk_free(fPtr);
- }
- }
-
- /**
- * Return the allocated block. May return non-null even if the block is of zero size. Since
- * this may be on the stack or dynamically allocated, the caller must not call sk_free() on it,
- * but must rely on SkAutoSMalloc to manage it.
- */
- void* get() const { return fPtr; }
-
- /**
- * Return a new block of the requested size, freeing (as necessary) any previously allocated
- * block. As with the constructor, if size <= kSizeRequested (or slightly more) then the return
- * block may be allocated locally, rather than from the heap.
- */
- void* reset(size_t size,
- SkAutoMalloc::OnShrink shrink = SkAutoMalloc::kAlloc_OnShrink,
- bool* didChangeAlloc = nullptr) {
- size = (size < kSize) ? kSize : size;
- bool alloc = size != fSize && (SkAutoMalloc::kAlloc_OnShrink == shrink || size > fSize);
- if (didChangeAlloc) {
- *didChangeAlloc = alloc;
- }
- if (alloc) {
- if (fPtr != (void*)fStorage) {
- sk_free(fPtr);
- }
-
- if (size == kSize) {
- SkASSERT(fPtr != fStorage); // otherwise we lied when setting didChangeAlloc.
- fPtr = fStorage;
- } else {
- fPtr = sk_malloc_flags(size, SK_MALLOC_THROW | SK_MALLOC_TEMP);
- }
-
- fSize = size;
- }
- SkASSERT(fSize >= size && fSize >= kSize);
- SkASSERT((fPtr == fStorage) || fSize > kSize);
- return fPtr;
- }
-
-private:
- // Align up to 32 bits.
- static const size_t kSizeAlign4 = SkAlign4(kSizeRequested);
-#if defined(GOOGLE3)
- // Stack frame size is limited for GOOGLE3. 4k is less than the actual max, but some functions
- // have multiple large stack allocations.
- static const size_t kMaxBytes = 4 * 1024;
- static const size_t kSize = kSizeRequested > kMaxBytes ? kMaxBytes : kSizeAlign4;
-#else
- static const size_t kSize = kSizeAlign4;
-#endif
-
- void* fPtr;
- size_t fSize; // can be larger than the requested size (see kReuse)
- uint32_t fStorage[kSize >> 2];
-};
-// Can't guard the constructor because it's a template class.
-
-#endif
diff --git a/src/core/SkBlitter.h b/src/core/SkBlitter.h
index fd6ca8c110..f03a308243 100644
--- a/src/core/SkBlitter.h
+++ b/src/core/SkBlitter.h
@@ -8,12 +8,12 @@
#ifndef SkBlitter_DEFINED
#define SkBlitter_DEFINED
-#include "SkAutoMalloc.h"
#include "SkBitmapProcShader.h"
#include "SkColor.h"
#include "SkRect.h"
#include "SkRegion.h"
#include "SkShader.h"
+#include "SkTypes.h"
class SkMatrix;
class SkPaint;
diff --git a/src/core/SkColorSpace_ICC.cpp b/src/core/SkColorSpace_ICC.cpp
index ff4b9018dd..29291a3e00 100644
--- a/src/core/SkColorSpace_ICC.cpp
+++ b/src/core/SkColorSpace_ICC.cpp
@@ -5,12 +5,11 @@
* found in the LICENSE file.
*/
-#include "SkAutoMalloc.h"
#include "SkColorSpace.h"
-#include "SkColorSpacePriv.h"
#include "SkColorSpace_A2B.h"
#include "SkColorSpace_Base.h"
#include "SkColorSpace_XYZ.h"
+#include "SkColorSpacePriv.h"
#include "SkEndian.h"
#include "SkFixed.h"
#include "SkICCPriv.h"
diff --git a/src/core/SkDistanceFieldGen.cpp b/src/core/SkDistanceFieldGen.cpp
index f227d6a30d..7e4675bbc1 100644
--- a/src/core/SkDistanceFieldGen.cpp
+++ b/src/core/SkDistanceFieldGen.cpp
@@ -5,10 +5,8 @@
* found in the LICENSE file.
*/
-#include "SkAutoMalloc.h"
#include "SkDistanceFieldGen.h"
#include "SkPoint.h"
-#include "SkTemplates.h"
struct DFData {
float fAlpha; // alpha value of source texel
diff --git a/src/core/SkFontStream.cpp b/src/core/SkFontStream.cpp
index e9f23f9f24..b2ffe8deba 100644
--- a/src/core/SkFontStream.cpp
+++ b/src/core/SkFontStream.cpp
@@ -5,7 +5,6 @@
* found in the LICENSE file.
*/
-#include "SkAutoMalloc.h"
#include "SkEndian.h"
#include "SkFontStream.h"
#include "SkStream.h"
diff --git a/src/core/SkICC.cpp b/src/core/SkICC.cpp
index 6b09f29dae..b47cc71574 100644
--- a/src/core/SkICC.cpp
+++ b/src/core/SkICC.cpp
@@ -5,7 +5,6 @@
* found in the LICENSE file.
*/
-#include "SkAutoMalloc.h"
#include "SkColorSpace_Base.h"
#include "SkColorSpace_XYZ.h"
#include "SkColorSpacePriv.h"
diff --git a/src/core/SkLinearBitmapPipeline_sample.h b/src/core/SkLinearBitmapPipeline_sample.h
index 0bfe8f26ae..8e53136fea 100644
--- a/src/core/SkLinearBitmapPipeline_sample.h
+++ b/src/core/SkLinearBitmapPipeline_sample.h
@@ -10,7 +10,6 @@
#include <tuple>
-#include "SkAutoMalloc.h"
#include "SkColor.h"
#include "SkColorPriv.h"
#include "SkFixed.h"
diff --git a/src/core/SkMaskFilter.cpp b/src/core/SkMaskFilter.cpp
index 8ad13aab97..85ee38d6dd 100644
--- a/src/core/SkMaskFilter.cpp
+++ b/src/core/SkMaskFilter.cpp
@@ -5,15 +5,15 @@
* found in the LICENSE file.
*/
-#include "SkMaskFilter.h"
-#include "SkAutoMalloc.h"
+#include "SkMaskFilter.h"
#include "SkBlitter.h"
-#include "SkCachedData.h"
#include "SkDraw.h"
+#include "SkCachedData.h"
#include "SkPath.h"
-#include "SkRRect.h"
#include "SkRasterClip.h"
+#include "SkRRect.h"
+#include "SkTypes.h"
#if SK_SUPPORT_GPU
#include "GrTexture.h"
diff --git a/src/core/SkPictureData.cpp b/src/core/SkPictureData.cpp
index 9780b7d104..1aff1e46b9 100644
--- a/src/core/SkPictureData.cpp
+++ b/src/core/SkPictureData.cpp
@@ -4,10 +4,7 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-
#include <new>
-
-#include "SkAutoMalloc.h"
#include "SkImageGenerator.h"
#include "SkPictureData.h"
#include "SkPictureRecord.h"
diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp
index 4835b5297d..c06222d4d8 100644
--- a/src/core/SkScalerContext.cpp
+++ b/src/core/SkScalerContext.cpp
@@ -5,9 +5,8 @@
* found in the LICENSE file.
*/
-#include "SkScalerContext.h"
-#include "SkAutoMalloc.h"
+#include "SkScalerContext.h"
#include "SkAutoPixmapStorage.h"
#include "SkColorPriv.h"
#include "SkDescriptor.h"
@@ -17,13 +16,13 @@
#include "SkMaskFilter.h"
#include "SkMaskGamma.h"
#include "SkMatrix22.h"
+#include "SkReadBuffer.h"
+#include "SkWriteBuffer.h"
#include "SkPathEffect.h"
-#include "SkRasterClip.h"
#include "SkRasterizer.h"
-#include "SkReadBuffer.h"
+#include "SkRasterClip.h"
#include "SkStroke.h"
#include "SkStrokeRec.h"
-#include "SkWriteBuffer.h"
#define ComputeBWRowBytes(width) (((unsigned)(width) + 7) >> 3)
diff --git a/src/core/SkScan_AAAPath.cpp b/src/core/SkScan_AAAPath.cpp
index 8c0a748bdf..f96e7b9bb8 100644
--- a/src/core/SkScan_AAAPath.cpp
+++ b/src/core/SkScan_AAAPath.cpp
@@ -5,11 +5,10 @@
* found in the LICENSE file.
*/
-#include "SkAnalyticEdge.h"
#include "SkAntiRun.h"
-#include "SkAutoMalloc.h"
#include "SkBlitter.h"
#include "SkEdge.h"
+#include "SkAnalyticEdge.h"
#include "SkEdgeBuilder.h"
#include "SkGeometry.h"
#include "SkPath.h"
@@ -18,8 +17,8 @@
#include "SkRegion.h"
#include "SkScan.h"
#include "SkScanPriv.h"
-#include "SkTSort.h"
#include "SkTemplates.h"
+#include "SkTSort.h"
#include "SkUtils.h"
///////////////////////////////////////////////////////////////////////////////
diff --git a/src/effects/gradients/SkGradientShaderPriv.h b/src/effects/gradients/SkGradientShaderPriv.h
index 48ccbd50d0..4b7bbb0a0a 100644
--- a/src/effects/gradients/SkGradientShaderPriv.h
+++ b/src/effects/gradients/SkGradientShaderPriv.h
@@ -10,17 +10,15 @@
#include "SkGradientBitmapCache.h"
#include "SkGradientShader.h"
-
-#include "SkAutoMalloc.h"
#include "SkClampRange.h"
#include "SkColorPriv.h"
#include "SkColorSpace.h"
-#include "SkMallocPixelRef.h"
-#include "SkOnce.h"
#include "SkReadBuffer.h"
-#include "SkShader.h"
-#include "SkUtils.h"
#include "SkWriteBuffer.h"
+#include "SkMallocPixelRef.h"
+#include "SkUtils.h"
+#include "SkShader.h"
+#include "SkOnce.h"
#if SK_SUPPORT_GPU
#define GR_GL_USE_ACCURATE_HARD_STOP_GRADIENTS 1
diff --git a/src/gpu/GrDistanceFieldGenFromVector.cpp b/src/gpu/GrDistanceFieldGenFromVector.cpp
index 4a509e67af..8179500660 100644
--- a/src/gpu/GrDistanceFieldGenFromVector.cpp
+++ b/src/gpu/GrDistanceFieldGenFromVector.cpp
@@ -7,14 +7,12 @@
#include "SkDistanceFieldGen.h"
#include "GrDistanceFieldGenFromVector.h"
-
-#include "GrConfig.h"
-#include "GrPathUtils.h"
-#include "SkAutoMalloc.h"
-#include "SkGeometry.h"
#include "SkMatrix.h"
-#include "SkPathOps.h"
#include "SkPoint.h"
+#include "SkGeometry.h"
+#include "SkPathOps.h"
+#include "GrPathUtils.h"
+#include "GrConfig.h"
/**
* If a scanline (a row of texel) cross from the kRight_SegSide
diff --git a/src/gpu/GrYUVProvider.cpp b/src/gpu/GrYUVProvider.cpp
index 9f88c72d22..6fbad18841 100644
--- a/src/gpu/GrYUVProvider.cpp
+++ b/src/gpu/GrYUVProvider.cpp
@@ -11,7 +11,6 @@
#include "effects/GrGammaEffect.h"
#include "effects/GrYUVEffect.h"
-#include "SkAutoMalloc.h"
#include "SkCachedData.h"
#include "SkRefCnt.h"
#include "SkResourceCache.h"
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index c1a4160b83..9d6072c551 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
+
#include "SkGr.h"
#include "SkGrPriv.h"
@@ -18,17 +19,16 @@
#include "GrXferProcessor.h"
#include "GrYUVProvider.h"
-#include "SkAutoMalloc.h"
#include "SkBlendModePriv.h"
-#include "SkCanvas.h"
#include "SkColorFilter.h"
#include "SkConfig8888.h"
+#include "SkCanvas.h"
#include "SkData.h"
#include "SkMaskFilter.h"
#include "SkMessageBus.h"
#include "SkMipMap.h"
-#include "SkPM4fPriv.h"
#include "SkPixelRef.h"
+#include "SkPM4fPriv.h"
#include "SkResourceCache.h"
#include "SkTemplates.h"
#include "SkYUVPlanesCache.h"
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 95a01ab695..74e52583dd 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -6,33 +6,31 @@
*/
#include "GrGLGpu.h"
-
-#include "../private/GrGLSL.h"
-#include "GrFixedClip.h"
#include "GrGLBuffer.h"
#include "GrGLGpuCommandBuffer.h"
#include "GrGLStencilAttachment.h"
#include "GrGLTextureRenderTarget.h"
+#include "GrFixedClip.h"
#include "GrGpuResourcePriv.h"
#include "GrMesh.h"
-#include "GrPLSGeometryProcessor.h"
#include "GrPipeline.h"
+#include "GrPLSGeometryProcessor.h"
#include "GrRenderTargetPriv.h"
#include "GrShaderCaps.h"
#include "GrSurfacePriv.h"
#include "GrTexturePriv.h"
#include "GrTypes.h"
-#include "SkAutoMalloc.h"
+#include "builders/GrGLShaderStringBuilder.h"
+#include "glsl/GrGLSLPLSPathRendering.h"
+#include "instanced/GLInstancedRendering.h"
#include "SkMakeUnique.h"
#include "SkMipMap.h"
#include "SkPixmap.h"
-#include "SkSLCompiler.h"
#include "SkStrokeRec.h"
+#include "SkSLCompiler.h"
#include "SkTemplates.h"
#include "SkTypes.h"
-#include "builders/GrGLShaderStringBuilder.h"
-#include "glsl/GrGLSLPLSPathRendering.h"
-#include "instanced/GLInstancedRendering.h"
+#include "../private/GrGLSL.h"
#define GL_CALL(X) GR_GL_CALL(this->glInterface(), X)
#define GL_CALL_RET(RET, X) GR_GL_CALL_RET(this->glInterface(), RET, X)
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index c3e81fb358..045593ff42 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -14,7 +14,6 @@
#include "GrShaderCaps.h"
#include "GrSwizzle.h"
#include "GrTexture.h"
-#include "SkAutoMalloc.h"
#include "SkTraceEvent.h"
#include "gl/GrGLGpu.h"
#include "gl/GrGLProgram.h"
diff --git a/src/gpu/gl/builders/GrGLShaderStringBuilder.cpp b/src/gpu/gl/builders/GrGLShaderStringBuilder.cpp
index 6c719fe305..df44edd07e 100644
--- a/src/gpu/gl/builders/GrGLShaderStringBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLShaderStringBuilder.cpp
@@ -6,12 +6,11 @@
*/
#include "GrGLShaderStringBuilder.h"
-#include "SkAutoMalloc.h"
-#include "SkSLCompiler.h"
-#include "SkSLGLSLCodeGenerator.h"
-#include "SkTraceEvent.h"
#include "gl/GrGLGpu.h"
#include "gl/GrGLSLPrettyPrint.h"
+#include "SkTraceEvent.h"
+#include "SkSLCompiler.h"
+#include "SkSLGLSLCodeGenerator.h"
#include "ir/SkSLProgram.h"
#define GL_CALL(X) GR_GL_CALL(gpu->glInterface(), X)
diff --git a/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp b/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp
index 616b69f276..c9b30f5154 100644
--- a/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp
+++ b/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp
@@ -21,7 +21,6 @@
#include "ops/GrMeshDrawOp.h"
#include "SkPathOps.h"
-#include "SkAutoMalloc.h"
#include "SkDistanceFieldGen.h"
#include "GrDistanceFieldGenFromVector.h"
diff --git a/src/gpu/ops/GrMSAAPathRenderer.cpp b/src/gpu/ops/GrMSAAPathRenderer.cpp
index 53e4690eff..cc6781cac4 100644
--- a/src/gpu/ops/GrMSAAPathRenderer.cpp
+++ b/src/gpu/ops/GrMSAAPathRenderer.cpp
@@ -16,7 +16,6 @@
#include "GrPathStencilSettings.h"
#include "GrPathUtils.h"
#include "GrPipelineBuilder.h"
-#include "SkAutoMalloc.h"
#include "SkGeometry.h"
#include "SkTraceEvent.h"
#include "gl/GrGLVaryingHandler.h"
@@ -347,7 +346,7 @@ private:
MSAAQuadVertices quads;
size_t quadVertexStride = sizeof(MSAAQuadVertices::Vertex);
- SkAutoMalloc quadVertexPtr(fMaxQuadVertices * quadVertexStride);
+ SkAutoFree quadVertexPtr(sk_malloc_throw(fMaxQuadVertices * quadVertexStride));
quads.vertices = (MSAAQuadVertices::Vertex*) quadVertexPtr.get();
quads.nextVertex = quads.vertices;
SkDEBUGCODE(quads.verticesEnd = quads.vertices + fMaxQuadVertices;)
@@ -370,7 +369,7 @@ private:
SkAutoFree quadIndexPtr;
if (fIsIndexed) {
quads.indices = (uint16_t*)sk_malloc_throw(3 * fMaxQuadVertices * sizeof(uint16_t));
- quadIndexPtr.reset(quads.indices);
+ quadIndexPtr.set(quads.indices);
quads.nextIndex = quads.indices;
} else {
quads.indices = nullptr;
diff --git a/src/gpu/text/GrAtlasGlyphCache.cpp b/src/gpu/text/GrAtlasGlyphCache.cpp
index e51f6cc381..5d85f4919d 100644
--- a/src/gpu/text/GrAtlasGlyphCache.cpp
+++ b/src/gpu/text/GrAtlasGlyphCache.cpp
@@ -11,7 +11,6 @@
#include "GrRectanizer.h"
#include "GrResourceProvider.h"
#include "GrSurfacePriv.h"
-#include "SkAutoMalloc.h"
#include "SkString.h"
#include "SkDistanceFieldGen.h"
diff --git a/src/gpu/vk/GrVkBackendContext.cpp b/src/gpu/vk/GrVkBackendContext.cpp
index 5a9de04d39..93ae01ff6f 100644
--- a/src/gpu/vk/GrVkBackendContext.cpp
+++ b/src/gpu/vk/GrVkBackendContext.cpp
@@ -5,7 +5,6 @@
* found in the LICENSE file.
*/
-#include "SkAutoMalloc.h"
#include "vk/GrVkBackendContext.h"
#include "vk/GrVkExtensions.h"
#include "vk/GrVkInterface.h"
diff --git a/src/gpu/vk/GrVkPipelineStateDataManager.h b/src/gpu/vk/GrVkPipelineStateDataManager.h
index 4a061a66f9..312c6c659d 100644
--- a/src/gpu/vk/GrVkPipelineStateDataManager.h
+++ b/src/gpu/vk/GrVkPipelineStateDataManager.h
@@ -10,7 +10,6 @@
#include "glsl/GrGLSLProgramDataManager.h"
-#include "SkAutoMalloc.h"
#include "vk/GrVkUniformHandler.h"
class GrVkGpu;
diff --git a/src/pipe/SkPipeCanvas.cpp b/src/pipe/SkPipeCanvas.cpp
index e707f0db19..33b58a4165 100644
--- a/src/pipe/SkPipeCanvas.cpp
+++ b/src/pipe/SkPipeCanvas.cpp
@@ -5,16 +5,15 @@
* found in the LICENSE file.
*/
-#include "SkAutoMalloc.h"
+#include "SkPathEffect.h"
#include "SkColorFilter.h"
#include "SkDrawLooper.h"
#include "SkImageFilter.h"
#include "SkMaskFilter.h"
-#include "SkPathEffect.h"
#include "SkPipeCanvas.h"
#include "SkPipeFormat.h"
-#include "SkRSXform.h"
#include "SkRasterizer.h"
+#include "SkRSXform.h"
#include "SkShader.h"
#include "SkStream.h"
#include "SkTextBlob.h"
diff --git a/src/ports/SkFontConfigInterface_direct.cpp b/src/ports/SkFontConfigInterface_direct.cpp
index c1a73e626c..df68fae0a8 100644
--- a/src/ports/SkFontConfigInterface_direct.cpp
+++ b/src/ports/SkFontConfigInterface_direct.cpp
@@ -7,7 +7,6 @@
/* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */
-#include "SkAutoMalloc.h"
#include "SkBuffer.h"
#include "SkDataTable.h"
#include "SkFixed.h"
@@ -20,6 +19,7 @@
#include "SkTDArray.h"
#include "SkTemplates.h"
#include "SkTypeface.h"
+#include "SkTypes.h"
#include <fontconfig/fontconfig.h>
#include <unistd.h>
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp
index 47790f3644..15bc14d213 100644
--- a/src/ports/SkFontHost_FreeType.cpp
+++ b/src/ports/SkFontHost_FreeType.cpp
@@ -25,6 +25,7 @@
#include "SkStream.h"
#include "SkString.h"
#include "SkTemplates.h"
+#include "SkTypes.h"
#include <memory>
#if defined(SK_CAN_USE_DLOPEN)
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index ce4895419f..274c9253a9 100644
--- a/src/ports/SkFontHost_mac.cpp
+++ b/src/ports/SkFontHost_mac.cpp
@@ -20,7 +20,6 @@
#endif
#include "SkAdvancedTypefaceMetrics.h"
-#include "SkAutoMalloc.h"
#include "SkCGUtils.h"
#include "SkColorPriv.h"
#include "SkDescriptor.h"
diff --git a/src/ports/SkImageEncoder_WIC.cpp b/src/ports/SkImageEncoder_WIC.cpp
index 6bc8b5473e..52f4599433 100644
--- a/src/ports/SkImageEncoder_WIC.cpp
+++ b/src/ports/SkImageEncoder_WIC.cpp
@@ -28,16 +28,14 @@
#undef INT64_MAX
#undef UINT64_MAX
+#include <wincodec.h>
#include "SkAutoCoInitialize.h"
-#include "SkAutoMalloc.h"
#include "SkBitmap.h"
#include "SkImageEncoderPriv.h"
#include "SkIStream.h"
-#include "SkImageEncoder.h"
#include "SkStream.h"
#include "SkTScopedComPtr.h"
#include "SkUnPreMultiply.h"
-#include <wincodec.h>
//All Windows SDKs back to XPSP2 export the CLSID_WICImagingFactory symbol.
//In the Windows8 SDK the CLSID_WICImagingFactory symbol is still exported