From 0db2bfa543b90cbabac621a4d2f3362b9d746c11 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Sun, 23 Aug 2009 03:49:22 +0200 Subject: Fix glyph overlap blending Use the bitmap pointer for the cache hash key. This preserves the blending history, which fixes occasional corruptions due to previous replacements not being dealt with correctly. It also simplifies the hash key a lot and thus speeds up cache lookups. Additionally, change the blending equation from max(a, b) to min(a + b, 0xff), i.e. a saturating addition. Usually this looks a lot better. --- libass/ass_cache_template.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libass/ass_cache_template.h') diff --git a/libass/ass_cache_template.h b/libass/ass_cache_template.h index 8d182ade..f335c6b2 100644 --- a/libass/ass_cache_template.h +++ b/libass/ass_cache_template.h @@ -108,8 +108,10 @@ START(composite, composite_hash_key) GENERIC(int, ay) GENERIC(int, bx) GENERIC(int, by) - BITMAPHASHKEY(a) - BITMAPHASHKEY(b) + GENERIC(int, as) + GENERIC(int, bs) + GENERIC(unsigned char *, a) + GENERIC(unsigned char *, b) END(CompositeHashKey) -- cgit v1.2.3