Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2186)

Unified Diff: third_party/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh

Issue 12438036: Update harfbuzz-ng to 0.9.14 from 0.9.10 (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh
===================================================================
--- third_party/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh (리비전 191245)
+++ third_party/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh (작업 사본)
@@ -192,17 +192,6 @@
struct SingleSubst
{
- template <typename context_t>
- inline typename context_t::return_t process (context_t *c) const
- {
- TRACE_PROCESS (this);
- switch (u.format) {
- case 1: return TRACE_RETURN (c->process (u.format1));
- case 2: return TRACE_RETURN (c->process (u.format2));
- default:return TRACE_RETURN (c->default_return_value ());
- }
- }
-
inline bool serialize (hb_serialize_context_t *c,
Supplier<GlyphID> &glyphs,
Supplier<GlyphID> &substitutes,
@@ -230,6 +219,17 @@
}
}
+ template <typename context_t>
+ inline typename context_t::return_t dispatch (context_t *c) const
+ {
+ TRACE_DISPATCH (this);
+ switch (u.format) {
+ case 1: return TRACE_RETURN (c->dispatch (u.format1));
+ case 2: return TRACE_RETURN (c->dispatch (u.format2));
+ default:return TRACE_RETURN (c->default_return_value ());
+ }
+ }
+
inline bool sanitize (hb_sanitize_context_t *c) {
TRACE_SANITIZE (this);
if (!u.format.sanitize (c)) return TRACE_RETURN (false);
@@ -272,7 +272,8 @@
TRACE_APPLY (this);
if (unlikely (!substitute.len)) return TRACE_RETURN (false);
- unsigned int klass = c->property & HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE ? HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH : 0;
+ unsigned int klass = c->buffer->cur().glyph_props() &
+ HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE ? HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH : 0;
unsigned int count = substitute.len;
for (unsigned int i = 0; i < count; i++) {
set_lig_props_for_component (c->buffer->cur(), i);
@@ -384,16 +385,6 @@
struct MultipleSubst
{
- template <typename context_t>
- inline typename context_t::return_t process (context_t *c) const
- {
- TRACE_PROCESS (this);
- switch (u.format) {
- case 1: return TRACE_RETURN (c->process (u.format1));
- default:return TRACE_RETURN (c->default_return_value ());
- }
- }
-
inline bool serialize (hb_serialize_context_t *c,
Supplier<GlyphID> &glyphs,
Supplier<unsigned int> &substitute_len_list,
@@ -410,6 +401,16 @@
}
}
+ template <typename context_t>
+ inline typename context_t::return_t dispatch (context_t *c) const
+ {
+ TRACE_DISPATCH (this);
+ switch (u.format) {
+ case 1: return TRACE_RETURN (c->dispatch (u.format1));
+ default:return TRACE_RETURN (c->default_return_value ());
+ }
+ }
+
inline bool sanitize (hb_sanitize_context_t *c) {
TRACE_SANITIZE (this);
if (!u.format.sanitize (c)) return TRACE_RETURN (false);
@@ -535,16 +536,6 @@
struct AlternateSubst
{
- template <typename context_t>
- inline typename context_t::return_t process (context_t *c) const
- {
- TRACE_PROCESS (this);
- switch (u.format) {
- case 1: return TRACE_RETURN (c->process (u.format1));
- default:return TRACE_RETURN (c->default_return_value ());
- }
- }
-
inline bool serialize (hb_serialize_context_t *c,
Supplier<GlyphID> &glyphs,
Supplier<unsigned int> &alternate_len_list,
@@ -561,6 +552,16 @@
}
}
+ template <typename context_t>
+ inline typename context_t::return_t dispatch (context_t *c) const
+ {
+ TRACE_DISPATCH (this);
+ switch (u.format) {
+ case 1: return TRACE_RETURN (c->dispatch (u.format1));
+ default:return TRACE_RETURN (c->default_return_value ());
+ }
+ }
+
inline bool sanitize (hb_sanitize_context_t *c) {
TRACE_SANITIZE (this);
if (!u.format.sanitize (c)) return TRACE_RETURN (false);
@@ -637,9 +638,9 @@
ligate_input (c,
count,
&component[1],
- ligGlyph,
match_glyph,
NULL,
+ ligGlyph,
is_mark_ligature,
total_component_count);
@@ -840,16 +841,6 @@
struct LigatureSubst
{
- template <typename context_t>
- inline typename context_t::return_t process (context_t *c) const
- {
- TRACE_PROCESS (this);
- switch (u.format) {
- case 1: return TRACE_RETURN (c->process (u.format1));
- default:return TRACE_RETURN (c->default_return_value ());
- }
- }
-
inline bool serialize (hb_serialize_context_t *c,
Supplier<GlyphID> &first_glyphs,
Supplier<unsigned int> &ligature_per_first_glyph_count_list,
@@ -869,6 +860,16 @@
}
}
+ template <typename context_t>
+ inline typename context_t::return_t dispatch (context_t *c) const
+ {
+ TRACE_DISPATCH (this);
+ switch (u.format) {
+ case 1: return TRACE_RETURN (c->dispatch (u.format1));
+ default:return TRACE_RETURN (c->default_return_value ());
+ }
+ }
+
inline bool sanitize (hb_sanitize_context_t *c) {
TRACE_SANITIZE (this);
if (!u.format.sanitize (c)) return TRACE_RETURN (false);
@@ -1022,11 +1023,11 @@
struct ReverseChainSingleSubst
{
template <typename context_t>
- inline typename context_t::return_t process (context_t *c) const
+ inline typename context_t::return_t dispatch (context_t *c) const
{
- TRACE_PROCESS (this);
+ TRACE_DISPATCH (this);
switch (u.format) {
- case 1: return TRACE_RETURN (c->process (u.format1));
+ case 1: return TRACE_RETURN (c->dispatch (u.format1));
default:return TRACE_RETURN (c->default_return_value ());
}
}
@@ -1069,18 +1070,18 @@
};
template <typename context_t>
- inline typename context_t::return_t process (context_t *c, unsigned int lookup_type) const
+ inline typename context_t::return_t dispatch (context_t *c, unsigned int lookup_type) const
{
- TRACE_PROCESS (this);
+ TRACE_DISPATCH (this);
switch (lookup_type) {
- case Single: return TRACE_RETURN (u.single.process (c));
- case Multiple: return TRACE_RETURN (u.multiple.process (c));
- case Alternate: return TRACE_RETURN (u.alternate.process (c));
- case Ligature: return TRACE_RETURN (u.ligature.process (c));
- case Context: return TRACE_RETURN (u.context.process (c));
- case ChainContext: return TRACE_RETURN (u.chainContext.process (c));
- case Extension: return TRACE_RETURN (u.extension.process (c));
- case ReverseChainSingle: return TRACE_RETURN (u.reverseChainContextSingle.process (c));
+ case Single: return TRACE_RETURN (u.single.dispatch (c));
+ case Multiple: return TRACE_RETURN (u.multiple.dispatch (c));
+ case Alternate: return TRACE_RETURN (u.alternate.dispatch (c));
+ case Ligature: return TRACE_RETURN (u.ligature.dispatch (c));
+ case Context: return TRACE_RETURN (u.context.dispatch (c));
+ case ChainContext: return TRACE_RETURN (u.chainContext.dispatch (c));
+ case Extension: return TRACE_RETURN (u.extension.dispatch (c));
+ case ReverseChainSingle: return TRACE_RETURN (u.reverseChainContextSingle.dispatch (c));
default: return TRACE_RETURN (c->default_return_value ());
}
}
@@ -1137,34 +1138,18 @@
return lookup_type_is_reverse (type);
}
- template <typename context_t>
- inline typename context_t::return_t process (context_t *c) const
- {
- TRACE_PROCESS (this);
- unsigned int lookup_type = get_type ();
- unsigned int count = get_subtable_count ();
- for (unsigned int i = 0; i < count; i++) {
- typename context_t::return_t r = get_subtable (i).process (c, lookup_type);
- if (c->stop_sublookup_iteration (r))
- return TRACE_RETURN (r);
- }
- return TRACE_RETURN (c->default_return_value ());
- }
- template <typename context_t>
- static inline typename context_t::return_t process_recurse_func (context_t *c, unsigned int lookup_index);
-
inline hb_closure_context_t::return_t closure (hb_closure_context_t *c) const
{
TRACE_CLOSURE (this);
- c->set_recurse_func (process_recurse_func<hb_closure_context_t>);
- return TRACE_RETURN (process (c));
+ c->set_recurse_func (dispatch_recurse_func<hb_closure_context_t>);
+ return TRACE_RETURN (dispatch (c));
}
inline hb_collect_glyphs_context_t::return_t collect_glyphs_lookup (hb_collect_glyphs_context_t *c) const
{
TRACE_COLLECT_GLYPHS (this);
- c->set_recurse_func (process_recurse_func<hb_collect_glyphs_context_t>);
- return TRACE_RETURN (process (c));
+ c->set_recurse_func (dispatch_recurse_func<hb_collect_glyphs_context_t>);
+ return TRACE_RETURN (dispatch (c));
}
template <typename set_t>
@@ -1174,7 +1159,7 @@
const Coverage *last = NULL;
unsigned int count = get_subtable_count ();
for (unsigned int i = 0; i < count; i++) {
- const Coverage *coverage = &get_subtable (i).process (&c, get_type ());
+ const Coverage *coverage = &get_subtable (i).dispatch (&c, get_type ());
if (coverage != last) {
coverage->add_coverage (glyphs);
last = coverage;
@@ -1187,15 +1172,15 @@
TRACE_WOULD_APPLY (this);
if (unlikely (!c->len)) return TRACE_RETURN (false);
if (!digest->may_have (c->glyphs[0])) return TRACE_RETURN (false);
- return TRACE_RETURN (process (c));
+ return TRACE_RETURN (dispatch (c));
}
inline bool apply_once (hb_apply_context_t *c) const
{
TRACE_APPLY (this);
- if (!c->check_glyph_property (&c->buffer->cur(), c->lookup_props, &c->property))
+ if (!c->check_glyph_property (&c->buffer->cur(), c->lookup_props))
return TRACE_RETURN (false);
- return TRACE_RETURN (process (c));
+ return TRACE_RETURN (dispatch (c));
}
static bool apply_recurse_func (hb_apply_context_t *c, unsigned int lookup_index);
@@ -1304,6 +1289,23 @@
ligatures_list, component_count_list, component_list));
}
+ template <typename context_t>
+ static inline typename context_t::return_t dispatch_recurse_func (context_t *c, unsigned int lookup_index);
+
+ template <typename context_t>
+ inline typename context_t::return_t dispatch (context_t *c) const
+ {
+ TRACE_DISPATCH (this);
+ unsigned int lookup_type = get_type ();
+ unsigned int count = get_subtable_count ();
+ for (unsigned int i = 0; i < count; i++) {
+ typename context_t::return_t r = get_subtable (i).dispatch (c, lookup_type);
+ if (c->stop_sublookup_iteration (r))
+ return TRACE_RETURN (r);
+ }
+ return TRACE_RETURN (c->default_return_value ());
+ }
+
inline bool sanitize (hb_sanitize_context_t *c)
{
TRACE_SANITIZE (this);
@@ -1315,9 +1317,7 @@
{
/* The spec says all subtables of an Extension lookup should
* have the same type. This is specially important if one has
- * a reverse type!
- *
- * We just check that they are all either forward, or reverse. */
+ * a reverse type! */
unsigned int type = get_subtable (0).u.extension.get_type ();
unsigned int count = get_subtable_count ();
for (unsigned int i = 1; i < count; i++)
@@ -1387,11 +1387,11 @@
}
template <typename context_t>
-inline typename context_t::return_t SubstLookup::process_recurse_func (context_t *c, unsigned int lookup_index)
+inline typename context_t::return_t SubstLookup::dispatch_recurse_func (context_t *c, unsigned int lookup_index)
{
const GSUB &gsub = *(hb_ot_layout_from_face (c->face)->gsub);
const SubstLookup &l = gsub.get_lookup (lookup_index);
- return l.process (c);
+ return l.dispatch (c);
}
inline bool SubstLookup::apply_recurse_func (hb_apply_context_t *c, unsigned int lookup_index)
@@ -1399,11 +1399,9 @@
const GSUB &gsub = *(hb_ot_layout_from_face (c->face)->gsub);
const SubstLookup &l = gsub.get_lookup (lookup_index);
unsigned int saved_lookup_props = c->lookup_props;
- unsigned int saved_property = c->property;
c->set_lookup (l);
bool ret = l.apply_once (c);
c->lookup_props = saved_lookup_props;
- c->property = saved_property;
return ret;
}
속성 변경: third_party/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh
___________________________________________________________________
추가: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698