WebCore/platform/graphics/cairo/ImageCairo.cpp

11/*
22 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
33 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
 4 * Copyright (C) 2008 Collabora Ltd.
45 *
56 * Redistribution and use in source and binary forms, with or without
67 * modification, are permitted provided that the following conditions

109110 // Test using example site at http://www.meyerweb.com/eric/css/edge/complexspiral/demo.html
110111 cairo_pattern_t* pattern = cairo_pattern_create_for_surface(image);
111112
112  // To avoid the unwanted gradient effect (#14017) we use
113  // CAIRO_FILTER_NEAREST now, but the real fix will be to have
114  // CAIRO_EXTEND_PAD implemented for surfaces in Cairo allowing us to still
115  // use bilinear filtering
116  cairo_pattern_set_filter(pattern, CAIRO_FILTER_NEAREST);
 113 // FIXME: Make the filter setting configurable (like for slow CPUs)
 114 cairo_pattern_set_extend(pattern, CAIRO_EXTEND_PAD);
 115 cairo_pattern_set_filter(pattern, CAIRO_FILTER_GOOD);
117116
118117 float scaleX = srcRect.width() / dstRect.width();
119118 float scaleY = srcRect.height() / dstRect.height();

150149 cairo_pattern_t* pattern = cairo_pattern_create_for_surface(image);
151150 cairo_pattern_set_extend(pattern, CAIRO_EXTEND_REPEAT);
152151
153  // Workaround to avoid the unwanted gradient effect (#14017)
154  cairo_pattern_set_filter(pattern, CAIRO_FILTER_NEAREST);
 152 cairo_pattern_set_filter(pattern, CAIRO_FILTER_GOOD);
155153
156154 cairo_matrix_t pattern_matrix = cairo_matrix_t(patternTransform);
157155 cairo_matrix_t phase_matrix = {1, 0, 0, 1, phase.x(), phase.y()};
révision 34077

WebCore/ChangeLog

 12008-05-27 Pierre-Luc Beaudoin <pierre-luc.beaudoin@collabora.co.uk>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 Fix Cairo stretching, now that CAIRO_EXTEND_PAD have been implemented,
 6 we can use a better filter for stretched images.
 7
 8 * ChangeLog:
 9 * platform/graphics/cairo/ImageCairo.cpp:
 10 (WebCore::BitmapImage::draw):
 11 (WebCore::Image::drawPattern):
 12
1132008-05-27 Ariya Hidayat <ariya.hidayat@trolltech.com>
214
315 Reviewed by Simon.
révision 34149