Use "clone" method for bilinear resampling

When drawing a bilinear-scaled bitmap with agg, we used to interpolate
the edge pixels assuming everything out of the picture was black. This
led to an ugly dark border around the scaled image.

Instead, use the "clone" method, which repeats the last line or column
of pixels around the image, leading to more correct results in most
cases.

This also helps with some of WebKit tests, which are trying to use
images as references and don't expect an extra border around them.
This commit is contained in:
Adrien Destugues
2013-12-24 09:28:46 +01:00
parent 756ff6c0bc
commit adde25de6e
+2 -2
View File
@@ -2722,8 +2722,8 @@ Painter::_DrawBitmapGeneric32(agg::rendering_buffer& srcBuffer,
agg::span_allocator<pixfmt_image::color_type> spanAllocator;
// image accessor attached to pixel format of bitmap
typedef agg::image_accessor_clip<pixfmt_image> source_type;
source_type source(pixf_img, agg::rgba8(0, 0, 0, 0));
typedef agg::image_accessor_clone<pixfmt_image> source_type;
source_type source(pixf_img);
// clip to the current clipping region's frame
viewRect = viewRect & fClippingRegion->Frame();