2017-08-09 15:04:16 +03:00
|
|
|
diff -up chromium-60.0.3112.40/third_party/pdfium/BUILD.gn.pdfium-system-libtiff-libpng chromium-60.0.3112.40/third_party/pdfium/BUILD.gn
|
|
|
|
--- chromium-60.0.3112.40/third_party/pdfium/BUILD.gn.pdfium-system-libtiff-libpng 2017-06-22 00:04:09.000000000 +0200
|
|
|
|
+++ chromium-60.0.3112.40/third_party/pdfium/BUILD.gn 2017-06-24 00:05:50.521671902 +0200
|
|
|
|
@@ -19,7 +19,6 @@ config("pdfium_common_config") {
|
2017-07-21 15:01:06 +03:00
|
|
|
ldflags = []
|
|
|
|
include_dirs = [ "." ]
|
2016-11-17 23:12:20 +10:00
|
|
|
defines = [
|
|
|
|
- "OPJ_STATIC",
|
|
|
|
"PNG_PREFIX",
|
|
|
|
"PNG_USE_READ_MACROS",
|
|
|
|
]
|
2017-09-19 14:51:35 +03:00
|
|
|
@@ -663,6 +663,7 @@
|
|
|
|
configs += [ ":pdfium_core_config" ]
|
|
|
|
deps = [
|
|
|
|
":fxcrt",
|
|
|
|
+ "third_party:fx_libopenjpeg",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2017-08-09 15:04:16 +03:00
|
|
|
diff -up chromium-60.0.3112.40/third_party/pdfium/core/fxcodec/codec/ccodec_pngmodule.cpp.pdfium-system-libtiff-libpng chromium-60.0.3112.40/third_party/pdfium/core/fxcodec/codec/ccodec_pngmodule.cpp
|
|
|
|
--- chromium-60.0.3112.40/third_party/pdfium/core/fxcodec/codec/ccodec_pngmodule.cpp.pdfium-system-libtiff-libpng 2017-06-22 00:04:10.000000000 +0200
|
|
|
|
+++ chromium-60.0.3112.40/third_party/pdfium/core/fxcodec/codec/ccodec_pngmodule.cpp 2017-06-24 00:05:50.523671865 +0200
|
2017-09-19 14:51:35 +03:00
|
|
|
@@ -14,10 +14,7 @@
|
2016-12-06 19:54:52 +03:00
|
|
|
#include "core/fxge/fx_dib.h"
|
2017-09-19 14:51:35 +03:00
|
|
|
#include "third_party/base/ptr_util.h"
|
2017-07-21 15:01:06 +03:00
|
|
|
|
2016-11-17 23:12:20 +10:00
|
|
|
-extern "C" {
|
|
|
|
-#undef FAR
|
|
|
|
-#include "third_party/libpng16/png.h"
|
2017-09-19 14:51:35 +03:00
|
|
|
-} // extern "C"
|
2016-11-17 23:12:20 +10:00
|
|
|
+#include <png.h>
|
2017-07-21 15:01:06 +03:00
|
|
|
|
2017-09-19 14:51:35 +03:00
|
|
|
#define PNG_ERROR_SIZE 256
|
|
|
|
|
2017-08-09 15:04:16 +03:00
|
|
|
diff -up chromium-60.0.3112.40/third_party/pdfium/core/fxcodec/codec/ccodec_tiffmodule.cpp.pdfium-system-libtiff-libpng chromium-60.0.3112.40/third_party/pdfium/core/fxcodec/codec/ccodec_tiffmodule.cpp
|
|
|
|
--- chromium-60.0.3112.40/third_party/pdfium/core/fxcodec/codec/ccodec_tiffmodule.cpp.pdfium-system-libtiff-libpng 2017-06-22 00:04:10.000000000 +0200
|
|
|
|
+++ chromium-60.0.3112.40/third_party/pdfium/core/fxcodec/codec/ccodec_tiffmodule.cpp 2017-06-24 00:05:50.524671846 +0200
|
2017-09-19 14:51:35 +03:00
|
|
|
@@ -17,9 +17,7 @@
|
|
|
|
#include "third_party/base/logging.h"
|
2017-03-11 21:09:25 +03:00
|
|
|
#include "third_party/base/ptr_util.h"
|
2017-07-21 15:01:06 +03:00
|
|
|
|
2017-09-19 14:51:35 +03:00
|
|
|
-extern "C" {
|
2016-11-17 23:12:20 +10:00
|
|
|
-#include "third_party/libtiff/tiffiop.h"
|
2017-09-19 14:51:35 +03:00
|
|
|
-}
|
2016-11-17 23:12:20 +10:00
|
|
|
+#include <tiffio.h>
|
2017-07-21 15:01:06 +03:00
|
|
|
|
2017-09-19 14:51:35 +03:00
|
|
|
class CTiffContext : public CCodec_TiffModule::Context {
|
|
|
|
public:
|
|
|
|
@@ -176,7 +174,7 @@
|
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;
|
|
|
|
}
|
2017-08-09 15:04:16 +03:00
|
|
|
diff -up chromium-60.0.3112.40/third_party/pdfium/core/fxcodec/codec/cjpx_decoder.h.pdfium-system-libtiff-libpng chromium-60.0.3112.40/third_party/pdfium/core/fxcodec/codec/cjpx_decoder.h
|
|
|
|
--- chromium-60.0.3112.40/third_party/pdfium/core/fxcodec/codec/cjpx_decoder.h.pdfium-system-libtiff-libpng 2017-06-24 00:05:50.526671809 +0200
|
|
|
|
+++ chromium-60.0.3112.40/third_party/pdfium/core/fxcodec/codec/cjpx_decoder.h 2017-06-25 12:29:14.039984794 +0200
|
|
|
|
@@ -10,7 +10,7 @@
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "core/fxcrt/cfx_unowned_ptr.h"
|
|
|
|
-#include "third_party/libopenjpeg20/openjpeg.h"
|
|
|
|
+#include <openjpeg.h>
|
|
|
|
|
|
|
|
class CPDF_ColorSpace;
|
|
|
|
|
|
|
|
diff -up chromium-60.0.3112.40/third_party/pdfium/core/fxcodec/codec/codec_int.h.pdfium-system-libtiff-libpng chromium-60.0.3112.40/third_party/pdfium/core/fxcodec/codec/codec_int.h
|
|
|
|
--- chromium-60.0.3112.40/third_party/pdfium/core/fxcodec/codec/codec_int.h.pdfium-system-libtiff-libpng 2017-06-22 00:04:10.000000000 +0200
|
|
|
|
+++ chromium-60.0.3112.40/third_party/pdfium/core/fxcodec/codec/codec_int.h 2017-06-24 00:05:50.521671902 +0200
|
|
|
|
@@ -16,7 +16,7 @@
|
|
|
|
|
|
|
|
#include "core/fxcodec/fx_codec.h"
|
|
|
|
#include "core/fxcodec/jbig2/JBig2_Context.h"
|
|
|
|
-#include "third_party/libopenjpeg20/openjpeg.h"
|
|
|
|
+#include <openjpeg.h>
|
|
|
|
|
|
|
|
class CPDF_ColorSpace;
|
|
|
|
|
|
|
|
diff -up chromium-60.0.3112.40/third_party/pdfium/core/fxcodec/codec/fx_codec_jpx_opj.cpp.pdfium-system-libtiff-libpng chromium-60.0.3112.40/third_party/pdfium/core/fxcodec/codec/fx_codec_jpx_opj.cpp
|
|
|
|
--- chromium-60.0.3112.40/third_party/pdfium/core/fxcodec/codec/fx_codec_jpx_opj.cpp.pdfium-system-libtiff-libpng 2017-06-22 00:04:10.000000000 +0200
|
|
|
|
+++ chromium-60.0.3112.40/third_party/pdfium/core/fxcodec/codec/fx_codec_jpx_opj.cpp 2017-06-24 00:26:21.330902789 +0200
|
2017-09-19 14:51:35 +03:00
|
|
|
@@ -17,8 +17,12 @@
|
|
|
|
#include "core/fxcrt/fx_memory.h"
|
2017-08-09 15:04:16 +03:00
|
|
|
#include "core/fxcrt/fx_safe_types.h"
|
|
|
|
#include "third_party/base/ptr_util.h"
|
|
|
|
-#include "third_party/libopenjpeg20/openjpeg.h"
|
2017-09-19 14:51:35 +03:00
|
|
|
-#include "third_party/libopenjpeg20/opj_malloc.h"
|
2017-08-09 15:04:16 +03:00
|
|
|
+#include <openjpeg.h>
|
2017-09-19 14:51:35 +03:00
|
|
|
+//#include <opj_malloc.h>
|
|
|
|
+extern "C" {
|
|
|
|
+extern void * opj_calloc(size_t, size_t);
|
|
|
|
+extern void opj_free(void *);
|
|
|
|
+}
|
2017-08-09 15:04:16 +03:00
|
|
|
|
|
|
|
#if defined(USE_SYSTEM_LCMS2)
|
|
|
|
#include <lcms2.h>
|
2017-09-19 14:51:35 +03:00
|
|
|
@@ -518,7 +518,7 @@
|
2017-08-09 15:04:16 +03:00
|
|
|
image = nullptr;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
- image->pdfium_use_colorspace = !!m_ColorSpace;
|
|
|
|
+// image->pdfium_use_colorspace = !!m_ColorSpace;
|
|
|
|
|
|
|
|
if (!parameters.nb_tile_to_decode) {
|
|
|
|
if (!opj_set_decode_area(l_codec, image, parameters.DA_x0, parameters.DA_y0,
|
|
|
|
diff -up chromium-60.0.3112.40/third_party/pdfium/third_party/BUILD.gn.pdfium-system-libtiff-libpng chromium-60.0.3112.40/third_party/pdfium/third_party/BUILD.gn
|
|
|
|
--- chromium-60.0.3112.40/third_party/pdfium/third_party/BUILD.gn.pdfium-system-libtiff-libpng 2017-06-22 00:04:10.000000000 +0200
|
|
|
|
+++ chromium-60.0.3112.40/third_party/pdfium/third_party/BUILD.gn 2017-06-24 22:25:18.901585830 +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 = [
|
2017-08-09 15:04:16 +03:00
|
|
|
@@ -351,164 +352,33 @@ group("lcms2") {
|
2017-07-21 15:01:06 +03:00
|
|
|
}
|
2016-11-17 23:12:20 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
-config("fx_libopenjpeg_warnings") {
|
|
|
|
- visibility = [ ":*" ]
|
|
|
|
- if (is_win) {
|
|
|
|
- cflags = [
|
|
|
|
- # Signed/unsigned comparisons.
|
|
|
|
- "/wd4018",
|
|
|
|
- ]
|
|
|
|
- }
|
2017-07-21 15:01:06 +03:00
|
|
|
-}
|
|
|
|
-
|
2016-11-17 23:12:20 +10:00
|
|
|
-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",
|
2017-07-21 15:01:06 +03:00
|
|
|
+pkg_config("openjpeg_config") {
|
|
|
|
+ packages = [
|
|
|
|
+ "libopenjp2",
|
|
|
|
]
|
2016-11-17 23:12:20 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
-static_library("fx_lpng") {
|
|
|
|
- configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
- configs += [
|
|
|
|
- "//build/config/compiler:no_chromium_code",
|
|
|
|
- ":pdfium_third_party_config",
|
2017-07-21 15:01:06 +03:00
|
|
|
- ]
|
2016-11-17 23:12:20 +10:00
|
|
|
- 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",
|
|
|
|
- ]
|
2017-07-21 15:01:06 +03:00
|
|
|
+source_set("fx_libopenjpeg") {
|
|
|
|
+ public_configs = [ ":openjpeg_config" ]
|
|
|
|
+}
|
|
|
|
|
2016-11-17 23:12:20 +10:00
|
|
|
- defines = []
|
|
|
|
- cflags = []
|
2017-07-21 15:01:06 +03:00
|
|
|
- deps = [
|
2017-08-09 15:04:16 +03:00
|
|
|
- ":zlib",
|
2017-07-21 15:01:06 +03:00
|
|
|
+pkg_config("fx_libpng_config") {
|
|
|
|
+ packages = [
|
|
|
|
+ "libpng",
|
|
|
|
]
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+source_set("fx_lpng") {
|
|
|
|
+ public_configs = [ ":fx_libpng_config" ]
|
|
|
|
+}
|
|
|
|
|
2016-11-17 23:12:20 +10:00
|
|
|
- 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" ]
|
|
|
|
- }
|
2017-07-21 15:01:06 +03:00
|
|
|
+config("fx_tiff_config") {
|
|
|
|
+ libs = [ "tiff" ]
|
2016-11-17 23:12:20 +10:00
|
|
|
}
|
|
|
|
|
2017-07-21 15:01:06 +03:00
|
|
|
if (pdf_enable_xfa) {
|
2016-11-17 23:12:20 +10:00
|
|
|
- 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 = [
|
2017-08-09 15:04:16 +03:00
|
|
|
- ":zlib",
|
2016-11-17 23:12:20 +10:00
|
|
|
- "//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_tiff") {
|
|
|
|
+ public_configs = [ ":fx_tiff_config" ]
|
2017-07-21 15:01:06 +03:00
|
|
|
}
|
2016-11-17 23:12:20 +10:00
|
|
|
}
|
|
|
|
|