Fixed bug 1750 - Directfb renderer does not support SDL_RENDERER_TARGETTEXTURE
authorSam Lantinga
Sun, 10 Mar 2013 09:09:31 -0700
changeset 6989be9c51af4f94
parent 6988 2aed1beaf5bc
child 6990 2514368c2aaf
Fixed bug 1750 - Directfb renderer does not support SDL_RENDERER_TARGETTEXTURE

tomaszewski.p

DirectFB renderer does not support SDL_RENDERER_TARGETTEXTURE what makes it incompatible with GL or GLES(2) renderers.

Attached patched:
- adds support for SDL_RENDERER_TARGETTEXTURE,
- DirectFB RenderCopy converts destination rectangle from floats to ints,
- fixes whitespaces to be the same in whole file.
src/video/directfb/SDL_DirectFB_render.c
     1.1 --- a/src/video/directfb/SDL_DirectFB_render.c	Sun Mar 10 09:07:23 2013 -0700
     1.2 +++ b/src/video/directfb/SDL_DirectFB_render.c	Sun Mar 10 09:09:31 2013 -0700
     1.3 @@ -35,21 +35,21 @@
     1.4  
     1.5  #ifndef DFB_VERSION_ATLEAST
     1.6  
     1.7 -#define DFB_VERSIONNUM(X, Y, Z)						\
     1.8 -	((X)*1000 + (Y)*100 + (Z))
     1.9 +#define DFB_VERSIONNUM(X, Y, Z)                     \
    1.10 +    ((X)*1000 + (Y)*100 + (Z))
    1.11  
    1.12  #define DFB_COMPILEDVERSION \
    1.13 -	DFB_VERSIONNUM(DIRECTFB_MAJOR_VERSION, DIRECTFB_MINOR_VERSION, DIRECTFB_MICRO_VERSION)
    1.14 +    DFB_VERSIONNUM(DIRECTFB_MAJOR_VERSION, DIRECTFB_MINOR_VERSION, DIRECTFB_MICRO_VERSION)
    1.15  
    1.16  #define DFB_VERSION_ATLEAST(X, Y, Z) \
    1.17 -	(DFB_COMPILEDVERSION >= DFB_VERSIONNUM(X, Y, Z))
    1.18 +    (DFB_COMPILEDVERSION >= DFB_VERSIONNUM(X, Y, Z))
    1.19  
    1.20 -#define SDL_DFB_CHECK(x)	x
    1.21 +#define SDL_DFB_CHECK(x)    x
    1.22  
    1.23  #endif
    1.24  
    1.25  /* the following is not yet tested ... */
    1.26 -#define USE_DISPLAY_PALETTE			(0)
    1.27 +#define USE_DISPLAY_PALETTE         (0)
    1.28  
    1.29  
    1.30  #define SDL_DFB_RENDERERDATA(rend) DirectFB_RenderData *renddata = ((rend) ? (DirectFB_RenderData *) (rend)->driverdata : NULL)
    1.31 @@ -100,9 +100,9 @@
    1.32  static int DirectFB_RenderDrawLines(SDL_Renderer * renderer,
    1.33                                 const SDL_FPoint * points, int count);
    1.34  static int DirectFB_RenderDrawRects(SDL_Renderer * renderer,
    1.35 -		const SDL_Rect ** rects, int count);
    1.36 +        const SDL_Rect ** rects, int count);
    1.37  static int DirectFB_RenderFillRects(SDL_Renderer * renderer,
    1.38 -		const SDL_FRect * rects, int count);
    1.39 +        const SDL_FRect * rects, int count);
    1.40  static int DirectFB_RenderCopy(SDL_Renderer * renderer,
    1.41                                 SDL_Texture * texture,
    1.42                                 const SDL_Rect * srcrect,
    1.43 @@ -116,6 +116,7 @@
    1.44  static int DirectFB_RenderWritePixels(SDL_Renderer * renderer, const SDL_Rect * rect,
    1.45                        Uint32 format, const void * pixels, int pitch);
    1.46  static int DirectFB_UpdateViewport(SDL_Renderer * renderer);
    1.47 +static int DirectFB_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture);
    1.48  
    1.49  static int PrepareDraw(SDL_Renderer * renderer);
    1.50  
    1.51 @@ -135,7 +136,7 @@
    1.52        SDL_SCALEMODE_SLOW | SDL_SCALEMODE_BEST),*/
    1.53       0,
    1.54       {
    1.55 -    		 /* formats filled in later */
    1.56 +             /* formats filled in later */
    1.57       },
    1.58       0,
    1.59       0}
    1.60 @@ -149,6 +150,7 @@
    1.61      int lastBlendMode;
    1.62      DFBSurfaceBlittingFlags blitFlags;
    1.63      DFBSurfaceDrawingFlags drawFlags;
    1.64 +    IDirectFBSurface* target;
    1.65  } DirectFB_RenderData;
    1.66  
    1.67  typedef struct
    1.68 @@ -191,7 +193,7 @@
    1.69      /* Drawing primitive ? */
    1.70      if (!data)
    1.71          return 0;
    1.72 -        
    1.73 +
    1.74      return (DFB_PIXELFORMAT_HAS_ALPHA(DirectFB_SDLToDFBPixelFormat(data->format)) ? 1 : 0);
    1.75  #if 0
    1.76      switch (data->format) {
    1.77 @@ -213,31 +215,31 @@
    1.78  
    1.79  static inline IDirectFBSurface *get_dfb_surface(SDL_Window *window)
    1.80  {
    1.81 -	SDL_SysWMinfo wm_info;
    1.82 +    SDL_SysWMinfo wm_info;
    1.83      SDL_memset(&wm_info, 0, sizeof(SDL_SysWMinfo));
    1.84  
    1.85 -	SDL_VERSION(&wm_info.version);
    1.86 -	SDL_GetWindowWMInfo(window, &wm_info);
    1.87 +    SDL_VERSION(&wm_info.version);
    1.88 +    SDL_GetWindowWMInfo(window, &wm_info);
    1.89  
    1.90 -	return wm_info.info.dfb.surface;
    1.91 +    return wm_info.info.dfb.surface;
    1.92  }
    1.93  
    1.94  static inline IDirectFBWindow *get_dfb_window(SDL_Window *window)
    1.95  {
    1.96 -	SDL_SysWMinfo wm_info;
    1.97 +    SDL_SysWMinfo wm_info;
    1.98      SDL_memset(&wm_info, 0, sizeof(SDL_SysWMinfo));
    1.99  
   1.100 -	SDL_VERSION(&wm_info.version);
   1.101 -	SDL_GetWindowWMInfo(window, &wm_info);
   1.102 +    SDL_VERSION(&wm_info.version);
   1.103 +    SDL_GetWindowWMInfo(window, &wm_info);
   1.104  
   1.105 -	return wm_info.info.dfb.window;
   1.106 +    return wm_info.info.dfb.window;
   1.107  }
   1.108  
   1.109  static void
   1.110  SetBlendMode(DirectFB_RenderData * data, int blendMode,
   1.111               DirectFB_TextureData * source)
   1.112  {
   1.113 -	IDirectFBSurface *destsurf = get_dfb_surface(data->window);
   1.114 +    IDirectFBSurface *destsurf = data->target;
   1.115  
   1.116      //FIXME: check for format change
   1.117      if (1 || data->lastBlendMode != blendMode) {
   1.118 @@ -268,7 +270,7 @@
   1.119              data->drawFlags = DSDRAW_BLEND;
   1.120              // FIXME: SRCALPHA kills performance on radeon ...
   1.121              // It will be cheaper to copy the surface to
   1.122 -            // a temporay surface and premultiply 
   1.123 +            // a temporay surface and premultiply
   1.124              if (source && TextureHasAlpha(source))
   1.125                  SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_SRCALPHA));
   1.126              else
   1.127 @@ -339,7 +341,7 @@
   1.128  DirectFB_RenderClear(SDL_Renderer * renderer)
   1.129  {
   1.130      DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
   1.131 -	IDirectFBSurface *destsurf = get_dfb_surface(data->window);
   1.132 +    IDirectFBSurface *destsurf = data->target;
   1.133  
   1.134      DirectFB_ActivateRenderer(renderer);
   1.135  
   1.136 @@ -354,7 +356,7 @@
   1.137  SDL_Renderer *
   1.138  DirectFB_CreateRenderer(SDL_Window * window, Uint32 flags)
   1.139  {
   1.140 -	IDirectFBSurface *winsurf = get_dfb_surface(window);
   1.141 +    IDirectFBSurface *winsurf = get_dfb_surface(window);
   1.142      SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
   1.143      SDL_Renderer *renderer = NULL;
   1.144      DirectFB_RenderData *data = NULL;
   1.145 @@ -382,14 +384,15 @@
   1.146      /* RenderFillEllipse - no reference implementation yet */
   1.147      renderer->RenderCopy = DirectFB_RenderCopy;
   1.148      renderer->RenderPresent = DirectFB_RenderPresent;
   1.149 -    
   1.150 +
   1.151      /* FIXME: Yet to be tested */
   1.152      renderer->RenderReadPixels = DirectFB_RenderReadPixels;
   1.153      //renderer->RenderWritePixels = DirectFB_RenderWritePixels;
   1.154 -    
   1.155 +
   1.156      renderer->DestroyTexture = DirectFB_DestroyTexture;
   1.157      renderer->DestroyRenderer = DirectFB_DestroyRenderer;
   1.158      renderer->UpdateViewport = DirectFB_UpdateViewport;
   1.159 +    renderer->SetRenderTarget = DirectFB_SetRenderTarget;
   1.160  
   1.161  #if 0
   1.162      renderer->QueryTexturePixels = DirectFB_QueryTexturePixels;
   1.163 @@ -406,9 +409,10 @@
   1.164      renderer->driverdata = data;
   1.165  
   1.166      renderer->info.flags =
   1.167 -        SDL_RENDERER_ACCELERATED;
   1.168 +        SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE;
   1.169  
   1.170      data->window = window;
   1.171 +    data->target = winsurf;
   1.172  
   1.173      data->flipflags = DSFLIP_PIPELINE | DSFLIP_BLIT;
   1.174  
   1.175 @@ -449,14 +453,13 @@
   1.176  static void
   1.177  DirectFB_ActivateRenderer(SDL_Renderer * renderer)
   1.178  {
   1.179 -
   1.180      SDL_DFB_RENDERERDATA(renderer);
   1.181      SDL_Window *window = renderer->window;
   1.182      SDL_DFB_WINDOWDATA(window);
   1.183  
   1.184      if (renddata->size_changed /*|| windata->wm_needs_redraw*/) {
   1.185          //DirectFB_AdjustWindowSurface(window);
   1.186 -    	renddata->size_changed = SDL_FALSE;
   1.187 +        renddata->size_changed = SDL_FALSE;
   1.188      }
   1.189  }
   1.190  
   1.191 @@ -580,13 +583,13 @@
   1.192              SDL_DFB_CHECKERR(data->surface->GetPalette(data->surface, &data->palette));
   1.193  #else
   1.194              /* DFB has issues with blitting LUT8 surfaces.
   1.195 -			 * Creating a new palette does not help.
   1.196 -			 */
   1.197 -        	DFBPaletteDescription pal_desc;
   1.198 -        	pal_desc.flags = DPDESC_SIZE; // | DPDESC_ENTRIES
   1.199 -        	pal_desc.size = 256;
   1.200 -        	SDL_DFB_CHECKERR(devdata->dfb->CreatePalette(devdata->dfb, &pal_desc,&data->palette));
   1.201 -        	SDL_DFB_CHECKERR(data->surface->SetPalette(data->surface, data->palette));
   1.202 +             * Creating a new palette does not help.
   1.203 +             */
   1.204 +            DFBPaletteDescription pal_desc;
   1.205 +            pal_desc.flags = DPDESC_SIZE; // | DPDESC_ENTRIES
   1.206 +            pal_desc.size = 256;
   1.207 +            SDL_DFB_CHECKERR(devdata->dfb->CreatePalette(devdata->dfb, &pal_desc,&data->palette));
   1.208 +            SDL_DFB_CHECKERR(data->surface->SetPalette(data->surface, data->palette));
   1.209  #endif
   1.210          }
   1.211  
   1.212 @@ -642,7 +645,7 @@
   1.213          int i;
   1.214  
   1.215          if (ncolors > 256)
   1.216 -        	ncolors = 256;
   1.217 +            ncolors = 256;
   1.218  
   1.219          for (i = 0; i < ncolors; ++i) {
   1.220              entries[i].r = colors[i].r;
   1.221 @@ -788,7 +791,7 @@
   1.222          (texture->format == SDL_PIXELFORMAT_IYUV)) {
   1.223          bpp = 1;
   1.224      }
   1.225 -    
   1.226 +
   1.227      SDL_DFB_CHECKERR(data->surface->Lock(data->surface,
   1.228                                           DSLF_WRITE | DSLF_READ,
   1.229                                           ((void **) &dpixels), &dpitch));
   1.230 @@ -892,11 +895,28 @@
   1.231  }
   1.232  #endif
   1.233  
   1.234 +static int DirectFB_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
   1.235 +{
   1.236 +    DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
   1.237 +    DirectFB_TextureData *tex_data = NULL;
   1.238 +
   1.239 +    DirectFB_ActivateRenderer(renderer);
   1.240 +    if (texture) {
   1.241 +        tex_data = (DirectFB_TextureData *) texture->driverdata;
   1.242 +        data->target = tex_data->surface;
   1.243 +    } else {
   1.244 +        data->target = get_dfb_surface(data->window);
   1.245 +    }
   1.246 +    data->lastBlendMode = 0;
   1.247 +    return 0;
   1.248 +}
   1.249 +
   1.250 +
   1.251  static int
   1.252  PrepareDraw(SDL_Renderer * renderer)
   1.253  {
   1.254      DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
   1.255 -	IDirectFBSurface *destsurf = get_dfb_surface(data->window);
   1.256 +    IDirectFBSurface *destsurf = data->target;
   1.257  
   1.258      Uint8 r, g, b, a;
   1.259  
   1.260 @@ -932,14 +952,14 @@
   1.261                                  const SDL_FPoint * points, int count)
   1.262  {
   1.263      DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
   1.264 -	IDirectFBSurface *destsurf = get_dfb_surface(data->window);
   1.265 +    IDirectFBSurface *destsurf = data->target;
   1.266      int i;
   1.267  
   1.268      DirectFB_ActivateRenderer(renderer);
   1.269  
   1.270      PrepareDraw(renderer);
   1.271      for (i=0; i < count; i++)
   1.272 -    	SDL_DFB_CHECKERR(destsurf->DrawLine(destsurf, points[i].x, points[i].y, points[i].x, points[i].y));
   1.273 +        SDL_DFB_CHECKERR(destsurf->DrawLine(destsurf, points[i].x, points[i].y, points[i].x, points[i].y));
   1.274      return 0;
   1.275    error:
   1.276      return -1;
   1.277 @@ -949,7 +969,7 @@
   1.278                                 const SDL_FPoint * points, int count)
   1.279  {
   1.280      DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
   1.281 -	IDirectFBSurface *destsurf = get_dfb_surface(data->window);
   1.282 +    IDirectFBSurface *destsurf = data->target;
   1.283      int i;
   1.284  
   1.285      DirectFB_ActivateRenderer(renderer);
   1.286 @@ -961,7 +981,7 @@
   1.287  #endif
   1.288  
   1.289      for (i=0; i < count - 1; i++)
   1.290 -    	SDL_DFB_CHECKERR(destsurf->DrawLine(destsurf, points[i].x, points[i].y, points[i+1].x, points[i+1].y));
   1.291 +        SDL_DFB_CHECKERR(destsurf->DrawLine(destsurf, points[i].x, points[i].y, points[i+1].x, points[i+1].y));
   1.292  
   1.293      return 0;
   1.294    error:
   1.295 @@ -972,7 +992,7 @@
   1.296  DirectFB_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count)
   1.297  {
   1.298      DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
   1.299 -	IDirectFBSurface *destsurf = get_dfb_surface(data->window);
   1.300 +    IDirectFBSurface *destsurf = data->target;
   1.301      int i;
   1.302  
   1.303      DirectFB_ActivateRenderer(renderer);
   1.304 @@ -980,8 +1000,8 @@
   1.305      PrepareDraw(renderer);
   1.306  
   1.307      for (i=0; i<count; i++)
   1.308 -    	SDL_DFB_CHECKERR(destsurf->DrawRectangle(destsurf, rects[i]->x, rects[i]->y,
   1.309 -    			rects[i]->w, rects[i]->h));
   1.310 +        SDL_DFB_CHECKERR(destsurf->DrawRectangle(destsurf, rects[i]->x, rects[i]->y,
   1.311 +                rects[i]->w, rects[i]->h));
   1.312  
   1.313      return 0;
   1.314    error:
   1.315 @@ -992,7 +1012,7 @@
   1.316  DirectFB_RenderFillRects(SDL_Renderer * renderer, const SDL_FRect * rects, int count)
   1.317  {
   1.318      DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
   1.319 -	IDirectFBSurface *destsurf = get_dfb_surface(data->window);
   1.320 +    IDirectFBSurface *destsurf = data->target;
   1.321      int i;
   1.322  
   1.323      DirectFB_ActivateRenderer(renderer);
   1.324 @@ -1000,8 +1020,8 @@
   1.325      PrepareDraw(renderer);
   1.326  
   1.327      for (i=0; i<count; i++)
   1.328 -    	SDL_DFB_CHECKERR(destsurf->FillRectangle(destsurf, rects[i].x, rects[i].y,
   1.329 -    			rects[i].w, rects[i].h));
   1.330 +        SDL_DFB_CHECKERR(destsurf->FillRectangle(destsurf, rects[i].x, rects[i].y,
   1.331 +                rects[i].w, rects[i].h));
   1.332  
   1.333      return 0;
   1.334    error:
   1.335 @@ -1013,7 +1033,7 @@
   1.336                      const SDL_Rect * srcrect, const SDL_FRect * dstrect)
   1.337  {
   1.338      DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
   1.339 -	IDirectFBSurface *destsurf = get_dfb_surface(data->window);
   1.340 +    IDirectFBSurface *destsurf = data->target;
   1.341      DirectFB_TextureData *texturedata =
   1.342          (DirectFB_TextureData *) texture->driverdata;
   1.343      Uint8 alpha, r, g, b;
   1.344 @@ -1027,7 +1047,7 @@
   1.345      if (texturedata->display) {
   1.346          int px, py;
   1.347          SDL_Window *window = renderer->window;
   1.348 -    	IDirectFBWindow *dfbwin = get_dfb_window(window);
   1.349 +        IDirectFBWindow *dfbwin = get_dfb_window(window);
   1.350          SDL_DFB_WINDOWDATA(window);
   1.351          SDL_VideoDisplay *display = texturedata->display;
   1.352          DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
   1.353 @@ -1079,13 +1099,13 @@
   1.354          }
   1.355  
   1.356          SDLtoDFBRect(srcrect, &sr);
   1.357 -        SDLtoDFBRect(dstrect, &dr);
   1.358 +        SDLtoDFBRect_Float(dstrect, &dr);
   1.359  
   1.360          alpha = r = g = b = 0xff;
   1.361 -		if (texture->modMode & SDL_TEXTUREMODULATE_ALPHA){
   1.362 -			alpha = texture->a;
   1.363 -        	flags |= DSBLIT_BLEND_COLORALPHA;
   1.364 -		}
   1.365 +        if (texture->modMode & SDL_TEXTUREMODULATE_ALPHA){
   1.366 +            alpha = texture->a;
   1.367 +            flags |= DSBLIT_BLEND_COLORALPHA;
   1.368 +        }
   1.369  
   1.370          if (texture->modMode & SDL_TEXTUREMODULATE_COLOR) {
   1.371              r = texture->r;
   1.372 @@ -1189,7 +1209,6 @@
   1.373  {
   1.374      DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
   1.375      SDL_VideoDisplay *display = SDL_GetDisplayForWindow(data->window);
   1.376 -
   1.377  #if 0
   1.378      if (display->palette) {
   1.379          SDL_DelPaletteWatch(display->palette, DisplayPaletteChanged, data);
   1.380 @@ -1205,15 +1224,16 @@
   1.381  static int
   1.382  DirectFB_UpdateViewport(SDL_Renderer * renderer)
   1.383  {
   1.384 -  	IDirectFBSurface *winsurf = get_dfb_surface(renderer->window);
   1.385 -  	DFBRegion dreg;
   1.386 +    DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
   1.387 +    IDirectFBSurface *winsurf = data->target;
   1.388 +    DFBRegion dreg;
   1.389  
   1.390 -  	dreg.x1 = renderer->viewport.x;
   1.391 -  	dreg.y1 = renderer->viewport.y;
   1.392 -  	dreg.x2 = dreg.x1 + renderer->viewport.w - 1;
   1.393 -  	dreg.y2 = dreg.y1 + renderer->viewport.h - 1;
   1.394 +    dreg.x1 = renderer->viewport.x;
   1.395 +    dreg.y1 = renderer->viewport.y;
   1.396 +    dreg.x2 = dreg.x1 + renderer->viewport.w - 1;
   1.397 +    dreg.y2 = dreg.y1 + renderer->viewport.h - 1;
   1.398  
   1.399 -  	winsurf->SetClip(winsurf, &dreg);
   1.400 +    winsurf->SetClip(winsurf, &dreg);
   1.401      return 0;
   1.402  }
   1.403  
   1.404 @@ -1222,24 +1242,25 @@
   1.405                       Uint32 format, void * pixels, int pitch)
   1.406  {
   1.407      Uint32 sdl_format;
   1.408 -   	void * laypixels;
   1.409 -   	int laypitch;
   1.410 -  	DFBSurfacePixelFormat dfb_format;
   1.411 -  	IDirectFBSurface *winsurf = get_dfb_surface(renderer->window);
   1.412 +    void * laypixels;
   1.413 +    int laypitch;
   1.414 +    DFBSurfacePixelFormat dfb_format;
   1.415 +    DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
   1.416 +    IDirectFBSurface *winsurf = data->target;
   1.417  
   1.418      DirectFB_ActivateRenderer(renderer);
   1.419  
   1.420      winsurf->GetPixelFormat(winsurf, &dfb_format);
   1.421      sdl_format = DirectFB_DFBToSDLPixelFormat(dfb_format);
   1.422      winsurf->Lock(winsurf, DSLF_READ, (void **) &laypixels, &laypitch);
   1.423 -    
   1.424 +
   1.425      laypixels += (rect->y * laypitch + rect->x * SDL_BYTESPERPIXEL(sdl_format) );
   1.426      SDL_ConvertPixels(rect->w, rect->h,
   1.427                        sdl_format, laypixels, laypitch,
   1.428                        format, pixels, pitch);
   1.429  
   1.430      winsurf->Unlock(winsurf);
   1.431 -    
   1.432 +
   1.433      return 0;
   1.434  }
   1.435  
   1.436 @@ -1251,15 +1272,15 @@
   1.437      SDL_Window *window = renderer->window;
   1.438      SDL_DFB_WINDOWDATA(window);
   1.439      Uint32 sdl_format;
   1.440 -   	void * laypixels;
   1.441 -   	int laypitch;
   1.442 -  	DFBSurfacePixelFormat dfb_format;
   1.443 +    void * laypixels;
   1.444 +    int laypitch;
   1.445 +    DFBSurfacePixelFormat dfb_format;
   1.446  
   1.447      SDL_DFB_CHECK(windata->surface->GetPixelFormat(windata->surface, &dfb_format));
   1.448      sdl_format = DirectFB_DFBToSDLPixelFormat(dfb_format);
   1.449  
   1.450      SDL_DFB_CHECK(windata->surface->Lock(windata->surface, DSLF_WRITE, (void **) &laypixels, &laypitch));
   1.451 -      
   1.452 +
   1.453      laypixels += (rect->y * laypitch + rect->x * SDL_BYTESPERPIXEL(sdl_format) );
   1.454      SDL_ConvertPixels(rect->w, rect->h,
   1.455                        format, pixels, pitch,