summaryrefslogtreecommitdiffstats
path: root/gfx/thebes
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-05-04 10:38:17 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-05-04 10:38:17 +0200
commit2eddf19168d5230877cff574ed548610e8eebc51 (patch)
tree439c3b6047965cfc9d3358a4ef23ff61e91d4c0a /gfx/thebes
parentcd1ab47cfd41fabae4fa41ae6bfd040caf8d806f (diff)
downloadUXP-2eddf19168d5230877cff574ed548610e8eebc51.tar
UXP-2eddf19168d5230877cff574ed548610e8eebc51.tar.gz
UXP-2eddf19168d5230877cff574ed548610e8eebc51.tar.lz
UXP-2eddf19168d5230877cff574ed548610e8eebc51.tar.xz
UXP-2eddf19168d5230877cff574ed548610e8eebc51.zip
Issue #325 Part 3: Remove support for using legacy Gecko normalization in gfxHarfBuzzShaper.
Diffstat (limited to 'gfx/thebes')
-rw-r--r--gfx/thebes/gfxHarfBuzzShaper.cpp30
-rw-r--r--gfx/thebes/moz.build10
2 files changed, 6 insertions, 34 deletions
diff --git a/gfx/thebes/gfxHarfBuzzShaper.cpp b/gfx/thebes/gfxHarfBuzzShaper.cpp
index 1f472f88d..4b9dbbc14 100644
--- a/gfx/thebes/gfxHarfBuzzShaper.cpp
+++ b/gfx/thebes/gfxHarfBuzzShaper.cpp
@@ -12,20 +12,14 @@
#include "mozilla/Sprintf.h"
#include "nsUnicodeProperties.h"
#include "nsUnicodeScriptCodes.h"
-#include "nsUnicodeNormalizer.h"
#include "harfbuzz/hb.h"
#include "harfbuzz/hb-ot.h"
-#if ENABLE_INTL_API // ICU is available: we'll use it for Unicode composition
- // and decomposition in preference to nsUnicodeNormalizer.
#include "unicode/unorm.h"
#include "unicode/utext.h"
-#define MOZ_HB_SHAPER_USE_ICU_NORMALIZATION 1
+
static const UNormalizer2 * sNormalizer = nullptr;
-#else
-#undef MOZ_HB_SHAPER_USE_ICU_NORMALIZATION
-#endif
#include <algorithm>
@@ -1091,8 +1085,6 @@ HBUnicodeCompose(hb_unicode_funcs_t *ufuncs,
hb_codepoint_t *ab,
void *user_data)
{
-#if MOZ_HB_SHAPER_USE_ICU_NORMALIZATION
-
if (sNormalizer) {
UChar32 ch = unorm2_composePair(sNormalizer, a, b);
if (ch >= 0) {
@@ -1101,14 +1093,6 @@ HBUnicodeCompose(hb_unicode_funcs_t *ufuncs,
}
}
-#else // no ICU available, use the old nsUnicodeNormalizer
-
- if (nsUnicodeNormalizer::Compose(a, b, ab)) {
- return true;
- }
-
-#endif
-
return false;
}
@@ -1129,8 +1113,6 @@ HBUnicodeDecompose(hb_unicode_funcs_t *ufuncs,
}
#endif
-#if MOZ_HB_SHAPER_USE_ICU_NORMALIZATION
-
if (!sNormalizer) {
return false;
}
@@ -1162,12 +1144,6 @@ HBUnicodeDecompose(hb_unicode_funcs_t *ufuncs,
utext_close(&text);
return *b != 0 || *a != ab;
-
-#else // no ICU available, use the old nsUnicodeNormalizer
-
- return nsUnicodeNormalizer::DecomposeNonRecursively(ab, a, b);
-
-#endif
}
static void
@@ -1250,11 +1226,9 @@ gfxHarfBuzzShaper::Initialize()
HBUnicodeDecompose,
nullptr, nullptr);
-#if MOZ_HB_SHAPER_USE_ICU_NORMALIZATION
UErrorCode error = U_ZERO_ERROR;
sNormalizer = unorm2_getNFCInstance(&error);
- NS_ASSERTION(U_SUCCESS(error), "failed to get ICU normalizer");
-#endif
+ MOZ_ASSERT(U_SUCCESS(error), "failed to get ICU normalizer");
}
gfxFontEntry *entry = mFont->GetFontEntry();
diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build
index 227b2b875..e253d7891 100644
--- a/gfx/thebes/moz.build
+++ b/gfx/thebes/moz.build
@@ -223,12 +223,10 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
'DeviceManagerDx.cpp',
]
-# We prefer to use ICU for normalization functions, but currently it is only
-# available if we're building with the Intl API enabled:
-if CONFIG['ENABLE_INTL_API']:
- USE_LIBS += [
- 'icu',
- ]
+# We use ICU for normalization functions
+USE_LIBS += [
+ 'icu',
+]
include('/ipc/chromium/chromium-config.mozbuild')