func:  DrawTargetCairo::CreateSourceSurfaceFromData(unsigned char const IntSize int32_t SurfaceFormat aFormat) const cairo_surface_t * surf = CopyToImageSurface ( aData , IntRect ( IntPoint ( ) , aSize ) , aStride , aFormat ) ;  CopyToImageSurface(unsigned char const IntRect int32_t SurfaceFormat aFormat) cairo_surface_t * surf = cairo_image_surface_create ( GfxFormatToCairoFormat ( aFormat ) , aRect . width , aRect . height ) ; if ( cairo_surface_status ( surf ) )  unsigned char * surfData = cairo_image_surface_get_data ( surf ) ; int surfStride = cairo_image_surface_get_stride ( surf ) ; int32_t pixelWidth = BytesPerPixel ( aFormat ) ; unsigned char * source = aData + aRect . y * aStride + aRect . x * pixelWidth ; for (int32_t y = 0; y < aRect.height; ++y) memcpy ( surfData + y * surfStride , source + y * aStride , aRect . width * pixelWidth ); 