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);"
Revert "Revert 'SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h'"
This reverts commit c456b73fef9589bbdc5eb83eaa83e53c357bb3da.
Change-Id: Ie2c1a17c20134b8ceab85a68b3ae3e61c24fbaab
Reviewed-on: https://skia-review.googlesource.com/6886
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
diff --git a/tests/CodecTest.cpp b/tests/CodecTest.cpp
index 01e9cc4..0f6d54c 100644
--- a/tests/CodecTest.cpp
+++ b/tests/CodecTest.cpp
@@ -8,18 +8,19 @@
#include "FakeStreams.h"
#include "Resources.h"
#include "SkAndroidCodec.h"
+#include "SkAutoMalloc.h"
#include "SkBitmap.h"
#include "SkCodec.h"
#include "SkCodecImageGenerator.h"
#include "SkColorSpace_XYZ.h"
#include "SkData.h"
-#include "SkImageEncoder.h"
#include "SkFrontBufferedStream.h"
+#include "SkImageEncoder.h"
#include "SkMD5.h"
+#include "SkPngChunkReader.h"
#include "SkRandom.h"
#include "SkStream.h"
#include "SkStreamPriv.h"
-#include "SkPngChunkReader.h"
#include "Test.h"
#include "png.h"
diff --git a/tests/ColorFilterTest.cpp b/tests/ColorFilterTest.cpp
index ad2dd0f..b6456a6 100644
--- a/tests/ColorFilterTest.cpp
+++ b/tests/ColorFilterTest.cpp
@@ -5,10 +5,12 @@
* found in the LICENSE file.
*/
+#include "SkAutoMalloc.h"
#include "SkColor.h"
#include "SkColorFilter.h"
#include "SkColorPriv.h"
#include "SkLumaColorFilter.h"
+#include "SkRandom.h"
#include "SkReadBuffer.h"
#include "SkWriteBuffer.h"
#include "SkRandom.h"
diff --git a/tests/FontHostTest.cpp b/tests/FontHostTest.cpp
index 55c5244..3d54c57 100644
--- a/tests/FontHostTest.cpp
+++ b/tests/FontHostTest.cpp
@@ -6,6 +6,7 @@
*/
#include "Resources.h"
+#include "SkAutoMalloc.h"
#include "SkEndian.h"
#include "SkFontStream.h"
#include "SkOSFile.h"
diff --git a/tests/FrontBufferedStreamTest.cpp b/tests/FrontBufferedStreamTest.cpp
index a386274..69ff488 100644
--- a/tests/FrontBufferedStreamTest.cpp
+++ b/tests/FrontBufferedStreamTest.cpp
@@ -5,12 +5,12 @@
* found in the LICENSE file.
*/
+#include "SkAutoMalloc.h"
#include "SkBitmap.h"
#include "SkCodec.h"
#include "SkFrontBufferedStream.h"
#include "SkRefCnt.h"
#include "SkStream.h"
-#include "SkTypes.h"
#include "Test.h"
static void test_read(skiatest::Reporter* reporter, SkStream* bufferedStream,
diff --git a/tests/MallocPixelRefTest.cpp b/tests/MallocPixelRefTest.cpp
index 09e1b93..7e2bece 100644
--- a/tests/MallocPixelRefTest.cpp
+++ b/tests/MallocPixelRefTest.cpp
@@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
+#include "SkAutoMalloc.h"
#include "SkData.h"
#include "SkMallocPixelRef.h"
#include "Test.h"
diff --git a/tests/PaintBreakTextTest.cpp b/tests/PaintBreakTextTest.cpp
index 474bbf6..b716c60 100644
--- a/tests/PaintBreakTextTest.cpp
+++ b/tests/PaintBreakTextTest.cpp
@@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
+#include "SkAutoMalloc.h"
#include "SkPaint.h"
#include "Test.h"
diff --git a/tests/PaintTest.cpp b/tests/PaintTest.cpp
index 76bfb02..55a82a7 100644
--- a/tests/PaintTest.cpp
+++ b/tests/PaintTest.cpp
@@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
+#include "SkAutoMalloc.h"
#include "SkBlurMask.h"
#include "SkBlurMaskFilter.h"
#include "SkLayerDrawLooper.h"
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index 2059c36..0ace812 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -5,14 +5,14 @@
* found in the LICENSE file.
*/
-#include <cmath>
+#include "SkAutoMalloc.h"
#include "SkCanvas.h"
#include "SkGeometry.h"
#include "SkPaint.h"
#include "SkParse.h"
#include "SkParsePath.h"
-#include "SkPathPriv.h"
#include "SkPathEffect.h"
+#include "SkPathPriv.h"
#include "SkRRect.h"
#include "SkRandom.h"
#include "SkReader32.h"
@@ -20,9 +20,9 @@
#include "SkStream.h"
#include "SkStrokeRec.h"
#include "SkSurface.h"
-#include "SkTypes.h"
#include "SkWriter32.h"
#include "Test.h"
+#include <cmath>
static void set_radii(SkVector radii[4], int index, float rad) {
sk_bzero(radii, sizeof(SkVector) * 4);
diff --git a/tests/RegionTest.cpp b/tests/RegionTest.cpp
index 4a96056..1720822 100644
--- a/tests/RegionTest.cpp
+++ b/tests/RegionTest.cpp
@@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
+#include "SkAutoMalloc.h"
#include "SkPath.h"
#include "SkRandom.h"
#include "SkRegion.h"
diff --git a/tests/StreamTest.cpp b/tests/StreamTest.cpp
index ff23ca2..fba09c9 100644
--- a/tests/StreamTest.cpp
+++ b/tests/StreamTest.cpp
@@ -6,6 +6,7 @@
*/
#include "Resources.h"
+#include "SkAutoMalloc.h"
#include "SkData.h"
#include "SkFrontBufferedStream.h"
#include "SkOSFile.h"
diff --git a/tests/Writer32Test.cpp b/tests/Writer32Test.cpp
index 3eab94c..6cb79f8 100644
--- a/tests/Writer32Test.cpp
+++ b/tests/Writer32Test.cpp
@@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
+#include "SkAutoMalloc.h"
#include "SkRandom.h"
#include "SkReader32.h"
#include "SkWriter32.h"
diff --git a/tests/YUVTest.cpp b/tests/YUVTest.cpp
index 913997b..0c31c09 100644
--- a/tests/YUVTest.cpp
+++ b/tests/YUVTest.cpp
@@ -5,8 +5,9 @@
* found in the LICENSE file.
*/
-#include "SkCodec.h"
#include "Resources.h"
+#include "SkAutoMalloc.h"
+#include "SkCodec.h"
#include "SkStream.h"
#include "SkTemplates.h"
#include "SkYUVSizeInfo.h"