summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2017-10-11 12:23:35 +0200
committerBehdad Esfahbod <behdad@behdad.org>2017-10-11 12:23:35 +0200
commitc0c2dbc871667c32ac8eedb11de64078ef24a429 (patch)
tree23c797fe776a4edeb02dddee681c649a16f15fbd
parentb57f18da700837a57df9606290160ea6e96accc8 (diff)
Remove dirty tracking
Turns out I don't need this to resolve CoreText optical sizing issue after all. https://github.com/behdad/harfbuzz/issues/360
-rw-r--r--src/hb-face-private.hh9
-rw-r--r--src/hb-face.cc17
-rw-r--r--src/hb-font-private.hh13
-rw-r--r--src/hb-font.cc39
4 files changed, 0 insertions, 78 deletions
diff --git a/src/hb-face-private.hh b/src/hb-face-private.hh
index 72f08a59..43e7b1cb 100644
--- a/src/hb-face-private.hh
+++ b/src/hb-face-private.hh
@@ -54,13 +54,6 @@ struct hb_face_t {
mutable unsigned int upem; /* Units-per-EM. */
mutable unsigned int num_glyphs; /* Number of glyphs. */
- enum dirty_t {
- DIRTY_NOTHING = 0x0000,
- DIRTY_INDEX = 0x0001,
- DIRTY_UPEM = 0x0002,
- DIRTY_NUM_GLYPHS = 0x0004,
- } dirty;
-
struct hb_shaper_data_t shaper_data; /* Various shaper data. */
/* Various non-shaping data. */
@@ -106,8 +99,6 @@ struct hb_face_t {
HB_INTERNAL void load_num_glyphs (void) const;
};
-HB_MARK_AS_FLAG_T (hb_face_t::dirty_t);
-
extern HB_INTERNAL const hb_face_t _hb_face_nil;
#define HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS
diff --git a/src/hb-face.cc b/src/hb-face.cc
index 22998f00..d7d736d7 100644
--- a/src/hb-face.cc
+++ b/src/hb-face.cc
@@ -51,8 +51,6 @@ const hb_face_t _hb_face_nil = {
1000, /* upem */
0, /* num_glyphs */
- hb_face_t::DIRTY_NOTHING, /* dirty */
-
{
#define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_INVALID,
#include "hb-shaper-list.hh"
@@ -367,11 +365,6 @@ hb_face_set_index (hb_face_t *face,
if (face->immutable)
return;
- if (face->index == index)
- return;
-
- face->dirty |= face->DIRTY_INDEX;
-
face->index = index;
}
@@ -407,11 +400,6 @@ hb_face_set_upem (hb_face_t *face,
if (face->immutable)
return;
- if (face->upem == upem)
- return;
-
- face->dirty |= face->DIRTY_UPEM;
-
face->upem = upem;
}
@@ -456,11 +444,6 @@ hb_face_set_glyph_count (hb_face_t *face,
if (face->immutable)
return;
- if (face->num_glyphs == glyph_count)
- return;
-
- face->dirty |= face->DIRTY_NUM_GLYPHS;
-
face->num_glyphs = glyph_count;
}
diff --git a/src/hb-font-private.hh b/src/hb-font-private.hh
index 30661c32..d2801fb8 100644
--- a/src/hb-font-private.hh
+++ b/src/hb-font-private.hh
@@ -118,17 +118,6 @@ struct hb_font_t {
void *user_data;
hb_destroy_func_t destroy;
- enum dirty_t {
- DIRTY_NOTHING = 0x0000,
- DIRTY_FACE = 0x0001,
- DIRTY_PARENT = 0x0002,
- DIRTY_FUNCS = 0x0004,
- DIRTY_SCALE = 0x0008,
- DIRTY_PPEM = 0x0010,
- DIRTY_PTEM = 0x0020,
- DIRTY_VARIATIONS = 0x0040,
- } dirty;
-
struct hb_shaper_data_t shaper_data;
@@ -556,8 +545,6 @@ struct hb_font_t {
}
};
-HB_MARK_AS_FLAG_T (hb_font_t::dirty_t);
-
#define HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS
#define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_PROTOTYPE(shaper, font);
#include "hb-shaper-list.hh"
diff --git a/src/hb-font.cc b/src/hb-font.cc
index c47e2c14..88842079 100644
--- a/src/hb-font.cc
+++ b/src/hb-font.cc
@@ -1209,8 +1209,6 @@ hb_font_get_empty (void)
NULL, /* user_data */
NULL, /* destroy */
- hb_font_t::DIRTY_NOTHING, /* dirty */
-
{
#define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_INVALID,
#include "hb-shaper-list.hh"
@@ -1363,11 +1361,6 @@ hb_font_set_parent (hb_font_t *font,
if (!parent)
parent = hb_font_get_empty ();
- if (parent == font->parent)
- return;
-
- font->dirty |= font->DIRTY_PARENT;
-
hb_font_t *old = font->parent;
font->parent = hb_font_reference (parent);
@@ -1410,11 +1403,6 @@ hb_font_set_face (hb_font_t *font,
if (unlikely (!face))
face = hb_face_get_empty ();
- if (font->face == face)
- return;
-
- font->dirty |= font->DIRTY_FACE;
-
hb_face_t *old = font->face;
font->face = hb_face_reference (face);
@@ -1468,8 +1456,6 @@ hb_font_set_funcs (hb_font_t *font,
if (!klass)
klass = hb_font_funcs_get_empty ();
- font->dirty |= font->DIRTY_FUNCS;
-
hb_font_funcs_reference (klass);
hb_font_funcs_destroy (font->klass);
font->klass = klass;
@@ -1525,11 +1511,6 @@ hb_font_set_scale (hb_font_t *font,
if (font->immutable)
return;
- if (font->x_scale == x_scale && font->y_scale == y_scale)
- return;
-
- font->dirty |= font->DIRTY_SCALE;
-
font->x_scale = x_scale;
font->y_scale = y_scale;
}
@@ -1571,11 +1552,6 @@ hb_font_set_ppem (hb_font_t *font,
if (font->immutable)
return;
- if (font->x_ppem == x_ppem && font->y_ppem == y_ppem)
- return;
-
- font->dirty |= font->DIRTY_PPEM;
-
font->x_ppem = x_ppem;
font->y_ppem = y_ppem;
}
@@ -1614,11 +1590,6 @@ hb_font_set_ptem (hb_font_t *font, float ptem)
if (font->immutable)
return;
- if (font->ptem == ptem)
- return;
-
- font->dirty |= font->DIRTY_PTEM;
-
font->ptem = ptem;
}
@@ -1647,16 +1618,6 @@ _hb_font_adopt_var_coords_normalized (hb_font_t *font,
int *coords, /* 2.14 normalized */
unsigned int coords_length)
{
- if (font->num_coords == coords_length &&
- (coords_length == 0 ||
- 0 == memcmp (font->coords, coords, coords_length * sizeof (coords[0]))))
- {
- free (coords);
- return;
- }
-
- font->dirty |= font->DIRTY_VARIATIONS;
-
free (font->coords);
font->coords = coords;