aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Herb Derby <herb@google.com>2017-03-20 11:19:23 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-20 18:40:49 +0000
commitd7b34a5ca0a9183e70737125c688d2a8b5310d81 (patch)
tree94fe551b5fe1f868fbe316a7ae4316000ac589ff /src
parent628999dd99a10a737470c5c89c44ae28b6a764bf (diff)
Make SkMemory.h and adjust all files for usage.
This will be rolled out in three stages: 1) make SkMemory.h and have SkTypes.h include it. 2) Adjust chromium and android. 3) no long include SkMemory.h in SkTypes.h Change-Id: If360ef5e1164d88f50b03f279e2e963ca2f57d5d Reviewed-on: https://skia-review.googlesource.com/9874 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/core/SkAutoMalloc.h1
-rw-r--r--src/core/SkAutoPixmapStorage.h1
-rw-r--r--src/core/SkCachedData.cpp1
-rw-r--r--src/core/SkDeque.cpp2
-rw-r--r--src/core/SkMask.cpp2
-rw-r--r--src/core/SkMetaData.cpp2
-rw-r--r--src/core/SkRWBuffer.cpp4
-rw-r--r--src/core/SkRect.cpp2
-rw-r--r--src/core/SkRegionPriv.h2
-rw-r--r--src/core/SkTLList.h2
-rw-r--r--src/core/SkTSearch.cpp3
-rw-r--r--src/core/SkVarAlloc.cpp2
-rw-r--r--src/effects/gradients/SkGradientBitmapCache.cpp2
-rw-r--r--src/gpu/GrMemoryPool.cpp2
-rw-r--r--src/gpu/GrRectanizer_pow2.h1
-rw-r--r--src/lazy/SkDiscardableMemoryPool.cpp1
-rw-r--r--src/pdf/SkDeflate.cpp1
-rw-r--r--src/ports/SkFontHost_FreeType.cpp1
-rw-r--r--src/ports/SkFontMgr_android_parser.cpp1
-rw-r--r--src/ports/SkMemory_malloc.cpp3
-rw-r--r--src/ports/SkMemory_mozalloc.cpp3
-rw-r--r--src/ports/SkOSFile_win.cpp1
-rw-r--r--src/utils/SkInterpolator.cpp3
-rw-r--r--src/utils/mac/SkStream_mac.cpp2
24 files changed, 40 insertions, 5 deletions
diff --git a/src/core/SkAutoMalloc.h b/src/core/SkAutoMalloc.h
index 7be882547d..77901a8380 100644
--- a/src/core/SkAutoMalloc.h
+++ b/src/core/SkAutoMalloc.h
@@ -9,6 +9,7 @@
#define SkAutoMalloc_DEFINED
#include "SkTypes.h"
+#include "SkMemory.h"
#include <memory>
diff --git a/src/core/SkAutoPixmapStorage.h b/src/core/SkAutoPixmapStorage.h
index 379bf420b0..ef7f23f28d 100644
--- a/src/core/SkAutoPixmapStorage.h
+++ b/src/core/SkAutoPixmapStorage.h
@@ -8,6 +8,7 @@
#ifndef SkAutoPixmapStorage_DEFINED
#define SkAutoPixmapStorage_DEFINED
+#include "SkMemory.h"
#include "SkPixmap.h"
class SK_API SkAutoPixmapStorage : public SkPixmap {
diff --git a/src/core/SkCachedData.cpp b/src/core/SkCachedData.cpp
index 1ea232b2c5..5f28c6ce35 100644
--- a/src/core/SkCachedData.cpp
+++ b/src/core/SkCachedData.cpp
@@ -7,6 +7,7 @@
#include "SkCachedData.h"
#include "SkDiscardableMemory.h"
+#include "SkMemory.h"
//#define TRACK_CACHEDDATA_LIFETIME
diff --git a/src/core/SkDeque.cpp b/src/core/SkDeque.cpp
index f9ab4af531..6639a77dc0 100644
--- a/src/core/SkDeque.cpp
+++ b/src/core/SkDeque.cpp
@@ -5,8 +5,8 @@
* found in the LICENSE file.
*/
-
#include "SkDeque.h"
+#include "SkMemory.h"
struct SkDeque::Block {
Block* fNext;
diff --git a/src/core/SkMask.cpp b/src/core/SkMask.cpp
index 111508074a..25cc65187d 100644
--- a/src/core/SkMask.cpp
+++ b/src/core/SkMask.cpp
@@ -7,6 +7,8 @@
#include "SkMask.h"
+#include "SkMemory.h"
+
//#define TRACK_SKMASK_LIFETIME
/** returns the product if it is positive and fits in 31 bits. Otherwise this
diff --git a/src/core/SkMetaData.cpp b/src/core/SkMetaData.cpp
index 6e1f5e2a3d..462325a092 100644
--- a/src/core/SkMetaData.cpp
+++ b/src/core/SkMetaData.cpp
@@ -7,6 +7,8 @@
#include "SkMetaData.h"
+
+#include "SkMemory.h"
#include "SkRefCnt.h"
struct PtrPair {
diff --git a/src/core/SkRWBuffer.cpp b/src/core/SkRWBuffer.cpp
index c97b646c15..4ef2d94c77 100644
--- a/src/core/SkRWBuffer.cpp
+++ b/src/core/SkRWBuffer.cpp
@@ -5,8 +5,10 @@
* found in the LICENSE file.
*/
-#include "SkAtomics.h"
#include "SkRWBuffer.h"
+
+#include "SkAtomics.h"
+#include "SkMemory.h"
#include "SkStream.h"
// Force small chunks to be a page's worth
diff --git a/src/core/SkRect.cpp b/src/core/SkRect.cpp
index 0b2723ab0a..d91596dc07 100644
--- a/src/core/SkRect.cpp
+++ b/src/core/SkRect.cpp
@@ -7,6 +7,8 @@
#include "SkRect.h"
+#include "SkMemory.h"
+
void SkIRect::join(int32_t left, int32_t top, int32_t right, int32_t bottom) {
// do nothing if the params are empty
if (left >= right || top >= bottom) {
diff --git a/src/core/SkRegionPriv.h b/src/core/SkRegionPriv.h
index ef369143e3..04ec0e2d47 100644
--- a/src/core/SkRegionPriv.h
+++ b/src/core/SkRegionPriv.h
@@ -10,7 +10,9 @@
#define SkRegionPriv_DEFINED
#include "SkRegion.h"
+
#include "SkAtomics.h"
+#include "SkMemory.h"
inline bool SkRegionValueIsSentinel(int32_t value) {
return value == (int32_t)SkRegion::kRunTypeSentinel;
diff --git a/src/core/SkTLList.h b/src/core/SkTLList.h
index 58fa3f4aac..c9cb2d3eac 100644
--- a/src/core/SkTLList.h
+++ b/src/core/SkTLList.h
@@ -9,6 +9,8 @@
#define SkTLList_DEFINED
#include "SkTInternalLList.h"
+
+#include "SkMemory.h"
#include "SkTypes.h"
#include <utility>
diff --git a/src/core/SkTSearch.cpp b/src/core/SkTSearch.cpp
index 9ff9777638..1744d0ad89 100644
--- a/src/core/SkTSearch.cpp
+++ b/src/core/SkTSearch.cpp
@@ -7,6 +7,9 @@
#include "SkTSearch.h"
+
+#include "SkMemory.h"
+
#include <ctype.h>
static inline const char* index_into_base(const char*const* base, int index,
diff --git a/src/core/SkVarAlloc.cpp b/src/core/SkVarAlloc.cpp
index ea0524b67f..2877d5ba9f 100644
--- a/src/core/SkVarAlloc.cpp
+++ b/src/core/SkVarAlloc.cpp
@@ -7,6 +7,8 @@
#include "SkVarAlloc.h"
+#include "SkMemory.h"
+
struct SkVarAlloc::Block {
Block* prev;
char* data() { return (char*)(this + 1); }
diff --git a/src/effects/gradients/SkGradientBitmapCache.cpp b/src/effects/gradients/SkGradientBitmapCache.cpp
index 20b87e02ca..f6f248e9a1 100644
--- a/src/effects/gradients/SkGradientBitmapCache.cpp
+++ b/src/effects/gradients/SkGradientBitmapCache.cpp
@@ -8,6 +8,8 @@
#include "SkGradientBitmapCache.h"
+#include "SkMemory.h"
+
struct SkGradientBitmapCache::Entry {
Entry* fPrev;
Entry* fNext;
diff --git a/src/gpu/GrMemoryPool.cpp b/src/gpu/GrMemoryPool.cpp
index c95b59fc8c..0b956aecf9 100644
--- a/src/gpu/GrMemoryPool.cpp
+++ b/src/gpu/GrMemoryPool.cpp
@@ -7,6 +7,8 @@
#include "GrMemoryPool.h"
+#include "SkMemory.h"
+
#ifdef SK_DEBUG
#define VALIDATE this->validate()
#else
diff --git a/src/gpu/GrRectanizer_pow2.h b/src/gpu/GrRectanizer_pow2.h
index 296e0520bf..424d22e003 100644
--- a/src/gpu/GrRectanizer_pow2.h
+++ b/src/gpu/GrRectanizer_pow2.h
@@ -10,6 +10,7 @@
#include "GrRectanizer.h"
#include "SkMathPriv.h"
+#include "SkMemory.h"
#include "SkPoint.h"
// This Rectanizer quantizes the incoming rects to powers of 2. Each power
diff --git a/src/lazy/SkDiscardableMemoryPool.cpp b/src/lazy/SkDiscardableMemoryPool.cpp
index 6ced5bfc02..fece7f0d6f 100644
--- a/src/lazy/SkDiscardableMemoryPool.cpp
+++ b/src/lazy/SkDiscardableMemoryPool.cpp
@@ -8,6 +8,7 @@
#include "SkDiscardableMemory.h"
#include "SkDiscardableMemoryPool.h"
#include "SkImageGenerator.h"
+#include "SkMemory.h"
#include "SkMutex.h"
#include "SkOnce.h"
#include "SkTInternalLList.h"
diff --git a/src/pdf/SkDeflate.cpp b/src/pdf/SkDeflate.cpp
index c2b85fccb3..af727640bf 100644
--- a/src/pdf/SkDeflate.cpp
+++ b/src/pdf/SkDeflate.cpp
@@ -9,6 +9,7 @@
#include "SkData.h"
#include "SkDeflate.h"
#include "SkMakeUnique.h"
+#include "SkMemory.h"
#include "zlib.h"
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp
index d155308074..9e3a7d3f9d 100644
--- a/src/ports/SkFontHost_FreeType.cpp
+++ b/src/ports/SkFontHost_FreeType.cpp
@@ -18,6 +18,7 @@
#include "SkMask.h"
#include "SkMaskGamma.h"
#include "SkMatrix22.h"
+#include "SkMemory.h"
#include "SkMutex.h"
#include "SkOTUtils.h"
#include "SkPath.h"
diff --git a/src/ports/SkFontMgr_android_parser.cpp b/src/ports/SkFontMgr_android_parser.cpp
index e50a73946a..17dac84ec1 100644
--- a/src/ports/SkFontMgr_android_parser.cpp
+++ b/src/ports/SkFontMgr_android_parser.cpp
@@ -10,6 +10,7 @@
#include "SkFixed.h"
#include "SkFontMgr.h"
#include "SkFontMgr_android_parser.h"
+#include "SkMemory.h"
#include "SkOSFile.h"
#include "SkStream.h"
#include "SkTDArray.h"
diff --git a/src/ports/SkMemory_malloc.cpp b/src/ports/SkMemory_malloc.cpp
index 5574a8a0f2..a303abb080 100644
--- a/src/ports/SkMemory_malloc.cpp
+++ b/src/ports/SkMemory_malloc.cpp
@@ -4,10 +4,11 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+#include "SkMemory.h"
#include "SkTypes.h"
-#include <stdlib.h>
+#include <cstdlib>
#define SK_DEBUGFAILF(fmt, ...) \
SkASSERT((SkDebugf(fmt"\n", __VA_ARGS__), false))
diff --git a/src/ports/SkMemory_mozalloc.cpp b/src/ports/SkMemory_mozalloc.cpp
index f8a996307e..d665799bbf 100644
--- a/src/ports/SkMemory_mozalloc.cpp
+++ b/src/ports/SkMemory_mozalloc.cpp
@@ -6,8 +6,9 @@
* found in the LICENSE file.
*/
-#include "SkTypes.h"
+#include "SkMemory.h"
+#include "SkTypes.h"
#include "mozilla/mozalloc.h"
#include "mozilla/mozalloc_abort.h"
#include "mozilla/mozalloc_oom.h"
diff --git a/src/ports/SkOSFile_win.cpp b/src/ports/SkOSFile_win.cpp
index 9c5ada607d..541e06b513 100644
--- a/src/ports/SkOSFile_win.cpp
+++ b/src/ports/SkOSFile_win.cpp
@@ -9,6 +9,7 @@
#if defined(SK_BUILD_FOR_WIN32)
#include "SkLeanWindows.h"
+#include "SkMemory.h"
#include "SkOSFile.h"
#include "SkTFitsIn.h"
diff --git a/src/utils/SkInterpolator.cpp b/src/utils/SkInterpolator.cpp
index d3c0b26fef..db090184b6 100644
--- a/src/utils/SkInterpolator.cpp
+++ b/src/utils/SkInterpolator.cpp
@@ -5,10 +5,11 @@
* found in the LICENSE file.
*/
+#include "SkInterpolator.h"
#include "SkFixed.h"
-#include "SkInterpolator.h"
#include "SkMath.h"
+#include "SkMemory.h"
#include "SkTSearch.h"
SkInterpolatorBase::SkInterpolatorBase() {
diff --git a/src/utils/mac/SkStream_mac.cpp b/src/utils/mac/SkStream_mac.cpp
index e878c97244..06b717b1c8 100644
--- a/src/utils/mac/SkStream_mac.cpp
+++ b/src/utils/mac/SkStream_mac.cpp
@@ -6,9 +6,11 @@
*/
#include "SkTypes.h"
+
#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
#include "SkCGUtils.h"
+#include "SkMemory.h"
#include "SkStream.h"
// These are used by CGDataProviderCreateWithData