external: update pdfium to 4933

Stop tracking build_config.h in our repo, it can be now part of the
release tarball. It was a mistake in the past to think that this is
generated code, it's just external code.

Change-Id: Ife2fed362e28c53859399244e2f1247efb1efe86
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131695
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Miklos Vajna
2022-03-17 09:02:29 +01:00
parent 31ac4edf2e
commit 71b9523407
9 changed files with 44 additions and 157 deletions

View File

@@ -206,8 +206,8 @@ export ORCUS_SHA256SUM := 2a86c405a5929f749b27637509596421d46805753364ab258b035f
export ORCUS_TARBALL := liborcus-0.17.2.tar.bz2
export PAGEMAKER_SHA256SUM := 66adacd705a7d19895e08eac46d1e851332adf2e736c566bef1164e7a442519d
export PAGEMAKER_TARBALL := libpagemaker-0.0.4.tar.xz
export PDFIUM_SHA256SUM := 2652db0220ffd12b7f62a634e14d21a49116439148101c37cb24ba17b562a39f
export PDFIUM_TARBALL := pdfium-4818.tar.bz2
export PDFIUM_SHA256SUM := 563842a02657daee3a162b769fb42ae436782c839a5ac5d22d04c4e5664970e1
export PDFIUM_TARBALL := pdfium-4933.tar.bz2
export PIXMAN_SHA256SUM := 6d200dec3740d9ec4ec8d1180e25779c00bc749f94278c8b9021f5534db223fc
export PIXMAN_TARBALL := pixman-0.40.0.tar.gz
export LIBPNG_SHA256SUM := 505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca

View File

@@ -3,7 +3,7 @@ diff -Naur pdfium.org/third_party/base/allocator/partition_allocator/page_alloca
+++ pdfium/third_party/base/allocator/partition_allocator/page_allocator_internals_posix.h 2021-05-05 23:06:52.194081762 +0200
@@ -15,6 +15,12 @@
#endif
#if defined(OS_ANDROID)
#if BUILDFLAG(IS_ANDROID)
#include <sys/prctl.h>
+#ifndef PR_SET_VMA
+#define PR_SET_VMA 0x53564d41
@@ -12,5 +12,5 @@ diff -Naur pdfium.org/third_party/base/allocator/partition_allocator/page_alloca
+#define PR_SET_VMA_ANON_NAME 0
+#endif
#endif
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#include <sys/resource.h>

View File

@@ -298,6 +298,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_transferfuncdib \
UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_transferfunc \
UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_basedcs \
UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_indexedcs \
))
# fpdfdoc
@@ -488,6 +489,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fxge/dib/cfx_cmyk_to_srgb \
UnpackedTarball/pdfium/core/fxge/text_char_pos \
UnpackedTarball/pdfium/core/fxge/cfx_face \
UnpackedTarball/pdfium/core/fxge/calculate_pitch \
))
# javascript, build with pdf_enable_v8 disabled.

View File

@@ -13,4 +13,5 @@ gclient sync
git archive --prefix=pdfium/ --format=tar origin/chromium/${version} > pdfium-${version}.tar
(cd ..; tar --append --file pdfium/pdfium-${version}.tar pdfium/third_party/freetype/src/include/ pdfium/third_party/freetype/src/src/)
(cd ..; tar --append --file pdfium/pdfium-${version}.tar pdfium/third_party/abseil-cpp/absl/)
(cd ..; tar --append --file pdfium/pdfium-${version}.tar pdfium/build/build_config.h pdfium/build/buildflag.h)
bzip2 pdfium-${version}.tar

View File

