diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-04-02 12:53:54 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-04-02 12:53:54 +0200 |
commit | cee7701c76579ff139b42f2092306a88f0394dc5 (patch) | |
tree | 25eb915f22cd8172210d29e299d17b39bdc9ebfe /src | |
parent | 9293902f325341f0c188bdf4f662c3a7d949a343 (diff) | |
parent | a33e3aeac74c8fc8d1fff7a244083d96f9bba70f (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Idd134e350e760a0237dce4ef00d10e1c35dbeb67
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/libwebp/src/dsp/dsp.h | 6 | ||||
-rw-r--r-- | src/imageformats/configure.json | 212 | ||||
-rw-r--r-- | src/plugins/imageformats/imageformats.pro | 14 | ||||
-rw-r--r-- | src/plugins/imageformats/jp2/jp2.pro | 6 | ||||
-rw-r--r-- | src/plugins/imageformats/webp/webp.pro | 8 | ||||
-rw-r--r-- | src/src.pro | 4 |
6 files changed, 236 insertions, 14 deletions
diff --git a/src/3rdparty/libwebp/src/dsp/dsp.h b/src/3rdparty/libwebp/src/dsp/dsp.h index fafc2d0..0d7f3fb 100644 --- a/src/3rdparty/libwebp/src/dsp/dsp.h +++ b/src/3rdparty/libwebp/src/dsp/dsp.h @@ -55,12 +55,12 @@ extern "C" { #if !defined(EMSCRIPTEN) #if defined(_MSC_VER) && _MSC_VER > 1310 && \ - (defined(_M_X64) || defined(_M_IX86)) + (defined(_M_X64) || defined(_M_IX86)) && !defined(__clang__) #define WEBP_MSC_SSE2 // Visual C++ SSE2 targets #endif #if defined(_MSC_VER) && _MSC_VER >= 1500 && \ - (defined(_M_X64) || defined(_M_IX86)) + (defined(_M_X64) || defined(_M_IX86)) && !defined(__clang__) #define WEBP_MSC_SSE41 // Visual C++ SSE4.1 targets #endif @@ -90,7 +90,7 @@ extern "C" { #define WEBP_USE_NEON #endif -#if defined(_MSC_VER) && _MSC_VER >= 1700 && defined(_M_ARM) +#if defined(_MSC_VER) && _MSC_VER >= 1700 && defined(_M_ARM) && !defined(__clang__) #define WEBP_USE_NEON #define WEBP_USE_INTRINSICS #endif diff --git a/src/imageformats/configure.json b/src/imageformats/configure.json new file mode 100644 index 0000000..7c60f86 --- /dev/null +++ b/src/imageformats/configure.json @@ -0,0 +1,212 @@ +{ + "module": "imageformats", + "depends": [ + "gui" + ], + + "commandline": { + "options": { + "jasper": { "type": "boolean" }, + "mng": { "type": "boolean" }, + "tiff": { "type": "enum", "values": [ "no", "qt", "system" ] }, + "webp": { "type": "enum", "values": [ "no", "qt", "system" ] } + } + }, + + "libraries": { + "jasper": { + "label": "jasper", + "test": { + "label": "Jasper(header in /usr/include)", + "type": "compile", + "test": { + "include": [ + "string.h", + "jasper/jasper.h" + ], + "qmake": [ + "msvc: LIBS += libjasper.lib", + "else: LIBS += -ljasper" + ], + "main": [ + "// This version of Jasper is broken, according to the old Qt Solutions docs", + "if (strcmp(JAS_VERSION, \"1.900.0\") == 0)", + " return 1;", + "return 0;" + ] + } + }, + "sources": [ + "-ljasper" + ] + }, + "mng": { + "label": "mng", + "test": { + "label": "MNG(header in /usr/include)", + "type": "compile", + "test": { + "include": [ + "stdio.h", + "libmng.h" + ], + "qmake": [ + "LIBS += -lmng" + ], + "main": [ + "mng_handle hMNG;", + "mng_cleanup(&hMNG);", + "#if defined(MNG_VERSION_MAJOR)", + "#if MNG_VERSION_MAJOR < 1 || (MNG_VERSION_MAJOR == 1 && MNG_VERSION_MINOR == 0 && MNG_VERSION_RELEASE < 9)", + "#error System libmng version is less than 1.0.9", + "#endif", + "#endif", + "return 0;" + ] + } + }, + "sources": [ + "-lmng" + ] + }, + "tiff": { + "label": "tiff", + "test": { + "label": "TIFF(header in /usr/include)", + "type": "compile", + "test": { + "include": "tiffio.h", + "qmake": [ + "unix|mingw: LIBS += -ltiff", + "else:win32: LIBS += libtiff.lib" + ], + "main": [ + "#if !defined(TIFF_VERSION) && defined(TIFF_VERSION_CLASSIC)", + "// libtiff 4.0 splits it into TIFF_VERSION_CLASSIC and TIFF_VERSION_BIG", + "# define TIFF_VERSION TIFF_VERSION_CLASSIC", + "#endif", + + "#if !defined(TIFF_VERSION)", + "# error \"Required libtiff not found\"", + "#elif TIFF_VERSION < 42", + "# error \"unsupported tiff version\"", + "#endif", + + "tdata_t buffer = _TIFFmalloc(128);", + "_TIFFfree(buffer);", + + "// some libtiff implementations where TIFF_VERSION >= 42 do not", + "// have TIFFReadRGBAImageOriented(), so let's check for it", + "TIFFReadRGBAImageOriented(0, 0, 0, 0, 0, 0);", + + "return 0;" + ] + } + }, + "sources": [ + "-ltiff" + ] + }, + "webp": { + "label": "webp", + "test": { + "label": "WebP(header in /usr/include)", + "type": "compile", + "test": { + "include": [ + "webp/decode.h", + "webp/encode.h", + "webp/demux.h" + ], + "qmake": [ + "LIBS += -lwebp -lwebpdemux" + ], + "main": [ + "#if WEBP_ABI_IS_INCOMPATIBLE(WEBP_DECODER_ABI_VERSION, 0x0203) || WEBP_ABI_IS_INCOMPATIBLE(WEBP_ENCODER_ABI_VERSION, 0x0202)", + "#error \"Incompatible libwebp version\"", + "#endif", + + "WebPDecoderConfig config;", + "WebPDecBuffer *output_buffer = &config.output;", + "WebPBitstreamFeatures *bitstream = &config.input;", + "WebPPicture picture;", + "picture.use_argb = 0;", + "WebPConfig config2;", + "config2.lossless = 0;", + "WebPData data = {};", + "WebPDemuxer *demuxer = WebPDemux(&data);", + "WebPIterator iter;", + "iter.frame_num = 0;", + + "return 0;" + ] + } + }, + "sources": [ + "-lwebp -lwebpdemux" + ] + } + }, + + "features": { + "jasper": { + "label": "JasPer", + "disable": "input.jasper == 'no'", + "condition": "features.imageformatplugin && libs.jasper", + "output": [ + "privateFeature", + { "type": "define", "negative": true, "name": "QT_NO_IMAGEFORMAT_JASPER" } + ] + }, + "mng": { + "label": "MNG", + "disable": "input.mng == 'no'", + "condition": "libs.mng", + "output": [ "privateFeature" ] + }, + "tiff": { + "label": "TIFF", + "disable": "input.tiff == 'no'", + "condition": "features.imageformatplugin", + "output": [ + "privateFeature", + { "type": "define", "negative": true, "name": "QT_NO_IMAGEFORMAT_TIFF" } + ] + }, + "system-tiff": { + "label": " Using system libtiff", + "disable": "input.tiff == 'qt'", + "enable": "input.tiff == 'system'", + "condition": "features.tiff && libs.tiff", + "output": [ "privateFeature" ] + }, + "webp": { + "label": "WEBP", + "disable": "input.webp == 'no'", + "condition": "features.imageformatplugin", + "output": [ + "privateFeature", + { "type": "define", "negative": true, "name": "QT_NO_IMAGEFORMAT_WEBP" } + ] + }, + "system-webp": { + "label": " Using system libwebp", + "disable": "input.webp == 'qt'", + "enable": "input.webp == 'system'", + "condition": "features.webp && libs.webp", + "output": [ "privateFeature" ] + } + }, + + "summary": [ + { + "section": "Further Image Formats", + "entries": [ + "jasper", + "mng", + "tiff", "system-tiff", + "webp", "system-webp" + ] + } + ] +} diff --git a/src/plugins/imageformats/imageformats.pro b/src/plugins/imageformats/imageformats.pro index d6c59ee..be1e20a 100644 --- a/src/plugins/imageformats/imageformats.pro +++ b/src/plugins/imageformats/imageformats.pro @@ -2,17 +2,21 @@ TEMPLATE = subdirs SUBDIRS = \ # dds \ tga \ - tiff \ - wbmp \ - webp + wbmp + +include($$OUT_PWD/../../imageformats/qtimageformats-config.pri) +QT_FOR_CONFIG += imageformats-private + +qtConfig(tiff): SUBDIRS += tiff +qtConfig(webp): SUBDIRS += webp darwin: SUBDIRS += macheif qtConfig(regularexpression): \ SUBDIRS += icns -config_libmng: SUBDIRS += mng -config_jasper { +qtConfig(mng): SUBDIRS += mng +qtConfig(jasper) { SUBDIRS += jp2 } else:darwin: { SUBDIRS += macjp2 diff --git a/src/plugins/imageformats/jp2/jp2.pro b/src/plugins/imageformats/jp2/jp2.pro index 4caeff3..d9fb4fa 100644 --- a/src/plugins/imageformats/jp2/jp2.pro +++ b/src/plugins/imageformats/jp2/jp2.pro @@ -5,8 +5,10 @@ SOURCES += main.cpp \ qjp2handler.cpp OTHER_FILES += jp2.json -msvc: LIBS += libjasper.lib -else: LIBS += -ljasper +include($$OUT_PWD/../../../imageformats/qtimageformats-config.pri) +QT_FOR_CONFIG += imageformats-private + +QMAKE_USE_PRIVATE += jasper PLUGIN_TYPE = imageformats PLUGIN_CLASS_NAME = QJp2Plugin diff --git a/src/plugins/imageformats/webp/webp.pro b/src/plugins/imageformats/webp/webp.pro index 405c3b7..cea7c78 100644 --- a/src/plugins/imageformats/webp/webp.pro +++ b/src/plugins/imageformats/webp/webp.pro @@ -4,9 +4,11 @@ HEADERS += qwebphandler_p.h SOURCES += main.cpp qwebphandler.cpp OTHER_FILES += webp.json -config_libwebp { - unix|win32-g++*: LIBS += -lwebp -lwebpdemux - else:win32: LIBS += libwebp.lib libwebpdemux.lib +include($$OUT_PWD/../../../imageformats/qtimageformats-config.pri) +QT_FOR_CONFIG += imageformats-private + +qtConfig(system-webp) { + QMAKE_USE += webp } else { include($$PWD/../../../3rdparty/libwebp.pri) } diff --git a/src/src.pro b/src/src.pro index fcc0785..4f9cee1 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,2 +1,4 @@ TEMPLATE = subdirs -SUBDIRS = plugins imageformats +SUBDIRS = imageformats plugins + +plugins.depends = imageformats |