|
Lines 125-135
void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const Flo
a/WebCore/platform/graphics/cairo/ImageCairo.cpp_sec1
|
| 125 |
// Test using example site at http://www.meyerweb.com/eric/css/edge/complexspiral/demo.html |
125 |
// Test using example site at http://www.meyerweb.com/eric/css/edge/complexspiral/demo.html |
| 126 |
cairo_pattern_t* pattern = cairo_pattern_create_for_surface(image); |
126 |
cairo_pattern_t* pattern = cairo_pattern_create_for_surface(image); |
| 127 |
|
127 |
|
| 128 |
// To avoid the unwanted gradient effect (#14017) we use |
128 |
cairo_pattern_set_extend(pattern, CAIRO_EXTEND_PAD); |
| 129 |
// CAIRO_FILTER_NEAREST now, but the real fix will be to have |
|
|
| 130 |
// CAIRO_EXTEND_PAD implemented for surfaces in Cairo allowing us to still |
| 131 |
// use bilinear filtering |
| 132 |
cairo_pattern_set_filter(pattern, CAIRO_FILTER_NEAREST); |
| 133 |
|
129 |
|
| 134 |
float scaleX = srcRect.width() / dstRect.width(); |
130 |
float scaleX = srcRect.width() / dstRect.width(); |
| 135 |
float scaleY = srcRect.height() / dstRect.height(); |
131 |
float scaleY = srcRect.height() / dstRect.height(); |
|
Lines 180-188
void Image::drawPattern(GraphicsContext* context, const FloatRect& tileRect, con
a/WebCore/platform/graphics/cairo/ImageCairo.cpp_sec2
|
| 180 |
cairo_pattern_t* pattern = cairo_pattern_create_for_surface(image); |
176 |
cairo_pattern_t* pattern = cairo_pattern_create_for_surface(image); |
| 181 |
cairo_pattern_set_extend(pattern, CAIRO_EXTEND_REPEAT); |
177 |
cairo_pattern_set_extend(pattern, CAIRO_EXTEND_REPEAT); |
| 182 |
|
178 |
|
| 183 |
// Workaround to avoid the unwanted gradient effect (#14017) |
|
|
| 184 |
cairo_pattern_set_filter(pattern, CAIRO_FILTER_NEAREST); |
| 185 |
|
| 186 |
cairo_matrix_t pattern_matrix = cairo_matrix_t(patternTransform); |
179 |
cairo_matrix_t pattern_matrix = cairo_matrix_t(patternTransform); |
| 187 |
cairo_matrix_t phase_matrix = {1, 0, 0, 1, phase.x() + tileRect.x() * patternTransform.a(), phase.y() + tileRect.y() * patternTransform.d()}; |
180 |
cairo_matrix_t phase_matrix = {1, 0, 0, 1, phase.x() + tileRect.x() * patternTransform.a(), phase.y() + tileRect.y() * patternTransform.d()}; |
| 188 |
cairo_matrix_t combined; |
181 |
cairo_matrix_t combined; |