src/hb-ot-layout-common-private.hh |    8 +++++++-
 src/hb-ot-layout-gdef-private.hh   |    3 +--
 src/hb-ot-layout-gpos-private.hh   |   12 ++++++------
 src/hb-ot-layout-private.hh        |    2 +-
 4 files changed, 15 insertions(+), 10 deletions(-)

New commits:
commit b634beb39e0a4fef7167a8af646f6b2d8cafe69b
Author: Behdad Esfahbod <beh...@behdad.org>
Date:   Thu May 20 17:44:52 2010 +0100

    Fix delta scale, again...

diff --git a/src/hb-ot-layout-common-private.hh 
b/src/hb-ot-layout-common-private.hh
index e054b59..f965491 100644
--- a/src/hb-ot-layout-common-private.hh
+++ b/src/hb-ot-layout-common-private.hh
@@ -566,6 +566,14 @@ struct ClassDef
 
 struct Device
 {
+  /* XXX speed up */
+
+  inline hb_position_t get_x_delta (hb_ot_layout_context_t *c) const
+  { return c->font->x_ppem ? get_delta (c->font->x_ppem) * (uint64_t) 
c->font->x_scale / c->font->x_ppem : 0; }
+
+  inline hb_position_t get_y_delta (hb_ot_layout_context_t *c) const
+  { return c->font->y_ppem ? get_delta (c->font->y_ppem) * (uint64_t) 
c->font->y_scale / c->font->y_ppem : 0; }
+
   inline int get_delta (unsigned int ppem_size) const
   {
     unsigned int f = deltaFormat;
diff --git a/src/hb-ot-layout-gdef-private.hh b/src/hb-ot-layout-gdef-private.hh
index 4989363..1adff6e 100644
--- a/src/hb-ot-layout-gdef-private.hh
+++ b/src/hb-ot-layout-gdef-private.hh
@@ -144,8 +144,7 @@ struct CaretValueFormat3
   inline int get_caret_value (hb_ot_layout_context_t *c, hb_codepoint_t 
glyph_id HB_UNUSED) const
   {
     /* TODO vertical */
-    return c->scale_x (coordinate) +
-          ((this+deviceTable).get_delta (c->font->x_ppem) * c->font->x_scale);
+    return c->scale_x (coordinate) + ((this+deviceTable).get_x_delta (c));
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) {
diff --git a/src/hb-ot-layout-gpos-private.hh b/src/hb-ot-layout-gpos-private.hh
index 10e9df5..77cbbeb 100644
--- a/src/hb-ot-layout-gpos-private.hh
+++ b/src/hb-ot-layout-gpos-private.hh
@@ -112,16 +112,16 @@ struct ValueFormat : USHORT
 
     /* pixel -> fractional pixel */
     if (format & xPlaDevice) {
-      if (x_ppem) glyph_pos.x_offset  += (base + get_device 
(values++)).get_delta (x_ppem) * layout->font->x_scale; else values++;
+      if (x_ppem) glyph_pos.x_offset  += (base + get_device 
(values++)).get_x_delta (layout); else values++;
     }
     if (format & yPlaDevice) {
-      if (y_ppem) glyph_pos.y_offset  += (base + get_device 
(values++)).get_delta (y_ppem) * layout->font->y_scale; else values++;
+      if (y_ppem) glyph_pos.y_offset  += (base + get_device 
(values++)).get_y_delta (layout); else values++;
     }
     if (format & xAdvDevice) {
-      if (x_ppem) glyph_pos.x_advance += (base + get_device 
(values++)).get_delta (x_ppem) * layout->font->x_scale; else values++;
+      if (x_ppem) glyph_pos.x_advance += (base + get_device 
(values++)).get_x_delta (layout); else values++;
     }
     if (format & yAdvDevice) {
-      if (y_ppem) glyph_pos.y_advance += (base + get_device 
(values++)).get_delta (y_ppem) * layout->font->y_scale; else values++;
+      if (y_ppem) glyph_pos.y_advance += (base + get_device 
(values++)).get_y_delta (layout); else values++;
     }
   }
 
@@ -268,9 +268,9 @@ struct AnchorFormat3
 
       /* pixel -> fractional pixel */
       if (layout->font->x_ppem)
-       *x += (this+xDeviceTable).get_delta (layout->font->x_ppem) * 
layout->font->x_scale;
+       *x += (this+xDeviceTable).get_x_delta (layout);
       if (layout->font->y_ppem)
-       *y += (this+yDeviceTable).get_delta (layout->font->y_ppem) * 
layout->font->y_scale;
+       *y += (this+yDeviceTable).get_x_delta (layout);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) {
diff --git a/src/hb-ot-layout-private.hh b/src/hb-ot-layout-private.hh
index 723db44..71d7253 100644
--- a/src/hb-ot-layout-private.hh
+++ b/src/hb-ot-layout-private.hh
@@ -76,7 +76,7 @@ struct hb_ot_layout_context_t
   } info;
 
   /* Convert from font-space to user-space */
-  /* XXX div-by-zero */
+  /* XXX div-by-zero / speed up */
   inline hb_position_t scale_x (int16_t v) { return (int64_t) 
this->font->x_scale * v / this->face->head_table->unitsPerEm; }
   inline hb_position_t scale_y (int16_t v) { return (int64_t) 
this->font->y_scale * v / this->face->head_table->unitsPerEm; }
 };
commit 40335d4533ac2b08121c9dc6003f3ebc5b44a67b
Author: Behdad Esfahbod <beh...@behdad.org>
Date:   Thu May 20 17:35:14 2010 +0100

    Remove unused operator

diff --git a/src/hb-ot-layout-common-private.hh 
b/src/hb-ot-layout-common-private.hh
index 4ab4ee5..e054b59 100644
--- a/src/hb-ot-layout-common-private.hh
+++ b/src/hb-ot-layout-common-private.hh
@@ -566,8 +566,6 @@ struct ClassDef
 
 struct Device
 {
-  inline int operator () (unsigned int ppem_size) const { return get_delta 
(ppem_size); }
-
   inline int get_delta (unsigned int ppem_size) const
   {
     unsigned int f = deltaFormat;
_______________________________________________
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/harfbuzz

Reply via email to