X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fhb-ot-layout-common-private.hh;h=ce47e22a065e86c715c26e9cc64f9bc469d2a0df;hb=45412523dc295cb5ee12e096bfacb282cc925843;hp=2ba0ef452db456ad8669d9a861a347f328a2b22d;hpb=98370e89d1bff248737b482d129c2a4deb8bfd95;p=framework%2Fuifw%2Fharfbuzz.git diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh index 2ba0ef4..ce47e22 100644 --- a/src/hb-ot-layout-common-private.hh +++ b/src/hb-ot-layout-common-private.hh @@ -1,6 +1,6 @@ /* - * Copyright (C) 2007,2008,2009 Red Hat, Inc. - * Copyright (C) 2010 Google, Inc. + * Copyright © 2007,2008,2009 Red Hat, Inc. + * Copyright © 2010 Google, Inc. * * This is part of HarfBuzz, a text shaping library. * @@ -78,6 +78,9 @@ template struct RecordArrayOf : SortedArrayOf > { inline const Tag& get_tag (unsigned int i) const { + /* We cheat slightly and don't define separate Null objects + * for Record types. Instead, we return the correct Null(Tag) + * here. */ if (unlikely (i >= this->len)) return Null(Tag); return (*this)[i].tag; } @@ -86,10 +89,10 @@ struct RecordArrayOf : SortedArrayOf > { hb_tag_t *record_tags /* OUT */) const { if (record_count) { - const Record *array = this->sub_array (start_offset, record_count); + const Record *arr = this->sub_array (start_offset, record_count); unsigned int count = *record_count; for (unsigned int i = 0; i < count; i++) - record_tags[i] = array[i].tag; + record_tags[i] = arr[i].tag; } return this->len; } @@ -147,10 +150,10 @@ struct IndexArray : ArrayOf unsigned int *_indexes /* OUT */) const { if (_count) { - const USHORT *array = this->sub_array (start_offset, _count); + const USHORT *arr = this->sub_array (start_offset, _count); unsigned int count = *_count; for (unsigned int i = 0; i < count; i++) - _indexes[i] = array[i]; + _indexes[i] = arr[i]; } return this->len; } @@ -290,7 +293,11 @@ struct Lookup inline unsigned int get_subtable_count (void) const { return subTable.len; } inline unsigned int get_type (void) const { return lookupType; } - inline unsigned int get_flag (void) const + + /* lookup_props is a 32-bit integer where the lower 16-bit is LookupFlag and + * higher 16-bit is mark-filtering-set if the lookup uses one. + * Not to be confused with glyph_props which is very similar. */ + inline uint32_t get_props (void) const { unsigned int flag = lookupFlag; if (unlikely (flag & LookupFlag::UseMarkFilteringSet)) @@ -519,13 +526,13 @@ struct ClassDef struct Device { - inline hb_position_t get_x_delta (hb_ot_layout_context_t *c) const - { return get_delta (c->font->x_ppem, c->font->x_scale); } + inline hb_position_t get_x_delta (hb_font_t *font) const + { return get_delta (font->x_ppem, font->x_scale); } - inline hb_position_t get_y_delta (hb_ot_layout_context_t *c) const - { return get_delta (c->font->y_ppem, c->font->y_scale); } + inline hb_position_t get_y_delta (hb_font_t *font) const + { return get_delta (font->y_ppem, font->y_scale); } - inline int get_delta (unsigned int ppem, unsigned int scale) const + inline int get_delta (unsigned int ppem, int scale) const { if (!ppem) return 0; @@ -533,10 +540,6 @@ struct Device if (!pixels) return 0; - /* pixels is at most in the -8..7 range. So 64-bit arithmetic is - * not really necessary here. A simple cast to int may just work - * as well. But since this code is not reached that often and - * for the sake of correctness, we do a 64bit operation. */ return pixels * (int64_t) scale / ppem; }