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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user