+2007-06-06 Alp Toker <alp.toker@collabora.co.uk>
+
+ Reviewed by Eric Seidel.
+
+ http://bugs.webkit.org/show_bug.cgi?id=14017
+ Cairo: Unwanted gradient effect for small stretched images
+
+ * platform/graphics/cairo/ImageCairo.cpp: Use CAIRO_FILTER_NEAREST to
+ work around the issue.
+ (WebCore::BitmapImage::draw):
+ (WebCore::Image::drawPattern):
+
2007-06-06 Lars Knoll <lars@trolltech.com>
Reviewed by Zack
// a pattern transformation on the image and draw the transformed pattern.
// Test using example site at http://www.meyerweb.com/eric/css/edge/complexspiral/demo.html
cairo_pattern_t* pattern = cairo_pattern_create_for_surface(image);
+
+ // To avoid the unwanted gradient effect (#14017) we use
+ // CAIRO_FILTER_NEAREST now, but the real fix will be to have
+ // CAIRO_EXTEND_PAD implemented for surfaces in Cairo allowing us to still
+ // use bilinear filtering
+ cairo_pattern_set_filter(pattern, CAIRO_FILTER_NEAREST);
+
float scaleX = srcRect.width() / dstRect.width();
float scaleY = srcRect.height() / dstRect.height();
cairo_matrix_t mat = { scaleX, 0, 0 , scaleY, srcRect.x(), srcRect.y() };
cairo_pattern_t* pattern = cairo_pattern_create_for_surface(image);
cairo_pattern_set_extend(pattern, CAIRO_EXTEND_REPEAT);
+ // Workaround to avoid the unwanted gradient effect (#14017)
+ cairo_pattern_set_filter(pattern, CAIRO_FILTER_NEAREST);
+
cairo_matrix_t pattern_matrix = cairo_matrix_t(patternTransform);
cairo_matrix_t phase_matrix = {1, 0, 0, 1, phase.x(), phase.y()};
cairo_matrix_t combined;