diff options
author | bungeman <bungeman@google.com> | 2015-08-26 05:15:46 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-26 05:15:46 -0700 |
commit | 60e0fee6d4acff638ccc9670c4055aced529a7a0 (patch) | |
tree | 8f73b02cd0bfbb7d6d64982ed4ebd8776d4a5a28 /tools | |
parent | 8d624bd44ef9e6d4ab7b768c4cbaa41cba830eda (diff) |
Remove include of stdlib.h from SkTypes.h.
Unfortunately, immintrin.h (which is also included by SkTypes)
includes xmmintrin.h which includes mm_malloc.h which includes
stdlib.h for malloc even though, from the implementation, it is
difficult to see why.
Fortunately, arm_neon.h does not seem to be involved in such
shenanigans, so building for Android will keep things sane.
TBR=reed@google.com
Doesn't change Skia API, just moves an include.
Review URL: https://codereview.chromium.org/1313203003
Diffstat (limited to 'tools')
-rw-r--r-- | tools/PictureRenderingFlags.cpp | 2 | ||||
-rw-r--r-- | tools/PictureResultsWriter.h | 2 | ||||
-rw-r--r-- | tools/dump_record.cpp | 2 | ||||
-rw-r--r-- | tools/flags/SkCommandLineFlags.cpp | 2 | ||||
-rw-r--r-- | tools/flatten.cpp | 2 | ||||
-rw-r--r-- | tools/lua/lua_app.cpp | 2 | ||||
-rw-r--r-- | tools/lua/lua_pictures.cpp | 2 | ||||
-rw-r--r-- | tools/render_pictures_main.cpp | 6 | ||||
-rw-r--r-- | tools/skdiff_main.cpp | 2 | ||||
-rw-r--r-- | tools/skpdiff/SkDifferentPixelsMetric_cpu.cpp | 12 | ||||
-rw-r--r-- | tools/skpmaker.cpp | 2 |
11 files changed, 28 insertions, 8 deletions
diff --git a/tools/PictureRenderingFlags.cpp b/tools/PictureRenderingFlags.cpp index 26d15911d1..bd718a0ca8 100644 --- a/tools/PictureRenderingFlags.cpp +++ b/tools/PictureRenderingFlags.cpp @@ -19,6 +19,8 @@ #include "SkImageDecoder.h" #include "SkString.h" +#include <stdlib.h> + // Alphabetized list of flags used by this file or bench_ and render_pictures. DEFINE_string(bbh, "none", "bbhType [width height]: Set the bounding box hierarchy type to " "be used. Accepted values are: none, rtree, grid. " diff --git a/tools/PictureResultsWriter.h b/tools/PictureResultsWriter.h index 67371024e3..c9aaed0b35 100644 --- a/tools/PictureResultsWriter.h +++ b/tools/PictureResultsWriter.h @@ -20,6 +20,8 @@ #include "SkTArray.h" #include "TimerData.h" +#include <stdlib.h> + /** * Base class for writing picture bench results. */ diff --git a/tools/dump_record.cpp b/tools/dump_record.cpp index 885046a1d1..69cdffff31 100644 --- a/tools/dump_record.cpp +++ b/tools/dump_record.cpp @@ -17,6 +17,8 @@ #include "DumpRecord.h" #include "LazyDecodeBitmap.h" +#include <stdlib.h> + DEFINE_string2(skps, r, "", ".SKPs to dump."); DEFINE_string(match, "", "The usual filters on file names to dump."); DEFINE_bool2(optimize, O, false, "Run SkRecordOptimize before dumping."); diff --git a/tools/flags/SkCommandLineFlags.cpp b/tools/flags/SkCommandLineFlags.cpp index 3c57d00f0d..ec9949bafc 100644 --- a/tools/flags/SkCommandLineFlags.cpp +++ b/tools/flags/SkCommandLineFlags.cpp @@ -9,6 +9,8 @@ #include "SkTDArray.h" #include "SkTSort.h" +#include <stdlib.h> + DEFINE_bool(undefok, false, "Silently ignore unknown flags instead of crashing."); template <typename T> static void ignore_result(const T&) {} diff --git a/tools/flatten.cpp b/tools/flatten.cpp index 832bd1426d..80579df48f 100644 --- a/tools/flatten.cpp +++ b/tools/flatten.cpp @@ -11,6 +11,8 @@ #include "SkPicture.h" #include "SkPictureRecorder.h" #include "SkStream.h" + +#include <stdlib.h> #include <stdio.h> __SK_FORCE_IMAGE_DECODER_LINKING; diff --git a/tools/lua/lua_app.cpp b/tools/lua/lua_app.cpp index 023ddaeaca..f24570a829 100644 --- a/tools/lua/lua_app.cpp +++ b/tools/lua/lua_app.cpp @@ -11,6 +11,8 @@ #include "SkData.h" #include "SkOSFile.h" +#include <stdlib.h> + extern "C" { #include "lua.h" #include "lualib.h" diff --git a/tools/lua/lua_pictures.cpp b/tools/lua/lua_pictures.cpp index d579f2e630..315e4bfb89 100644 --- a/tools/lua/lua_pictures.cpp +++ b/tools/lua/lua_pictures.cpp @@ -17,6 +17,8 @@ #include "SkOSFile.h" #include "SkImageDecoder.h" +#include <stdlib.h> + extern "C" { #include "lua.h" #include "lualib.h" diff --git a/tools/render_pictures_main.cpp b/tools/render_pictures_main.cpp index 2624a6e0fe..392083197e 100644 --- a/tools/render_pictures_main.cpp +++ b/tools/render_pictures_main.cpp @@ -25,6 +25,8 @@ #include "PictureRenderingFlags.h" #include "picture_utils.h" +#include <stdlib.h> + // Flags used by this file, alphabetically: DEFINE_bool(bench_record, false, "If true, drop into an infinite loop of recording the picture."); DECLARE_bool(deferImageDecoding); @@ -219,8 +221,8 @@ static inline int getByte(uint32_t value, int index) { } static int MaxByteDiff(uint32_t v1, uint32_t v2) { - return SkMax32(SkMax32(abs(getByte(v1, 0) - getByte(v2, 0)), abs(getByte(v1, 1) - getByte(v2, 1))), - SkMax32(abs(getByte(v1, 2) - getByte(v2, 2)), abs(getByte(v1, 3) - getByte(v2, 3)))); + return SkMax32(SkMax32(SkTAbs(getByte(v1, 0) - getByte(v2, 0)), SkTAbs(getByte(v1, 1) - getByte(v2, 1))), + SkMax32(SkTAbs(getByte(v1, 2) - getByte(v2, 2)), SkTAbs(getByte(v1, 3) - getByte(v2, 3)))); } class AutoRestoreBbhType { diff --git a/tools/skdiff_main.cpp b/tools/skdiff_main.cpp index 4646b1f906..4e360a8e49 100644 --- a/tools/skdiff_main.cpp +++ b/tools/skdiff_main.cpp @@ -17,6 +17,8 @@ #include "SkTDArray.h" #include "SkTSearch.h" +#include <stdlib.h> + __SK_FORCE_IMAGE_DECODER_LINKING; /** diff --git a/tools/skpdiff/SkDifferentPixelsMetric_cpu.cpp b/tools/skpdiff/SkDifferentPixelsMetric_cpu.cpp index 7194e805bf..a96da7c6b6 100644 --- a/tools/skpdiff/SkDifferentPixelsMetric_cpu.cpp +++ b/tools/skpdiff/SkDifferentPixelsMetric_cpu.cpp @@ -73,14 +73,14 @@ bool SkDifferentPixelsMetric::diff(SkBitmap* baseline, SkBitmap* test, if (baselinePixel != testPixel) { result->poiCount++; - int redDiff = abs(static_cast<int>(SkColorGetR(baselinePixel) - - SkColorGetR(testPixel))); + int redDiff = SkTAbs(static_cast<int>(SkColorGetR(baselinePixel) - + SkColorGetR(testPixel))); if (redDiff > maxRedDiff) {maxRedDiff = redDiff;} - int greenDiff = abs(static_cast<int>(SkColorGetG(baselinePixel) - - SkColorGetG(testPixel))); + int greenDiff = SkTAbs(static_cast<int>(SkColorGetG(baselinePixel) - + SkColorGetG(testPixel))); if (greenDiff > maxGreenDiff) {maxGreenDiff = greenDiff;} - int blueDiff = abs(static_cast<int>(SkColorGetB(baselinePixel) - - SkColorGetB(testPixel))); + int blueDiff = SkTAbs(static_cast<int>(SkColorGetB(baselinePixel) - + SkColorGetB(testPixel))); if (blueDiff > maxBlueDiff) {maxBlueDiff = blueDiff;} if (bitmapsToCreate.alphaMask) { diff --git a/tools/skpmaker.cpp b/tools/skpmaker.cpp index 03f720f392..0e378ed088 100644 --- a/tools/skpmaker.cpp +++ b/tools/skpmaker.cpp @@ -16,6 +16,8 @@ #include "SkScalar.h" #include "SkStream.h" +#include <stdlib.h> + // Flags used by this file, alphabetically: DEFINE_int32(blue, 128, "Value of blue color channel in image, 0-255."); DEFINE_int32(border, 4, "Width of the black border around the image."); |