summaryrefslogtreecommitdiffstats
path: root/libass/ass_render.c
diff options
context:
space:
mode:
authorDr.Smile <vabnick@gmail.com>2017-09-17 03:39:11 +0300
committerDr.Smile <vabnick@gmail.com>2017-09-17 04:07:20 +0300
commitad6510b9c78f5c79f7492b608912dc5281e15e47 (patch)
tree245c655bd8f0b4c4a2884d941509c965dc8778bd /libass/ass_render.c
parent71cf4e3b6328cdac390cdc84fa9c289224e2179d (diff)
downloadlibass-ad6510b9c78f5c79f7492b608912dc5281e15e47.tar.bz2
libass-ad6510b9c78f5c79f7492b608912dc5281e15e47.tar.xz
Consolidate bounding box operations
Diffstat (limited to 'libass/ass_render.c')
-rw-r--r--libass/ass_render.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index d60c93a..be76f76 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -2034,18 +2034,11 @@ static void calculate_rotation_params(ASS_Renderer *render_priv, ASS_DRect *bbox
}
-static inline void rectangle_reset(ASS_Rect *rect)
-{
- rect->x_min = rect->y_min = INT32_MAX;
- rect->x_max = rect->y_max = INT32_MIN;
-}
-
static inline void rectangle_combine(ASS_Rect *rect, const Bitmap *bm, int x, int y)
{
- rect->x_min = FFMIN(rect->x_min, x + bm->left);
- rect->y_min = FFMIN(rect->y_min, y + bm->top);
- rect->x_max = FFMAX(rect->x_max, x + bm->left + bm->w);
- rect->y_max = FFMAX(rect->y_max, y + bm->top + bm->h);
+ x += bm->left;
+ y += bm->top;
+ rectangle_update(rect, x, y, x + bm->w, y + bm->h);
}
// Convert glyphs to bitmaps, combine them, apply blur, generate shadows.