# HG changeset patch # User Couriersud # Date 1263246549 0 # Node ID 58c1b9ec7074dc12bbfc56de6ac929493551da32 # Parent 6f4c5b0aba7cd3056bf41bf6851732328ce1ea22 DirectFB driver compiles again - moved to new drawing api diff -r 6f4c5b0aba7c -r 58c1b9ec7074 src/video/directfb/SDL_DirectFB_modes.c --- a/src/video/directfb/SDL_DirectFB_modes.c Mon Jan 11 21:46:59 2010 +0000 +++ b/src/video/directfb/SDL_DirectFB_modes.c Mon Jan 11 21:49:09 2010 +0000 @@ -387,6 +387,7 @@ } SDL_DFB_FREE(data.modelist); +error: return; } diff -r 6f4c5b0aba7c -r 58c1b9ec7074 src/video/directfb/SDL_DirectFB_render.c --- a/src/video/directfb/SDL_DirectFB_render.c Mon Jan 11 21:46:59 2010 +0000 +++ b/src/video/directfb/SDL_DirectFB_render.c Mon Jan 11 21:49:09 2010 +0000 @@ -72,11 +72,14 @@ static void DirectFB_DirtyTexture(SDL_Renderer * renderer, SDL_Texture * texture, int numrects, const SDL_Rect * rects); -static int DirectFB_RenderPoint(SDL_Renderer * renderer, int x, int y); -static int DirectFB_RenderLine(SDL_Renderer * renderer, int x1, int y1, - int x2, int y2); -static int DirectFB_RenderFill(SDL_Renderer * renderer, - const SDL_Rect * rect); +static int DirectFB_RenderDrawPoints(SDL_Renderer * renderer, + const SDL_Point * points, int count); +static int DirectFB_RenderDrawLines(SDL_Renderer * renderer, + const SDL_Point * points, int count); +static int DirectFB_RenderDrawRects(SDL_Renderer * renderer, + const SDL_Rect ** rects, int count); +static int DirectFB_RenderFillRects(SDL_Renderer * renderer, + const SDL_Rect ** rects, int count); static int DirectFB_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * srcrect, @@ -301,9 +304,10 @@ renderer->LockTexture = DirectFB_LockTexture; renderer->UnlockTexture = DirectFB_UnlockTexture; renderer->DirtyTexture = DirectFB_DirtyTexture; - renderer->RenderPoint = DirectFB_RenderPoint; - renderer->RenderLine = DirectFB_RenderLine; - renderer->RenderFill = DirectFB_RenderFill; + renderer->RenderDrawPoints = DirectFB_RenderDrawPoints; + renderer->RenderDrawLines = DirectFB_RenderDrawLines; + renderer->RenderFillRects = DirectFB_RenderFillRects; + renderer->RenderDrawRects = DirectFB_RenderDrawRects; renderer->RenderCopy = DirectFB_RenderCopy; renderer->RenderPresent = DirectFB_RenderPresent; renderer->DestroyTexture = DirectFB_DestroyTexture; @@ -857,48 +861,76 @@ return -1; } -static int -DirectFB_RenderPoint(SDL_Renderer * renderer, int x, int y) +static int DirectFB_RenderDrawPoints(SDL_Renderer * renderer, + const SDL_Point * points, int count) { DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata; SDL_DFB_WINDOWSURFACE(data->window); DFBResult ret; + int i; PrepareDraw(renderer); - SDL_DFB_CHECKERR(destsurf->DrawLine(destsurf, x, y, x, y)); + for (i=0; i < count; i++) + SDL_DFB_CHECKERR(destsurf->DrawLine(destsurf, points[i].x, points[i].y, points[i].x, points[i].y)); + return 0; + error: + return -1; +} + +static int DirectFB_RenderDrawLines(SDL_Renderer * renderer, + const SDL_Point * points, int count) +{ + DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata; + SDL_DFB_WINDOWSURFACE(data->window); + DFBResult ret; + int i; + + PrepareDraw(renderer); + /* Use antialiasing when available */ +#if (DFB_VERSION_ATLEAST(1,2,0)) + SDL_DFB_CHECKERR(destsurf->SetRenderOptions(destsurf, DSRO_ANTIALIAS)); +#endif + + for (i=0; i < count - 1; i++) + SDL_DFB_CHECKERR(destsurf->DrawLine(destsurf, points[i].x, points[i].y, points[i+1].x, points[i+1].y)); + return 0; error: return -1; } static int -DirectFB_RenderLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2) +DirectFB_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) { DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata; SDL_DFB_WINDOWSURFACE(data->window); DFBResult ret; + int i; PrepareDraw(renderer); - /* Use antialiasing when available */ -#if (DFB_VERSION_ATLEAST(1,2,0)) - SDL_DFB_CHECKERR(destsurf->SetRenderOptions(destsurf, DSRO_ANTIALIAS)); -#endif - SDL_DFB_CHECKERR(destsurf->DrawLine(destsurf, x1, y1, x2, y2)); + + for (i=0; iDrawRectangle(destsurf, rects[i]->x, rects[i]->y, + rects[i]->w, rects[i]->h)); + return 0; error: return -1; } static int -DirectFB_RenderFill(SDL_Renderer * renderer, const SDL_Rect * rect) +DirectFB_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) { DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata; SDL_DFB_WINDOWSURFACE(data->window); DFBResult ret; + int i; PrepareDraw(renderer); - SDL_DFB_CHECKERR(destsurf->FillRectangle(destsurf, rect->x, rect->y, - rect->w, rect->h)); + + for (i=0; iFillRectangle(destsurf, rects[i]->x, rects[i]->y, + rects[i]->w, rects[i]->h)); return 0; error: