From 7aa3ab933b86afbd8ae759ba3fdc3aad500d3ee2 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 20 Apr 2025 04:28:28 -0600 Subject: [PATCH] [paint-bounded] Remove one vector Doesn't make things faster though because of the scratch pattern. --- src/hb-paint-bounded.hh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/hb-paint-bounded.hh b/src/hb-paint-bounded.hh index e99a1e64e..5eee5b3af 100644 --- a/src/hb-paint-bounded.hh +++ b/src/hb-paint-bounded.hh @@ -37,10 +37,8 @@ struct hb_paint_bounded_context_t { void clear () { - clips.clear (); + clips = 0; groups.clear (); - - clips.push (false); groups.push (true); } @@ -56,12 +54,12 @@ struct hb_paint_bounded_context_t void push_clip () { - clips.push (true); + clips++; } void pop_clip () { - clips.pop (); + clips--; } void push_group () @@ -99,15 +97,14 @@ struct hb_paint_bounded_context_t void paint () { - const bool &clip = clips.tail (); bool &group = groups.tail (); - if (!clip) + if (clips <= 0) group = false; } protected: - hb_vector_t clips; // true if clipped + int clips; // number of active clips hb_vector_t groups; // true if bounded };