diff options
-rw-r--r-- | gyp/common_conditions.gypi | 1 | ||||
-rw-r--r-- | gyp/common_variables.gypi | 7 | ||||
-rw-r--r-- | gyp/zlib.gyp | 79 | ||||
-rw-r--r-- | include/config/SkUserConfig.h | 9 | ||||
-rw-r--r-- | include/core/SkPostConfig.h | 6 | ||||
-rw-r--r-- | src/core/SkFlate.cpp | 8 | ||||
-rw-r--r-- | tests/FlateTest.cpp | 2 |
7 files changed, 16 insertions, 96 deletions
diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi index 676ec0897a..9642f3d3f9 100644 --- a/gyp/common_conditions.gypi +++ b/gyp/common_conditions.gypi @@ -39,6 +39,7 @@ { 'defines': [ 'SK_BUILD_FOR_WIN32', + 'SK_NO_FLATE', # Too much of a pain to set up zlib on our bots. '_CRT_SECURE_NO_WARNINGS', 'GR_GL_FUNCTION_TYPE=__stdcall', ], diff --git a/gyp/common_variables.gypi b/gyp/common_variables.gypi index a20550b08d..97501871a9 100644 --- a/gyp/common_variables.gypi +++ b/gyp/common_variables.gypi @@ -135,12 +135,6 @@ # libpng in third_party/externals/libpng. 'skia_libpng_static%': '0', - # skia_zlib_static - on OS variants that normally would link zlib with - # '-lz' or libz.dylib and include the headers from '<zlib.h>', - # don't do that; instead compile and staticlly link the version of - # zlib in third_party/externals/zlib. - 'skia_zlib_static%': '0', - # skia_no_fontconfig - On POSIX systems that would normally use the # SkFontHost_fontconfig interface; use the SkFontHost_linux # version instead. @@ -214,7 +208,6 @@ 'skia_freetype_static%': '<(skia_freetype_static)', 'skia_giflib_static%': '<(skia_giflib_static)', 'skia_libpng_static%': '<(skia_libpng_static)', - 'skia_zlib_static%': '<(skia_zlib_static)', 'skia_no_fontconfig%': '<(skia_no_fontconfig)', 'skia_sanitizer%': '<(skia_sanitizer)', 'skia_scalar%': '<(skia_scalar)', diff --git a/gyp/zlib.gyp b/gyp/zlib.gyp index 78adc34b72..a573dc7498 100644 --- a/gyp/zlib.gyp +++ b/gyp/zlib.gyp @@ -4,75 +4,14 @@ # found in the LICENSE file. { - 'variables': { - 'skia_warnings_as_errors': 0, - }, - 'targets': [ - { - 'target_name': 'zlib', + 'targets': [{ + 'target_name': 'zlib', + 'type': 'none', + 'link_settings': { 'libraries': [ '-lz' ] }, + 'direct_dependent_settings': { 'conditions': [ - [ 'skia_zlib_static', - { - 'type': 'static_library', - 'include_dirs': [ - '../third_party/externals/zlib', - ], - 'direct_dependent_settings': { - 'defines': [ - 'SK_ZLIB_INCLUDE="zlib.h"', - ], - 'include_dirs': [ - '../third_party/externals/zlib', - ], - }, - 'sources': [ - '../third_party/externals/zlib/src/adler32.c', - '../third_party/externals/zlib/src/compress.c', - '../third_party/externals/zlib/src/crc32.c', - '../third_party/externals/zlib/src/deflate.c', - '../third_party/externals/zlib/src/gzclose.c', - '../third_party/externals/zlib/src/gzlib.c', - '../third_party/externals/zlib/src/gzread.c', - '../third_party/externals/zlib/src/gzwrite.c', - '../third_party/externals/zlib/src/infback.c', - '../third_party/externals/zlib/src/inffast.c', - '../third_party/externals/zlib/src/inflate.c', - '../third_party/externals/zlib/src/inftrees.c', - '../third_party/externals/zlib/src/trees.c', - '../third_party/externals/zlib/src/uncompr.c', - '../third_party/externals/zlib/src/zutil.c', - ], - }, { # not skia_zlib_static - 'type': 'none', - 'direct_dependent_settings': { - 'conditions': [ - [ 'skia_android_framework', { - 'include_dirs': [ - 'external/zlib', - ], - }, { - 'defines': [ - 'SK_SYSTEM_ZLIB=1', - ], - }] - ], - 'link_settings': { - 'conditions': [ - [ 'skia_os == "mac" or skia_os == "ios"', { - 'libraries': [ - '$(SDKROOT)/usr/lib/libz.dylib', - ] - }, { # skia_os != "mac" and skia_os != "ios" - 'libraries': [ - '-lz', - ] - }], - ], - } - }, - } - ] - ] - } - ] + [ 'skia_android_framework', { 'include_dirs': [ 'external/zlib' ] }] + ], + }, + }], } diff --git a/include/config/SkUserConfig.h b/include/config/SkUserConfig.h index 92e2b90762..a6f12930b2 100644 --- a/include/config/SkUserConfig.h +++ b/include/config/SkUserConfig.h @@ -107,13 +107,10 @@ */ //#define SK_DEFAULT_IMAGE_CACHE_LIMIT (1024 * 1024) -/* If zlib is available and you want to support the flate compression - algorithm (used in PDF generation), define SK_ZLIB_INCLUDE to be the - include path. Alternatively, define SK_SYSTEM_ZLIB to use the system zlib - library specified as "#include <zlib.h>". +/* If zlib is not available or you don't want to support flate compression + in PDF generation, define SK_NO_FLATE. */ -//#define SK_ZLIB_INCLUDE <zlib.h> -//#define SK_SYSTEM_ZLIB +//#define SK_NO_FLATE /* Define this to allow PDF scalars above 32k. The PDF/A spec doesn't allow them, but modern PDF interpreters should handle them just fine. diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h index 330454cbea..ad0098f429 100644 --- a/include/core/SkPostConfig.h +++ b/include/core/SkPostConfig.h @@ -88,12 +88,6 @@ # endif #endif -#if defined(SK_ZLIB_INCLUDE) && defined(SK_SYSTEM_ZLIB) -# error "cannot define both SK_ZLIB_INCLUDE and SK_SYSTEM_ZLIB" -#elif defined(SK_ZLIB_INCLUDE) || defined(SK_SYSTEM_ZLIB) -# define SK_HAS_ZLIB -#endif - /////////////////////////////////////////////////////////////////////////////// #ifndef SkNEW diff --git a/src/core/SkFlate.cpp b/src/core/SkFlate.cpp index 2b4e36d727..ff11a11ca8 100644 --- a/src/core/SkFlate.cpp +++ b/src/core/SkFlate.cpp @@ -11,7 +11,7 @@ #include "SkFlate.h" #include "SkStream.h" -#ifndef SK_HAS_ZLIB +#ifdef SK_NO_FLATE bool SkFlate::HaveFlate() { return false; } bool SkFlate::Deflate(SkStream*, SkWStream*) { return false; } bool SkFlate::Deflate(const void*, size_t, SkWStream*) { return false; } @@ -26,11 +26,7 @@ bool SkFlate::HaveFlate() { namespace { -#ifdef SK_SYSTEM_ZLIB -#include <zlib.h> -#else -#include SK_ZLIB_INCLUDE -#endif +#include "zlib.h" // static const size_t kBufferSize = 1024; diff --git a/tests/FlateTest.cpp b/tests/FlateTest.cpp index 9f6a5b5f43..8ad4d50376 100644 --- a/tests/FlateTest.cpp +++ b/tests/FlateTest.cpp @@ -104,7 +104,7 @@ static void TestFlate(skiatest::Reporter* reporter, SkMemoryStream* testStream, } DEF_TEST(Flate, reporter) { -#ifdef SK_HAS_ZLIB +#ifndef SK_NO_FLATE REPORTER_ASSERT(reporter, SkFlate::HaveFlate()); #endif if (SkFlate::HaveFlate()) { |