summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/video_out/video_out_directfb.c43
1 files changed, 19 insertions, 24 deletions
diff --git a/src/video_out/video_out_directfb.c b/src/video_out/video_out_directfb.c
index d7aa76d2c..e58f71f7d 100644
--- a/src/video_out/video_out_directfb.c
+++ b/src/video_out/video_out_directfb.c
@@ -442,23 +442,12 @@ static void directfb_subpicture_paint (directfb_driver_t *this,
}
if (alpha) {
- int flush;
-
- rects[n_rects].x = x + xoffset;
- rects[n_rects].y = y + yoffset;
- rects[n_rects].w = width;
- rects[n_rects].h = 1;
- if (n_rects) {
- if (rects[n_rects-1].x == rects[n_rects].x &&
- rects[n_rects-1].w == rects[n_rects].w &&
- rects[n_rects-1].y+rects[n_rects-1].h == rects[n_rects].y) {
- n_rects--;
- rects[n_rects].h++;
- }
- }
- n_rects++;
- flush = (n_rects == MAX_RECTS);
-
+ if (n_rects == MAX_RECTS || (p_index != -1 && p_index != index)) {
+ lprintf ("flushing %d rect(s).\n", n_rects);
+ this->spic_surface->FillRectangles (this->spic_surface, rects, n_rects);
+ n_rects = 0;
+ }
+
if (p_index != index) {
if (!colors[index].a) {
YCBCR_TO_RGB (color.y, color.cb, color.cr,
@@ -472,16 +461,22 @@ static void directfb_subpicture_paint (directfb_driver_t *this,
this->spic_surface->SetColor (this->spic_surface,
colors[index].r, colors[index].g,
colors[index].b, colors[index].a);
- if (p_index != -1)
- flush = 1;
p_index = index;
}
- if (flush) {
- lprintf ("flushing %d rect(s).\n", n_rects);
- this->spic_surface->FillRectangles (this->spic_surface, rects, n_rects);
- n_rects = 0;
- }
+ rects[n_rects].x = x + xoffset;
+ rects[n_rects].y = y + yoffset;
+ rects[n_rects].w = width;
+ rects[n_rects].h = 1;
+ if (n_rects) {
+ if (rects[n_rects-1].x == rects[n_rects].x &&
+ rects[n_rects-1].w == rects[n_rects].w &&
+ rects[n_rects-1].y+rects[n_rects-1].h == rects[n_rects].y) {
+ n_rects--;
+ rects[n_rects].h++;
+ }
+ }
+ n_rects++;
}
x += width;