2016-12-06 19:54:52 +03:00
|
|
|
diff -up chromium-55.0.2883.11/third_party/pdfium/BUILD.gn.pdfium-system-libtiff-libpng chromium-55.0.2883.11/third_party/pdfium/BUILD.gn
|
|
|
|
--- chromium-55.0.2883.11/third_party/pdfium/BUILD.gn.pdfium-system-libtiff-libpng 2016-10-14 00:04:44.000000000 +0200
|
|
|
|
+++ chromium-55.0.2883.11/third_party/pdfium/BUILD.gn 2016-10-15 12:25:53.045704800 +0200
|
2016-11-17 23:12:20 +10:00
|
|
|
@@ -14,7 +14,6 @@ config("pdfium_common_config") {
|
|
|
|
"third_party/freetype/include/freetype",
|
|
|
|
]
|
|
|
|
defines = [
|
|
|
|
- "OPJ_STATIC",
|
|
|
|
"PNG_PREFIX",
|
|
|
|
"PNG_USE_READ_MACROS",
|
|
|
|
]
|
2016-12-06 19:54:52 +03:00
|
|
|
@@ -634,7 +633,7 @@ static_library("fxcodec") {
|
|
|
|
":fxcrt",
|
2016-11-17 23:12:20 +10:00
|
|
|
"third_party:fx_lcms2",
|
|
|
|
"third_party:fx_libopenjpeg",
|
|
|
|
- "third_party:fx_zlib",
|
|
|
|
+ "//third_party/zlib:zlib",
|
|
|
|
|
|
|
|
# This is a generic JPEG library dependency.
|
|
|
|
"//third_party:jpeg",
|
2016-12-06 19:54:52 +03:00
|
|
|
diff -up chromium-55.0.2883.11/third_party/pdfium/core/fxcodec/codec/codec_int.h.pdfium-system-libtiff-libpng chromium-55.0.2883.11/third_party/pdfium/core/fxcodec/codec/codec_int.h
|
|
|
|
--- chromium-55.0.2883.11/third_party/pdfium/core/fxcodec/codec/codec_int.h.pdfium-system-libtiff-libpng 2016-10-15 12:25:53.046704787 +0200
|
|
|
|
+++ chromium-55.0.2883.11/third_party/pdfium/core/fxcodec/codec/codec_int.h 2016-10-15 12:31:21.588574456 +0200
|
2016-11-17 23:12:20 +10:00
|
|
|
@@ -16,7 +16,7 @@
|
|
|
|
|
2016-12-06 19:54:52 +03:00
|
|
|
#include "core/fxcodec/fx_codec.h"
|
2016-11-17 23:12:20 +10:00
|
|
|
#include "core/fxcodec/jbig2/JBig2_Context.h"
|
|
|
|
-#include "third_party/libopenjpeg20/openjpeg.h"
|
|
|
|
+#include <openjpeg.h>
|
|
|
|
|
|
|
|
class CPDF_ColorSpace;
|
|
|
|
|
2017-03-11 21:09:25 +03:00
|
|
|
--- chromium-57.0.2987.98/third_party/pdfium/core/fxcodec/codec/fx_codec_flate.cpp-orig 2017-03-09 23:05:26.000000000 +0300
|
|
|
|
+++ chromium-57.0.2987.98/third_party/pdfium/core/fxcodec/codec/fx_codec_flate.cpp 2017-03-10 20:05:23.383756424 +0300
|
|
|
|
@@ -14,7 +14,7 @@
|
2016-12-06 19:54:52 +03:00
|
|
|
#include "core/fxcodec/fx_codec.h"
|
|
|
|
#include "core/fxcrt/fx_ext.h"
|
2017-03-11 21:09:25 +03:00
|
|
|
#include "third_party/base/ptr_util.h"
|
2016-11-17 23:12:20 +10:00
|
|
|
-#include "third_party/zlib_v128/zlib.h"
|
|
|
|
+#include <zlib.h>
|
2017-03-11 21:09:25 +03:00
|
|
|
|
2016-11-17 23:12:20 +10:00
|
|
|
extern "C" {
|
|
|
|
static void* my_alloc_func(void* opaque,
|
2017-01-31 10:51:58 +03:00
|
|
|
--- chromium-56.0.2924.76/third_party/pdfium/core/fxcodec/codec/fx_codec_jpx_opj.cpp.pdfium-system-libtiff-libpng 2017-01-30 22:08:13.942085030 +0300
|
|
|
|
+++ chromium-56.0.2924.76/third_party/pdfium/core/fxcodec/codec/fx_codec_jpx_opj.cpp 2017-01-30 22:07:00.274088797 +0300
|
2016-11-17 23:12:20 +10:00
|
|
|
@@ -13,7 +13,7 @@
|
2016-12-06 19:54:52 +03:00
|
|
|
#include "core/fxcodec/fx_codec.h"
|
|
|
|
#include "core/fxcrt/fx_safe_types.h"
|
2016-11-17 23:12:20 +10:00
|
|
|
#include "third_party/lcms2-2.6/include/lcms2.h"
|
|
|
|
-#include "third_party/libopenjpeg20/openjpeg.h"
|
|
|
|
+#include <openjpeg.h>
|
2017-01-31 10:51:58 +03:00
|
|
|
|
2016-11-17 23:12:20 +10:00
|
|
|
static void fx_error_callback(const char* msg, void* client_data) {
|
|
|
|
(void)client_data;
|
2017-01-31 10:51:58 +03:00
|
|
|
@@ -761,7 +761,7 @@ bool CJPX_Decoder::Init(const unsigned c
|
2016-11-17 23:12:20 +10:00
|
|
|
image = nullptr;
|
2017-01-31 10:51:58 +03:00
|
|
|
return false;
|
2016-11-17 23:12:20 +10:00
|
|
|
}
|
|
|
|
- image->pdfium_use_colorspace = !!m_ColorSpace;
|
|
|
|
+// image->pdfium_use_colorspace = !!m_ColorSpace;
|
2017-01-31 10:51:58 +03:00
|
|
|
|
2016-11-17 23:12:20 +10:00
|
|
|
if (!parameters.nb_tile_to_decode) {
|
|
|
|
if (!opj_set_decode_area(l_codec, image, parameters.DA_x0, parameters.DA_y0,
|
2016-12-06 19:54:52 +03:00
|
|
|
diff -up chromium-55.0.2883.11/third_party/pdfium/core/fxcodec/codec/fx_codec_png.cpp.pdfium-system-libtiff-libpng chromium-55.0.2883.11/third_party/pdfium/core/fxcodec/codec/fx_codec_png.cpp
|
|
|
|
--- chromium-55.0.2883.11/third_party/pdfium/core/fxcodec/codec/fx_codec_png.cpp.pdfium-system-libtiff-libpng 2016-10-15 12:25:53.047704775 +0200
|
|
|
|
+++ chromium-55.0.2883.11/third_party/pdfium/core/fxcodec/codec/fx_codec_png.cpp 2016-10-15 12:32:27.308748242 +0200
|
2016-11-17 23:12:20 +10:00
|
|
|
@@ -10,10 +10,7 @@
|
2016-12-06 19:54:52 +03:00
|
|
|
#include "core/fxcodec/fx_codec.h"
|
|
|
|
#include "core/fxge/fx_dib.h"
|
2016-11-17 23:12:20 +10:00
|
|
|
|
|
|
|
-extern "C" {
|
|
|
|
-#undef FAR
|
|
|
|
-#include "third_party/libpng16/png.h"
|
|
|
|
-}
|
|
|
|
+#include <png.h>
|
|
|
|
|
|
|
|
static void _png_error_data(png_structp png_ptr, png_const_charp error_msg) {
|
|
|
|
if (png_get_error_ptr(png_ptr)) {
|
2017-03-11 21:09:25 +03:00
|
|
|
--- chromium-57.0.2987.98/third_party/pdfium/core/fxcodec/codec/fx_codec_tiff.cpp-orig 2017-03-09 23:05:26.000000000 +0300
|
|
|
|
+++ chromium-57.0.2987.98/third_party/pdfium/core/fxcodec/codec/fx_codec_tiff.cpp 2017-03-10 20:22:13.380102877 +0300
|
|
|
|
@@ -14,7 +14,7 @@
|
|
|
|
#include "third_party/base/ptr_util.h"
|
|
|
|
|
2016-11-17 23:12:20 +10:00
|
|
|
extern "C" {
|
|
|
|
-#include "third_party/libtiff/tiffiop.h"
|
|
|
|
+#include <tiffio.h>
|
|
|
|
}
|
2017-03-11 21:09:25 +03:00
|
|
|
|
2016-11-17 23:12:20 +10:00
|
|
|
class CCodec_TiffContext {
|
2017-03-11 21:09:25 +03:00
|
|
|
@@ -171,7 +171,7 @@ TIFF* tiff_open(void* context, const cha
|
2016-11-17 23:12:20 +10:00
|
|
|
tiff_write, tiff_seek, tiff_close, tiff_get_size,
|
|
|
|
tiff_map, tiff_unmap);
|
|
|
|
if (tif) {
|
|
|
|
- tif->tif_fd = (int)(intptr_t)context;
|
|
|
|
+ (void)TIFFSetFileno(tif, (int)(intptr_t)context);
|
|
|
|
}
|
|
|
|
return tif;
|
|
|
|
}
|
2016-12-06 19:54:52 +03:00
|
|
|
diff -up chromium-55.0.2883.11/third_party/pdfium/skia/BUILD.gn.pdfium-system-libtiff-libpng chromium-55.0.2883.11/third_party/pdfium/skia/BUILD.gn
|
|
|
|
--- chromium-55.0.2883.11/third_party/pdfium/skia/BUILD.gn.pdfium-system-libtiff-libpng 2016-10-14 00:04:44.000000000 +0200
|
|
|
|
+++ chromium-55.0.2883.11/third_party/pdfium/skia/BUILD.gn 2016-10-15 12:25:53.047704775 +0200
|
|
|
|
@@ -304,7 +304,7 @@ component("skia") {
|
2016-11-17 23:12:20 +10:00
|
|
|
|
|
|
|
deps = [
|
|
|
|
":skia_opts",
|
|
|
|
- "../third_party:fx_zlib",
|
|
|
|
+ "//third_party/zlib:zlib",
|
|
|
|
]
|
|
|
|
|
|
|
|
if (is_linux) {
|
2016-12-06 19:54:52 +03:00
|
|
|
diff -up chromium-55.0.2883.11/third_party/pdfium/third_party/BUILD.gn.pdfium-system-libtiff-libpng chromium-55.0.2883.11/third_party/pdfium/third_party/BUILD.gn
|
|
|
|
--- chromium-55.0.2883.11/third_party/pdfium/third_party/BUILD.gn.pdfium-system-libtiff-libpng 2016-10-14 00:04:44.000000000 +0200
|
|
|
|
+++ chromium-55.0.2883.11/third_party/pdfium/third_party/BUILD.gn 2016-10-15 12:25:53.048704762 +0200
|
2016-11-17 23:12:20 +10:00
|
|
|
@@ -5,6 +5,7 @@
|
|
|
|
import("//build/config/arm.gni")
|
|
|
|
import("//build_overrides/build.gni")
|
|
|
|
import("../pdfium.gni")
|
|
|
|
+import("//build/config/linux/pkg_config.gni")
|
|
|
|
|
|
|
|
group("third_party") {
|
|
|
|
deps = [
|
2016-12-06 19:54:52 +03:00
|
|
|
@@ -273,197 +274,34 @@ static_library("jpeg") {
|
2016-11-17 23:12:20 +10:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
-config("fx_libopenjpeg_warnings") {
|
|
|
|
- visibility = [ ":*" ]
|
|
|
|
- if (is_win) {
|
|
|
|
- cflags = [
|
|
|
|
- # Signed/unsigned comparisons.
|
|
|
|
- "/wd4018",
|
|
|
|
- ]
|
|
|
|
- }
|
|
|
|
+pkg_config("openjpeg_config") {
|
|
|
|
+ packages = [
|
|
|
|
+ "libopenjp2",
|
|
|
|
+ ]
|
|
|
|
}
|
|
|
|
|
|
|
|
-static_library("fx_libopenjpeg") {
|
|
|
|
- configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
- configs += [
|
|
|
|
- "//build/config/compiler:no_chromium_code",
|
|
|
|
- ":pdfium_third_party_config",
|
|
|
|
-
|
|
|
|
- # Must be after no_chromium_code for warning flags to be ordered correctly.
|
|
|
|
- ":fx_libopenjpeg_warnings",
|
|
|
|
- ]
|
|
|
|
- sources = [
|
|
|
|
- "libopenjpeg20/bio.c",
|
|
|
|
- "libopenjpeg20/cio.c",
|
|
|
|
- "libopenjpeg20/dwt.c",
|
|
|
|
- "libopenjpeg20/event.c",
|
|
|
|
- "libopenjpeg20/function_list.c",
|
|
|
|
- "libopenjpeg20/image.c",
|
|
|
|
- "libopenjpeg20/invert.c",
|
|
|
|
- "libopenjpeg20/j2k.c",
|
|
|
|
- "libopenjpeg20/jp2.c",
|
|
|
|
- "libopenjpeg20/mct.c",
|
|
|
|
- "libopenjpeg20/mqc.c",
|
|
|
|
- "libopenjpeg20/openjpeg.c",
|
|
|
|
- "libopenjpeg20/opj_clock.c",
|
|
|
|
- "libopenjpeg20/pi.c",
|
|
|
|
- "libopenjpeg20/raw.c",
|
|
|
|
- "libopenjpeg20/t1.c",
|
|
|
|
- "libopenjpeg20/t2.c",
|
|
|
|
- "libopenjpeg20/tcd.c",
|
|
|
|
- "libopenjpeg20/tgt.c",
|
|
|
|
- ]
|
|
|
|
+source_set("fx_libopenjpeg") {
|
|
|
|
+ public_configs = [ ":openjpeg_config" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
-static_library("fx_lpng") {
|
|
|
|
- configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
- configs += [
|
|
|
|
- "//build/config/compiler:no_chromium_code",
|
|
|
|
- ":pdfium_third_party_config",
|
|
|
|
+pkg_config("fx_libpng_config") {
|
|
|
|
+ packages = [
|
|
|
|
+ "libpng",
|
|
|
|
]
|
|
|
|
- sources = [
|
|
|
|
- "libpng16/png.c",
|
|
|
|
- "libpng16/png.h",
|
|
|
|
- "libpng16/pngconf.h",
|
|
|
|
- "libpng16/pngdebug.h",
|
|
|
|
- "libpng16/pngerror.c",
|
|
|
|
- "libpng16/pngget.c",
|
|
|
|
- "libpng16/pnginfo.h",
|
|
|
|
- "libpng16/pnglibconf.h",
|
|
|
|
- "libpng16/pngmem.c",
|
|
|
|
- "libpng16/pngpread.c",
|
|
|
|
- "libpng16/pngprefix.h",
|
|
|
|
- "libpng16/pngpriv.h",
|
|
|
|
- "libpng16/pngread.c",
|
|
|
|
- "libpng16/pngrio.c",
|
|
|
|
- "libpng16/pngrtran.c",
|
|
|
|
- "libpng16/pngrutil.c",
|
|
|
|
- "libpng16/pngset.c",
|
|
|
|
- "libpng16/pngstruct.h",
|
|
|
|
- "libpng16/pngtrans.c",
|
|
|
|
- "libpng16/pngwio.c",
|
|
|
|
- "libpng16/pngwrite.c",
|
|
|
|
- "libpng16/pngwtran.c",
|
|
|
|
- "libpng16/pngwutil.c",
|
|
|
|
- ]
|
|
|
|
-
|
|
|
|
- defines = []
|
|
|
|
- cflags = []
|
|
|
|
-
|
|
|
|
- if (current_cpu == "x86" || current_cpu == "x64") {
|
|
|
|
- sources += [
|
|
|
|
- "libpng16/contrib/intel/filter_sse2_intrinsics.c",
|
|
|
|
- "libpng16/contrib/intel/intel_init.c",
|
|
|
|
- ]
|
|
|
|
- defines += [ "PNG_INTEL_SSE_OPT=1" ]
|
|
|
|
- } else if ((current_cpu == "arm" || current_cpu == "arm64") && arm_use_neon) {
|
|
|
|
- sources += [
|
|
|
|
- "libpng16/arm/arm_init.c",
|
|
|
|
- "libpng16/arm/filter_neon_intrinsics.c",
|
|
|
|
- ]
|
|
|
|
- defines += [
|
|
|
|
- "PNG_ARM_NEON_OPT=2",
|
|
|
|
- "PNG_ARM_NEON_IMPLEMENTATION=1",
|
|
|
|
- ]
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (is_win) {
|
|
|
|
- # Unary minus applied to unsigned type.
|
|
|
|
- cflags += [ "/wd4146" ]
|
|
|
|
- }
|
|
|
|
}
|
|
|
|
|
|
|
|
-if (pdf_enable_xfa) {
|
|
|
|
- static_library("fx_tiff") {
|
|
|
|
- configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
- configs += [
|
|
|
|
- "//build/config/compiler:no_chromium_code",
|
|
|
|
- ":pdfium_third_party_config",
|
|
|
|
- ]
|
|
|
|
- if (is_win) {
|
|
|
|
- # Need to undefine the macro since it is redefined in
|
|
|
|
- # tif_ojpeg.c and tif_jpeg.c.
|
|
|
|
- configs -= [ "//build/config/win:lean_and_mean" ]
|
|
|
|
- }
|
|
|
|
- deps = [
|
|
|
|
- "//third_party:jpeg",
|
|
|
|
- ]
|
|
|
|
- sources = [
|
|
|
|
- "libtiff/tif_aux.c",
|
|
|
|
- "libtiff/tif_close.c",
|
|
|
|
- "libtiff/tif_codec.c",
|
|
|
|
- "libtiff/tif_color.c",
|
|
|
|
- "libtiff/tif_compress.c",
|
|
|
|
- "libtiff/tif_dir.c",
|
|
|
|
- "libtiff/tif_dirinfo.c",
|
|
|
|
- "libtiff/tif_dirread.c",
|
|
|
|
- "libtiff/tif_dirwrite.c",
|
|
|
|
- "libtiff/tif_dumpmode.c",
|
|
|
|
- "libtiff/tif_error.c",
|
|
|
|
- "libtiff/tif_extension.c",
|
|
|
|
- "libtiff/tif_fax3.c",
|
|
|
|
- "libtiff/tif_fax3sm.c",
|
|
|
|
- "libtiff/tif_flush.c",
|
|
|
|
- "libtiff/tif_getimage.c",
|
|
|
|
- "libtiff/tif_jpeg.c",
|
|
|
|
- "libtiff/tif_luv.c",
|
|
|
|
- "libtiff/tif_lzw.c",
|
|
|
|
- "libtiff/tif_next.c",
|
|
|
|
- "libtiff/tif_ojpeg.c",
|
|
|
|
- "libtiff/tif_open.c",
|
|
|
|
- "libtiff/tif_packbits.c",
|
|
|
|
- "libtiff/tif_pixarlog.c",
|
|
|
|
- "libtiff/tif_predict.c",
|
|
|
|
- "libtiff/tif_print.c",
|
|
|
|
- "libtiff/tif_read.c",
|
|
|
|
- "libtiff/tif_strip.c",
|
|
|
|
- "libtiff/tif_swab.c",
|
|
|
|
- "libtiff/tif_thunder.c",
|
|
|
|
- "libtiff/tif_tile.c",
|
|
|
|
- "libtiff/tif_version.c",
|
|
|
|
- "libtiff/tif_warning.c",
|
|
|
|
- "libtiff/tif_write.c",
|
|
|
|
- "libtiff/tif_zip.c",
|
|
|
|
- "libtiff/tiffiop.h",
|
|
|
|
- "libtiff/tiffvers.h",
|
|
|
|
- ]
|
|
|
|
- }
|
|
|
|
+source_set("fx_lpng") {
|
|
|
|
+ public_configs = [ ":fx_libpng_config" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
-# TODO(dsinclair): Remove if fixed upstream. https://crbug.com/507712
|
|
|
|
-config("fx_zlib_warnings") {
|
|
|
|
- visibility = [ ":*" ]
|
|
|
|
- if (is_clang) {
|
|
|
|
- cflags = [ "-Wno-shift-negative-value" ]
|
|
|
|
- }
|
|
|
|
+config("fx_tiff_config") {
|
|
|
|
+ libs = [ "tiff" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
-static_library("fx_zlib") {
|
|
|
|
- configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
- configs += [
|
|
|
|
- "//build/config/compiler:no_chromium_code",
|
|
|
|
- ":pdfium_third_party_config",
|
|
|
|
-
|
|
|
|
- # Must be after no_chromium_code for warning flags to be ordered correctly.
|
|
|
|
- ":fx_zlib_warnings",
|
|
|
|
- ]
|
|
|
|
- sources = [
|
|
|
|
- "zlib_v128/adler32.c",
|
|
|
|
- "zlib_v128/compress.c",
|
|
|
|
- "zlib_v128/crc32.c",
|
|
|
|
- "zlib_v128/deflate.c",
|
|
|
|
- "zlib_v128/gzclose.c",
|
|
|
|
- "zlib_v128/gzlib.c",
|
|
|
|
- "zlib_v128/gzread.c",
|
|
|
|
- "zlib_v128/gzwrite.c",
|
|
|
|
- "zlib_v128/infback.c",
|
|
|
|
- "zlib_v128/inffast.c",
|
|
|
|
- "zlib_v128/inflate.c",
|
|
|
|
- "zlib_v128/inftrees.c",
|
|
|
|
- "zlib_v128/trees.c",
|
|
|
|
- "zlib_v128/uncompr.c",
|
|
|
|
- "zlib_v128/zutil.c",
|
|
|
|
- ]
|
|
|
|
+if (pdf_enable_xfa) {
|
|
|
|
+ source_set("fx_tiff") {
|
|
|
|
+ public_configs = [ ":fx_tiff_config" ]
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
# Can not be a static library due to lack of .cc files.
|