From 19319b7d047e50c54ff845715553adf4652cd793 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 17 Aug 2017 01:31:18 -0700 Subject: Roll build_revision to bff6ee8. Also roll buildtools_revision to f90f6a5 and update Android code that did not previously pass the Chromium style plugin. TBR=dsinclair@chromium.org Change-Id: Ifb1193cee8f68ac99a31c8d43195e4d7005eeafb Reviewed-on: https://pdfium-review.googlesource.com/11293 Commit-Queue: Lei Zhang Reviewed-by: Lei Zhang --- BUILD.gn | 4 ++++ DEPS | 4 ++-- core/fxge/android/cfpf_skiabufferfont.cpp | 16 ++++++++++++++ core/fxge/android/cfpf_skiabufferfont.h | 5 +++-- core/fxge/android/cfpf_skiafilefont.cpp | 17 ++++++++++++++ core/fxge/android/cfpf_skiafilefont.h | 5 +++-- core/fxge/android/cfpf_skiafontdescriptor.cpp | 32 +++++++++++++++++++++++++++ core/fxge/android/cfpf_skiafontdescriptor.h | 24 ++++++-------------- core/fxge/android/cfpf_skiapathfont.cpp | 27 ++++++++++++++++++++++ core/fxge/android/cfpf_skiapathfont.h | 17 +++++--------- 10 files changed, 117 insertions(+), 34 deletions(-) create mode 100644 core/fxge/android/cfpf_skiabufferfont.cpp create mode 100644 core/fxge/android/cfpf_skiafilefont.cpp create mode 100644 core/fxge/android/cfpf_skiafontdescriptor.cpp create mode 100644 core/fxge/android/cfpf_skiapathfont.cpp diff --git a/BUILD.gn b/BUILD.gn index 3c85212120..f7163ddf98 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -962,15 +962,19 @@ static_library("fxcrt") { static_library("fxge") { sources = [ + "core/fxge/android/cfpf_skiabufferfont.cpp", "core/fxge/android/cfpf_skiabufferfont.h", "core/fxge/android/cfpf_skiadevicemodule.cpp", "core/fxge/android/cfpf_skiadevicemodule.h", + "core/fxge/android/cfpf_skiafilefont.cpp", "core/fxge/android/cfpf_skiafilefont.h", "core/fxge/android/cfpf_skiafont.cpp", "core/fxge/android/cfpf_skiafont.h", + "core/fxge/android/cfpf_skiafontdescriptor.cpp", "core/fxge/android/cfpf_skiafontdescriptor.h", "core/fxge/android/cfpf_skiafontmgr.cpp", "core/fxge/android/cfpf_skiafontmgr.h", + "core/fxge/android/cfpf_skiapathfont.cpp", "core/fxge/android/cfpf_skiapathfont.h", "core/fxge/android/cfx_androidfontinfo.cpp", "core/fxge/android/cfx_androidfontinfo.h", diff --git a/DEPS b/DEPS index 3c30ce519a..d7fddccb27 100644 --- a/DEPS +++ b/DEPS @@ -5,8 +5,8 @@ vars = { 'pdfium_git': 'https://pdfium.googlesource.com', 'android_ndk_revision': '26d93ec07f3ce2ec2cdfeae1b21ee6f12ff868d8', - 'build_revision': 'f671d3baeb64d9dba628ad582e867cf1aebc0207', - 'buildtools_revision': 'e6b510a9daf822bbe9f922c200c58150803d2fd8', + 'build_revision': 'bff6ee8c495fdf3c0294254dbc8baf4344ac7e05', + 'buildtools_revision': 'f90f6a5af3e8cf843395bfe6243cf606f71b5344', 'catapult_revision': '86352b966b0245d6883e5f7df27687856978b6d7', 'clang_revision': '7770b47ac41c457739a5f3b6932cb1f479dee0e1', 'cygwin_revision': 'c89e446b273697fadf3a10ff1007a97c0b7de6df', diff --git a/core/fxge/android/cfpf_skiabufferfont.cpp b/core/fxge/android/cfpf_skiabufferfont.cpp new file mode 100644 index 0000000000..3fce483bdc --- /dev/null +++ b/core/fxge/android/cfpf_skiabufferfont.cpp @@ -0,0 +1,16 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "core/fxge/android/cfpf_skiabufferfont.h" + +CFPF_SkiaBufferFont::CFPF_SkiaBufferFont() + : m_pBuffer(nullptr), m_szBuffer(0) {} + +CFPF_SkiaBufferFont::~CFPF_SkiaBufferFont() = default; + +int32_t CFPF_SkiaBufferFont::GetType() const { + return FPF_SKIAFONTTYPE_Buffer; +} diff --git a/core/fxge/android/cfpf_skiabufferfont.h b/core/fxge/android/cfpf_skiabufferfont.h index 02fdadea1e..3a94a51b6a 100644 --- a/core/fxge/android/cfpf_skiabufferfont.h +++ b/core/fxge/android/cfpf_skiabufferfont.h @@ -13,10 +13,11 @@ class CFPF_SkiaBufferFont : public CFPF_SkiaFontDescriptor { public: - CFPF_SkiaBufferFont() : m_pBuffer(nullptr), m_szBuffer(0) {} + CFPF_SkiaBufferFont(); + ~CFPF_SkiaBufferFont() override; // CFPF_SkiaFontDescriptor - int32_t GetType() const override { return FPF_SKIAFONTTYPE_Buffer; } + int32_t GetType() const override; void* m_pBuffer; size_t m_szBuffer; diff --git a/core/fxge/android/cfpf_skiafilefont.cpp b/core/fxge/android/cfpf_skiafilefont.cpp new file mode 100644 index 0000000000..2cdf58a4ce --- /dev/null +++ b/core/fxge/android/cfpf_skiafilefont.cpp @@ -0,0 +1,17 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "core/fxge/android/cfpf_skiafilefont.h" + +#include "core/fxcrt/fx_stream.h" + +CFPF_SkiaFileFont::CFPF_SkiaFileFont() = default; + +CFPF_SkiaFileFont::~CFPF_SkiaFileFont() = default; + +int32_t CFPF_SkiaFileFont::GetType() const { + return FPF_SKIAFONTTYPE_File; +} diff --git a/core/fxge/android/cfpf_skiafilefont.h b/core/fxge/android/cfpf_skiafilefont.h index 2c9fc90ad2..4496fde078 100644 --- a/core/fxge/android/cfpf_skiafilefont.h +++ b/core/fxge/android/cfpf_skiafilefont.h @@ -16,10 +16,11 @@ class IFX_SeekableReadStream; class CFPF_SkiaFileFont : public CFPF_SkiaFontDescriptor { public: - CFPF_SkiaFileFont() {} + CFPF_SkiaFileFont(); + ~CFPF_SkiaFileFont() override; // CFPF_SkiaFontDescriptor - int32_t GetType() const override { return FPF_SKIAFONTTYPE_File; } + int32_t GetType() const override; CFX_RetainPtr m_pFile; }; diff --git a/core/fxge/android/cfpf_skiafontdescriptor.cpp b/core/fxge/android/cfpf_skiafontdescriptor.cpp new file mode 100644 index 0000000000..0c5210795c --- /dev/null +++ b/core/fxge/android/cfpf_skiafontdescriptor.cpp @@ -0,0 +1,32 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "core/fxge/android/cfpf_skiafontdescriptor.h" + +#include "core/fxcrt/fx_memory.h" + +CFPF_SkiaFontDescriptor::CFPF_SkiaFontDescriptor() + : m_pFamily(nullptr), + m_dwStyle(0), + m_iFaceIndex(0), + m_dwCharsets(0), + m_iGlyphNum(0) {} + +CFPF_SkiaFontDescriptor::~CFPF_SkiaFontDescriptor() { + FX_Free(m_pFamily); +} + +int32_t CFPF_SkiaFontDescriptor::GetType() const { + return FPF_SKIAFONTTYPE_Unknown; +} + +void CFPF_SkiaFontDescriptor::SetFamily(const char* pFamily) { + FX_Free(m_pFamily); + int32_t iSize = FXSYS_strlen(pFamily); + m_pFamily = FX_Alloc(char, iSize + 1); + memcpy(m_pFamily, pFamily, iSize * sizeof(char)); + m_pFamily[iSize] = 0; +} diff --git a/core/fxge/android/cfpf_skiafontdescriptor.h b/core/fxge/android/cfpf_skiafontdescriptor.h index f653050feb..00a19ecc54 100644 --- a/core/fxge/android/cfpf_skiafontdescriptor.h +++ b/core/fxge/android/cfpf_skiafontdescriptor.h @@ -13,23 +13,13 @@ class CFPF_SkiaFontDescriptor { public: - CFPF_SkiaFontDescriptor() - : m_pFamily(nullptr), - m_dwStyle(0), - m_iFaceIndex(0), - m_dwCharsets(0), - m_iGlyphNum(0) {} - virtual ~CFPF_SkiaFontDescriptor() { FX_Free(m_pFamily); } - - virtual int32_t GetType() const { return FPF_SKIAFONTTYPE_Unknown; } - - void SetFamily(const char* pFamily) { - FX_Free(m_pFamily); - int32_t iSize = FXSYS_strlen(pFamily); - m_pFamily = FX_Alloc(char, iSize + 1); - memcpy(m_pFamily, pFamily, iSize * sizeof(char)); - m_pFamily[iSize] = 0; - } + CFPF_SkiaFontDescriptor(); + virtual ~CFPF_SkiaFontDescriptor(); + + virtual int32_t GetType() const; + + void SetFamily(const char* pFamily); + char* m_pFamily; uint32_t m_dwStyle; int32_t m_iFaceIndex; diff --git a/core/fxge/android/cfpf_skiapathfont.cpp b/core/fxge/android/cfpf_skiapathfont.cpp new file mode 100644 index 0000000000..44e19bc8e5 --- /dev/null +++ b/core/fxge/android/cfpf_skiapathfont.cpp @@ -0,0 +1,27 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "core/fxge/android/cfpf_skiapathfont.h" + +#include "core/fxcrt/fx_memory.h" + +CFPF_SkiaPathFont::CFPF_SkiaPathFont() : m_pPath(nullptr) {} + +CFPF_SkiaPathFont::~CFPF_SkiaPathFont() { + FX_Free(m_pPath); +} + +int32_t CFPF_SkiaPathFont::GetType() const { + return FPF_SKIAFONTTYPE_Path; +} + +void CFPF_SkiaPathFont::SetPath(const char* pPath) { + FX_Free(m_pPath); + int32_t iSize = FXSYS_strlen(pPath); + m_pPath = FX_Alloc(char, iSize + 1); + memcpy(m_pPath, pPath, iSize * sizeof(char)); + m_pPath[iSize] = 0; +} diff --git a/core/fxge/android/cfpf_skiapathfont.h b/core/fxge/android/cfpf_skiapathfont.h index 8b7a4f9fb4..6cba42acff 100644 --- a/core/fxge/android/cfpf_skiapathfont.h +++ b/core/fxge/android/cfpf_skiapathfont.h @@ -14,19 +14,14 @@ class CFPF_SkiaPathFont : public CFPF_SkiaFontDescriptor { public: - CFPF_SkiaPathFont() : m_pPath(nullptr) {} - ~CFPF_SkiaPathFont() override { FX_Free(m_pPath); } + CFPF_SkiaPathFont(); + ~CFPF_SkiaPathFont() override; // CFPF_SkiaFontDescriptor - int32_t GetType() const override { return FPF_SKIAFONTTYPE_Path; } - - void SetPath(const char* pPath) { - FX_Free(m_pPath); - int32_t iSize = FXSYS_strlen(pPath); - m_pPath = FX_Alloc(char, iSize + 1); - memcpy(m_pPath, pPath, iSize * sizeof(char)); - m_pPath[iSize] = 0; - } + int32_t GetType() const override; + + void SetPath(const char* pPath); + char* m_pPath; }; -- cgit v1.2.3