diff options
author | Dr.Smile <vabnick@gmail.com> | 2017-01-31 02:47:58 +0300 |
---|---|---|
committer | Dr.Smile <vabnick@gmail.com> | 2017-01-31 02:47:58 +0300 |
commit | c7fbe80b29d0e64c36ca0872b8ddc1f766f89f5a (patch) | |
tree | dce8107b943d7b0dc70768f3bd0ec16c7e14e3c3 /libass/ass_render.c | |
parent | 1b44a560d758ef7d74bb601cb812543ba809d304 (diff) | |
download | libass-c7fbe80b29d0e64c36ca0872b8ddc1f766f89f5a.tar.bz2 libass-c7fbe80b29d0e64c36ca0872b8ddc1f766f89f5a.tar.xz |
render: remove redundant has_clips
has_clips was a workaround for the case where a new image reused
the same memory address as another image used in the previous frame.
In case of such reuse, comparison by pointer address failed
to distinguish the different images in ass_detect_change().
After commit dd06ca30ea79ce50116a43cc5521d4eaf60a017e,
images in the previous frame are no longer freed before
the comparison with current frame. Thus no such reuse can occur,
and the workaround is redundant.
See https://github.com/libass/libass/pull/258.
Diffstat (limited to 'libass/ass_render.c')
-rw-r--r-- | libass/ass_render.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c index 101131ea..4e97d2a8 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -406,25 +406,17 @@ render_glyph(ASS_Renderer *render_priv, Bitmap *bm, int dst_x, int dst_y, b_y1 = bm->h; tmp = dst_x - clip_x0; - if (tmp < 0) { + if (tmp < 0) b_x0 = -tmp; - render_priv->state.has_clips = 1; - } tmp = dst_y - clip_y0; - if (tmp < 0) { + if (tmp < 0) b_y0 = -tmp; - render_priv->state.has_clips = 1; - } tmp = clip_x1 - dst_x - bm->w; - if (tmp < 0) { + if (tmp < 0) b_x1 = bm->w + tmp; - render_priv->state.has_clips = 1; - } tmp = clip_y1 - dst_y - bm->h; - if (tmp < 0) { + if (tmp < 0) b_y1 = bm->h + tmp; - render_priv->state.has_clips = 1; - } if ((b_y0 >= b_y1) || (b_x0 >= b_x1)) return tail; @@ -523,8 +515,6 @@ static void blend_vector_clip(ASS_Renderer *render_priv, int aleft, atop, bleft, btop; unsigned char *abuffer, *bbuffer, *nbuffer; - render_priv->state.has_clips = 1; - abuffer = cur->bitmap; bbuffer = clip_bm->buffer; ax = cur->dst_x; @@ -882,7 +872,6 @@ init_render_context(ASS_Renderer *render_priv, ASS_Event *event) { render_priv->state.event = event; render_priv->state.parsed_tags = 0; - render_priv->state.has_clips = 0; render_priv->state.evt_type = EVENT_NORMAL; reset_render_context(render_priv, NULL); @@ -2953,9 +2942,6 @@ static int ass_detect_change(ASS_Renderer *priv) ASS_Image *img, *img2; int diff; - if (priv->state.has_clips) - return 2; - img = priv->prev_images_root; img2 = priv->images_root; diff = 0; |