From 4c05246c20f41d1e19ade1e21325c5c3815d8cf8 Mon Sep 17 00:00:00 2001 From: Claudio Ciccani Date: Thu, 22 Jun 2006 11:55:23 +0000 Subject: * directfb_subpicture_paint(): flush rectangles before changing the color. CVS patchset: 8070 CVS date: 2006/06/22 11:55:23 --- src/video_out/video_out_directfb.c | 43 +++++++++++++++++--------------------- 1 file 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; -- cgit v1.2.3