summaryrefslogtreecommitdiffstats
path: root/libass/ass_render.h
diff options
context:
space:
mode:
authorDr.Smile <vabnick@gmail.com>2019-05-19 20:24:29 +0300
committerDr.Smile <vabnick@gmail.com>2019-05-19 20:24:29 +0300
commite072b72b1a12837b6894d052a08ed3aed57f2f16 (patch)
tree492ddc7dbf70b70f298bcb3298b53ebad03841b6 /libass/ass_render.h
parent5d03af99c6d8f43be973cb6dacb5d6dd0ada33b1 (diff)
downloadlibass-e072b72b1a12837b6894d052a08ed3aed57f2f16.tar.bz2
libass-e072b72b1a12837b6894d052a08ed3aed57f2f16.tar.xz
cache: construct cache values only from corresponding keys
This commit forces construction of cache values using only data available in its companion keys. That ensures logical correctness: keys are guaranteed to have all the necessary data, and prevents accidental collisions. Most fixes of cache logic correspond to minor problem when rendering is done with double parameter but cache key stores its approximate fixed-point representation. The only serious problem is missing scale of clip drawing. Also this commit removes unused scale parameters from glyph metrics cache key. Due to missing scale clip shapes that differed only in scale treated by cache system as identical. That can lead to incorrect reuse of cached bitmap of different scale instead of correct one. The only hack left is in glyph metrics cache with its unicode >= VERTICAL_LOWER_BOUND check.
Diffstat (limited to 'libass/ass_render.h')
-rw-r--r--libass/ass_render.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/libass/ass_render.h b/libass/ass_render.h
index f2af0b7..539d619 100644
--- a/libass/ass_render.h
+++ b/libass/ass_render.h
@@ -109,9 +109,6 @@ typedef struct {
BitmapRef *bitmaps;
int x, y;
- ASS_Rect rect, rect_o;
- size_t n_bm, n_bm_o;
-
Bitmap *bm, *bm_o, *bm_s; // glyphs, outline, shadow bitmaps
CompositeHashValue *image;
} CombinedBitmapInfo;
@@ -156,10 +153,13 @@ typedef struct glyph_info {
double frx, fry, frz; // rotation
double fax, fay; // text shearing
double scale_x, scale_y;
- double orig_scale_x, orig_scale_y; // scale_x,y before fix_glyph_scaling
+ // amount of scale_x,y change due to fix_glyph_scaling
+ // scale_fix = before / after
+ double scale_fix;
int border_style;
double border_x, border_y;
double hspacing;
+ int hspacing_scaled; // 26.6
unsigned italic;
unsigned bold;
int flags;