summaryrefslogtreecommitdiffstats
path: root/third_party/harfbuzz/chromium.patch
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-20 18:55:48 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-20 18:55:48 +0000
commit09c1548dfc4628f86898818dbb7c032b278c91d5 (patch)
tree26354c7306108c692ee4d06a3e9c5c34dabbd834 /third_party/harfbuzz/chromium.patch
parente32e1792b61a0183fc48d4ee1cc79b7d8e89f0af (diff)
downloadchromium_src-09c1548dfc4628f86898818dbb7c032b278c91d5.zip
chromium_src-09c1548dfc4628f86898818dbb7c032b278c91d5.tar.gz
chromium_src-09c1548dfc4628f86898818dbb7c032b278c91d5.tar.bz2
linux: merge newer upstream harfbuzz
This merges includes the following changes. The changes by Adam Langley were previously in our tree while they were being upstreamed, but since that's now happened I've removed the changes mentioned in README.google. Adam Langley (3): Add contrib/ and initial file set Add fuzz testing tool. Make HB_ShaperItem a typedef to a named struct. Behdad Esfahbod (4): Fix typo in unused code Bug 23973 memory leak in _HB_OPEN_Load_EmptyClassDefinition Bug 23976 memory leak in Free_BaseArray Bug 24540 arabicSyriacOpenTypeShape causes read past end of string in getArabicProperties Graham Asher (1): Improved comments for HB_ShaperItem fields. BUG=20621 (But it doesn't look like this fixes it, though -- the getArabicProperties change mentioned in the diff was already available locally) Review URL: http://codereview.chromium.org/295025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29544 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/harfbuzz/chromium.patch')
-rw-r--r--third_party/harfbuzz/chromium.patch69
1 files changed, 69 insertions, 0 deletions
diff --git a/third_party/harfbuzz/chromium.patch b/third_party/harfbuzz/chromium.patch
new file mode 100644
index 0000000..3e26566
--- /dev/null
+++ b/third_party/harfbuzz/chromium.patch
@@ -0,0 +1,69 @@
+diff --git a/third_party/harfbuzz/contrib/harfbuzz-unicode.c b/third_party/harfbuzz/contrib/harfbuzz-unicode.c
+index 9b3c43e..51dd4ea 100644
+--- a/third_party/harfbuzz/contrib/harfbuzz-unicode.c
++++ b/third_party/harfbuzz/contrib/harfbuzz-unicode.c
+@@ -6,8 +6,9 @@
+ #include <harfbuzz-shaper.h>
+ #include "harfbuzz-unicode.h"
+
+-#include "tables/script-properties.h"
+ #include "tables/grapheme-break-properties.h"
++#include "tables/mirroring-properties.h"
++#include "tables/script-properties.h"
+
+ uint32_t
+ utf16_to_code_point(const uint16_t *chars, size_t len, ssize_t *iter) {
+@@ -234,10 +235,30 @@ HB_GetGraphemeAndLineBreakClass(HB_UChar32 ch, HB_GraphemeClass *gclass, HB_Line
+ *breakclass = HB_GetLineBreakClass(ch);
+ }
+
++static int
++mirroring_property_cmp(const void *vkey, const void *vcandidate) {
++ const uint32_t key = (uint32_t) (intptr_t) vkey;
++ const struct mirroring_property *candidate = vcandidate;
++
++ if (key < candidate->a) {
++ return -1;
++ } else if (key > candidate->a) {
++ return 1;
++ } else {
++ return 0;
++ }
++}
++
+ HB_UChar16
+ HB_GetMirroredChar(HB_UChar16 ch) {
+- abort();
+- return 0;
++ const void *mprop = bsearch((void *) (intptr_t) ch, mirroring_properties,
++ mirroring_properties_count,
++ sizeof(struct mirroring_property),
++ mirroring_property_cmp);
++ if (!mprop)
++ return ch;
++
++ return ((const struct mirroring_property *) mprop)->b;
+ }
+
+ void *
+diff --git a/third_party/harfbuzz/src/harfbuzz-shaper.cpp b/third_party/harfbuzz/src/harfbuzz-shaper.cpp
+index 36b9282..3628c88 100644
+--- a/third_party/harfbuzz/src/harfbuzz-shaper.cpp
++++ b/third_party/harfbuzz/src/harfbuzz-shaper.cpp
+@@ -433,7 +433,7 @@ void HB_HeuristicSetGlyphAttributes(HB_ShaperItem *item)
+
+ // ### zeroWidth and justification are missing here!!!!!
+
+- assert(item->num_glyphs <= length);
++ assert(length <= item->num_glyphs);
+
+ // qDebug("QScriptEngine::heuristicSetGlyphAttributes, num_glyphs=%d", item->num_glyphs);
+ HB_GlyphAttributes *attributes = item->attributes;
+@@ -451,7 +451,6 @@ void HB_HeuristicSetGlyphAttributes(HB_ShaperItem *item)
+ }
+ ++glyph_pos;
+ }
+- assert(glyph_pos == item->num_glyphs);
+
+ // first char in a run is never (treated as) a mark
+ int cStart = 0;