@@ -34,10 +34,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,pdfium,\
$(foreach patch,$(pdfium_patches),external/pdfium/$(patch)) \
))
# Upstream build system generates this, but it's not really a generated file.
# Stripped down version from <https://dxr.mozilla.org/mozilla-central/source/ipc/chromium/src/build/build_config.h>.
$(eval $(call gb_UnpackedTarball_add_file,pdfium,build/build_config.h,external/pdfium/configs/build_config.h))
$(eval $(call gb_UnpackedTarball_set_post_action,pdfium,\
mv third_party/bigint/BigInteger.cc third_party/bigint/BigInteger.cpp && \
mv third_party/bigint/BigIntegerUtils.cc third_party/bigint/BigIntegerUtils.cpp && \

View File

@@ -51,13 +51,33 @@ index d8875786c..bc019ebe1 100644
}
void sycc_to_rgb(int offset,
--- a/core/fxcodec/fx_codec.h
+++ b/core/fxcodec/fx_codec.h
@@ -8,6 +8,7 @@
#define CORE_FXCODEC_FX_CODEC_H_
diff --git a/core/fxge/cfx_font.cpp b/core/fxge/cfx_font.cpp
index 8b3a72700..ea1db23f4 100644
--- a/core/fxge/cfx_font.cpp
+++ b/core/fxge/cfx_font.cpp
@@ -47,25 +47,9 @@ struct OUTLINE_PARAMS {
// TODO(crbug.com/pdfium/1400): When FT_Done_MM_Var() is more likely to be
// available to all users in the future, remove FreeMMVar() and use
// FT_Done_MM_Var() directly.
-//
-// Use weak symbols to check if FT_Done_MM_Var() is available at runtime.
-#if !BUILDFLAG(IS_WIN)
-extern "C" __attribute__((weak)) decltype(FT_Done_MM_Var) FT_Done_MM_Var;
-#endif
#include <map>
+#include <cstdint>
#include "third_party/abseil-cpp/absl/types/optional.h"
void FreeMMVar(FXFT_FaceRec* rec, FXFT_MM_VarPtr variation_desc) {
-#if BUILDFLAG(IS_WIN)
- // Assume `use_system_freetype` GN var is never set on Windows.
- constexpr bool has_ft_done_mm_var_func = true;
-#else
- static const bool has_ft_done_mm_var_func = !!FT_Done_MM_Var;
-#endif
- if (has_ft_done_mm_var_func) {
- FT_Done_MM_Var(CFX_GEModule::Get()->GetFontMgr()->GetFTLibrary(),
- variation_desc);
- } else {
FXFT_Free(rec, variation_desc);
- }
}
FX_RECT FXRectFromFTPos(FT_Pos left, FT_Pos top, FT_Pos right, FT_Pos bottom) {

View File

@@ -1,13 +1,13 @@
--- core/fxcrt/fx_memory_wrappers.h
+++ core/fxcrt/fx_memory_wrappers.h
@@ -70,8 +70,8 @@
@@ -70,8 +70,8 @@ struct FxPartitionAllocAllocator {
}
// There's no state, so they are all the same,
- bool operator==(const FxAllocAllocator& that) { return true; }
- bool operator!=(const FxAllocAllocator& that) { return false; }
+ bool operator==(const FxAllocAllocator& that) const { return true; }
+ bool operator!=(const FxAllocAllocator& that) const { return false; }
- bool operator==(const FxPartitionAllocAllocator& that) { return true; }
- bool operator!=(const FxPartitionAllocAllocator& that) { return false; }
+ bool operator==(const FxPartitionAllocAllocator& that) const { return true; }
+ bool operator!=(const FxPartitionAllocAllocator& that) const { return false; }
};
#endif // CORE_FXCRT_FX_MEMORY_WRAPPERS_H_
// Used to put backing store for std::vector<> and such

View File

@@ -12,12 +12,12 @@
#include "core/fxcrt/retain_ptr.h"
--- a/core/fpdfapi/font/cpdf_type1font.cpp
+++ b/core/fpdfapi/font/cpdf_type1font.cpp
@@ -14,7 +14,7 @@
@@ -19,7 +19,7 @@
#include "core/fxge/fx_freetype.h"
#if defined(OS_APPLE)
#if BUILDFLAG(IS_APPLE)
-#include <Carbon/Carbon.h>
+#include <CoreGraphics/CoreGraphics.h>
#endif // defined(OS_APPLE)
#endif // BUILDFLAG(IS_APPLE)
namespace {

View File

@@ -1,132 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file adds defines about the platform we're currently building on.
// Operating System:
// OS_WIN / OS_APPLE / OS_LINUX / OS_POSIX (MACOSX or LINUX)
// Compiler:
// COMPILER_MSVC / COMPILER_GCC
// Processor:
// ARCH_CPU_X86 / ARCH_CPU_X86_64 / ARCH_CPU_X86_FAMILY (X86 or X86_64)
// ARCH_CPU_32_BITS / ARCH_CPU_64_BITS
#ifndef BUILD_BUILD_CONFIG_H_
#define BUILD_BUILD_CONFIG_H_
// A set of macros to use for platform detection.
#if defined(ANDROID)
#define OS_ANDROID 1
#define OS_LINUX 1
#elif defined(__APPLE__)
#define OS_APPLE 1
#elif defined(__linux__)
#define OS_LINUX 1
#elif defined(__DragonFly__)
#define OS_DRAGONFLY 1
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#define OS_FREEBSD 1
#elif defined(__NetBSD__)
#define OS_NETBSD 1
#elif defined(__OpenBSD__)
#define OS_OPENBSD 1
#elif defined(__sun__)
#define OS_SOLARIS 1
#elif defined(_WIN32)
#define OS_WIN 1
#else
#error Please add support for your platform in build/build_config.h
#endif
// For access to standard BSD features, use OS_BSD instead of a
// more specific macro.
#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD) || defined(OS_NETBSD) || defined(OS_OPENBSD)
#define OS_BSD 1
#endif
// For access to standard POSIX features, use OS_POSIX instead of a more
// specific macro.
#if defined(OS_APPLE) || defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
#define OS_POSIX 1
#endif
// Compiler detection.
#if defined(__GNUC__)
#define COMPILER_GCC 1
#elif defined(_MSC_VER)
#define COMPILER_MSVC 1
#else
#error Please add support for your compiler in build/build_config.h
#endif
// Processor architecture detection. For more info on what's defined, see:
// http://msdn.microsoft.com/en-us/library/b0084kay.aspx
// http://www.agner.org/optimize/calling_conventions.pdf
// or with gcc, run: "echo | gcc -E -dM -"
#if defined(_M_X64) || defined(__x86_64__)
#define ARCH_CPU_X86_FAMILY 1
#define ARCH_CPU_X86_64 1
#define ARCH_CPU_64_BITS 1
#elif defined(_M_IX86) || defined(__i386__)
#define ARCH_CPU_X86_FAMILY 1
#define ARCH_CPU_X86 1
#define ARCH_CPU_32_BITS 1
#elif defined(__ARMEL__)
#define ARCH_CPU_ARM_FAMILY 1
#define ARCH_CPU_ARMEL 1
#define ARCH_CPU_32_BITS 1
#define WCHAR_T_IS_UNSIGNED 1
#elif defined(__powerpc64__)
#define ARCH_CPU_PPC64 1
#define ARCH_CPU_64_BITS 1
#elif defined(__ppc__) || defined(__powerpc__)
#define ARCH_CPU_PPC 1
#define ARCH_CPU_32_BITS 1
#elif defined(__sparc__) && defined(__arch64__)
#define ARCH_CPU_SPARC 1
#define ARCH_CPU_64_BITS 1
#elif defined(__sparc__)
#define ARCH_CPU_SPARC 1
#define ARCH_CPU_32_BITS 1
#elif defined(__mips64) && defined(__LP64__)
#define ARCH_CPU_MIPS 1
#define ARCH_CPU_64_BITS 1
#elif defined(__mips__)
#define ARCH_CPU_MIPS 1
#define ARCH_CPU_32_BITS 1
#elif defined(__hppa__)
#define ARCH_CPU_HPPA 1
#define ARCH_CPU_32_BITS 1
#elif defined(__ia64__)
#define ARCH_CPU_IA64 1
#define ARCH_CPU_64_BITS 1
#elif defined(__s390x__)
#define ARCH_CPU_S390X 1
#define ARCH_CPU_64_BITS 1
#elif defined(__s390__)
#define ARCH_CPU_S390 1
#define ARCH_CPU_32_BITS 1
#elif defined(__sh__)
#define ARCH_CPU_SH 1
#define ARCH_CPU_32_BITS 1
#elif defined(__alpha__)
#define ARCH_CPU_ALPHA 1
#define ARCH_CPU_64_BITS 1
#elif defined(__aarch64__) || defined(_M_ARM64)
#define ARCH_CPU_ARM_FAMILY 1
#define ARCH_CPU_ARM64 1
#define ARCH_CPU_64_BITS 1
#else
#error Please add support for your architecture in build/build_config.h
#endif
// Type detection for wchar_t.
#if defined(OS_WIN)
#define WCHAR_T_IS_UTF16
#else
#define WCHAR_T_IS_UTF32
#endif
#endif // BUILD_BUILD_CONFIG_H_