Rachel Bassett wrote:
> By the way the change I made to cairo 1.4.12, was in
> cairo-directfb-surface.c in function
> _cairo_directfb_surface_clone_similar() where code
> says .....
>         if (image_src->format == CAIRO_FORMAT_A1) {
>             /* A1 -> A8 */
>             for (i = 0; i < height; i++) {
>                 for (j = src_x; j < src_x + width;
> j++)
>                     dst[j] = (src[j>>3] & (1 <<
> (j&7))) ? 0xff : 0x00;
>                 dst += pitch;
>                 src += image_src->stride;
>             }
>         }
>         else {
>           /* A8 -> A8 */
>             for (i = 0; i < height; i++) {
>                 direct_memcpy( dst+src_x, src+src_x,
> sizeof(*dst)*width );
>                 dst += pitch;
>                 src += image_src->stride;
>             }
>         }
> 
> where I changed the line direct_memcpy( dst+src_x,
> src+src_x, sizeof(*dst)*width ); to direct_memcpy(
> dst+src_x, src+src_x, (sizeof(*dst)*width)*4 ); as
> *dst is an unsigned char and therefore a size of 1 x
> by width (in pixels).

Seems to be fixed, even in official git tree :)


  655         if (image_src->format == CAIRO_FORMAT_A1) {
  656             /* A1 -> A8 */
  657             for (i = 0; i < height; i++) {
  658                 for (j = src_x; j < src_x + width; j++)
  659                     dst[j] = (src[j>>3] & (1 << (j&7))) ? 0xff : 0x00;
  660                 dst += pitch;
  661                 src += image_src->stride;
  662             }
  663         }
  664         else {
  665             int len;
  666
  667             if (image_src->format == CAIRO_FORMAT_A8) {
  668                 dst += src_x;
  669                 src += src_x;
  670                 len  = width;
  671             } else {
  672                 dst += src_x * 4;
  673                 src += src_x * 4;
  674                 len  = width * 4;
  675             }
  676
  677             for (i = 0; i < height; i++) {
  678                 direct_memcpy (dst+src_x, src+src_x, len);
  679                 dst += pitch;
  680                 src += image_src->stride;
  681             }
  682         }

-- 
Best regards,
   Denis Oliver Kropp

.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/                 |
'------------------------------------------'

_______________________________________________
directfb-users mailing list
directfb-users@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to