Combining raster data and graphic primitives