From adde25de6e725bdb2ec758f3e43ee61df4b90f42 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Mon, 23 Dec 2013 10:01:21 +0100 Subject: [PATCH] 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. --- src/servers/app/drawing/Painter/Painter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/servers/app/drawing/Painter/Painter.cpp b/src/servers/app/drawing/Painter/Painter.cpp index 2dc6bb884c..98b043a9dc 100644 --- a/src/servers/app/drawing/Painter/Painter.cpp +++ b/src/servers/app/drawing/Painter/Painter.cpp @@ -2722,8 +2722,8 @@ Painter::_DrawBitmapGeneric32(agg::rendering_buffer& srcBuffer, agg::span_allocator spanAllocator; // image accessor attached to pixel format of bitmap - typedef agg::image_accessor_clip source_type; - source_type source(pixf_img, agg::rgba8(0, 0, 0, 0)); + typedef agg::image_accessor_clone source_type; + source_type source(pixf_img); // clip to the current clipping region's frame viewRect = viewRect & fClippingRegion->Frame();