summaryrefslogtreecommitdiff
path: root/core/fxge/android/cfpf_skiafontmgr.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-08-17 23:52:57 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-17 23:52:57 +0000
commit032b3bed2b1888f1226e1d940fe41e9a09d2336c (patch)
treee0c98a9b06d76f141560923a3197b52927e27918 /core/fxge/android/cfpf_skiafontmgr.cpp
parent2f113cac5ff28008c702898f41e691c8d233db5f (diff)
downloadpdfium-032b3bed2b1888f1226e1d940fe41e9a09d2336c.tar.xz
Ger rid of some #defines in Android font code.chromium/3528chromium/3527
Change-Id: Ia3f98fb166743c2a38954b279e3bbf96e5e09073 Reviewed-on: https://pdfium-review.googlesource.com/40591 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxge/android/cfpf_skiafontmgr.cpp')
-rw-r--r--core/fxge/android/cfpf_skiafontmgr.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/core/fxge/android/cfpf_skiafontmgr.cpp b/core/fxge/android/cfpf_skiafontmgr.cpp
index 37cd4516b7..cd6aab1f2d 100644
--- a/core/fxge/android/cfpf_skiafontmgr.cpp
+++ b/core/fxge/android/cfpf_skiafontmgr.cpp
@@ -6,11 +6,6 @@
#include "core/fxge/android/cfpf_skiafontmgr.h"
-#define FPF_SKIAMATCHWEIGHT_NAME1 62
-#define FPF_SKIAMATCHWEIGHT_NAME2 60
-#define FPF_SKIAMATCHWEIGHT_1 16
-#define FPF_SKIAMATCHWEIGHT_2 8
-
#include <algorithm>
#include "core/fxcrt/fx_codepage.h"
@@ -25,6 +20,11 @@
namespace {
+constexpr int FPF_SKIAMATCHWEIGHT_NAME1 = 62;
+constexpr int FPF_SKIAMATCHWEIGHT_NAME2 = 60;
+constexpr int FPF_SKIAMATCHWEIGHT_1 = 16;
+constexpr int FPF_SKIAMATCHWEIGHT_2 = 8;
+
struct FPF_SKIAFONTMAP {
uint32_t dwFamily;
uint32_t dwSubSt;
@@ -252,8 +252,7 @@ void CFPF_SkiaFontMgr::LoadSystemFonts() {
CFPF_SkiaFont* CFPF_SkiaFontMgr::CreateFont(const ByteStringView& bsFamilyname,
uint8_t uCharset,
- uint32_t dwStyle,
- uint32_t dwMatch) {
+ uint32_t dwStyle) {
uint32_t dwHash = FPF_SKIAGetFamilyHash(bsFamilyname, dwStyle, uCharset);
auto it = m_FamilyFonts.find(dwHash);
if (it != m_FamilyFonts.end())
@@ -268,8 +267,7 @@ CFPF_SkiaFont* CFPF_SkiaFontMgr::CreateFont(const ByteStringView& bsFamilyname,
if (uCharset != FX_CHARSET_MSWin_Arabic &&
FPF_SkiaMaybeArabic(bsFamilyname)) {
uCharset = FX_CHARSET_MSWin_Arabic;
- } else if (uCharset == FX_CHARSET_ANSI &&
- (dwMatch & FPF_MATCHFONT_REPLACEANSI)) {
+ } else if (uCharset == FX_CHARSET_ANSI) {
uCharset = FX_CHARSET_Default;
}
int32_t nExpectVal = FPF_SKIAMATCHWEIGHT_NAME1 + FPF_SKIAMATCHWEIGHT_1 * 3 +