| Differences between
and this patch
- a/ChangeLog +10 lines
Lines 1-3 a/ChangeLog_sec1
1
2009-11-04  Benjamin Otte  <otte@gnome.org>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        Update Cairo requirement to 1.6.
6
        
7
        https://bugs.webkit.org/show_bug.cgi?id=19266
8
9
        * configure.ac:
10
1
2009-11-02  Estêvão Samuel Procópio  <tevaum@gmail.com>
11
2009-11-02  Estêvão Samuel Procópio  <tevaum@gmail.com>
2
12
3
        Reviewed by Gustavo Noronha.
13
        Reviewed by Gustavo Noronha.
- a/WebCore/ChangeLog +24 lines
Lines 1-3 a/WebCore/ChangeLog_sec1
1
2009-11-04  Benjamin Otte  <otte@gnome.org>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        Update Cairo requirement to 1.6.
6
7
        Also remove all conditional code and workarounds for older versions of
8
        Cairo.
9
        In particular, gain image quality by removing the use of
10
        CAIRO_FILTER_NEAREST when rendering images and use the default
11
        bilinear filter instead.
12
        https://bugs.webkit.org/show_bug.cgi?id=19266
13
14
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
15
        (WebCore::GraphicsContext::clipOut):
16
        * platform/graphics/cairo/ImageCairo.cpp:
17
        (WebCore::BitmapImage::draw):
18
        (WebCore::BitmapImage::drawPattern):
19
        * platform/graphics/cairo/PathCairo.cpp:
20
        (WebCore::Path::isEmpty):
21
        (WebCore::Path::boundingRect):
22
        * platform/gtk/RenderThemeGtk.cpp:
23
        (WebCore::paintMozWidget):
24
1
2009-11-02  Benjamin Otte  <otte@gnome.org>
25
2009-11-02  Benjamin Otte  <otte@gnome.org>
2
26
3
        Reviewed by NOBODY (OOPS!).
27
        Reviewed by NOBODY (OOPS!).
- a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp -8 lines
Lines 941-947 void GraphicsContext::clipOut(const Path& path) a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp_sec1
941
    if (paintingDisabled())
941
    if (paintingDisabled())
942
        return;
942
        return;
943
943
944
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,4,0)
945
    cairo_t* cr = m_data->cr;
944
    cairo_t* cr = m_data->cr;
946
    double x1, y1, x2, y2;
945
    double x1, y1, x2, y2;
947
    cairo_clip_extents(cr, &x1, &y1, &x2, &y2);
946
    cairo_clip_extents(cr, &x1, &y1, &x2, &y2);
Lines 952-960 void GraphicsContext::clipOut(const Path& path) a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp_sec2
952
    cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
951
    cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
953
    cairo_clip(cr);
952
    cairo_clip(cr);
954
    cairo_set_fill_rule(cr, savedFillRule);
953
    cairo_set_fill_rule(cr, savedFillRule);
955
#else
956
    notImplemented();
957
#endif
958
}
954
}
959
955
960
void GraphicsContext::rotate(float radians)
956
void GraphicsContext::rotate(float radians)
Lines 980-986 void GraphicsContext::clipOut(const IntRect& r) a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp_sec3
980
    if (paintingDisabled())
976
    if (paintingDisabled())
981
        return;
977
        return;
982
978
983
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,4,0)
984
    cairo_t* cr = m_data->cr;
979
    cairo_t* cr = m_data->cr;
985
    double x1, y1, x2, y2;
980
    double x1, y1, x2, y2;
986
    cairo_clip_extents(cr, &x1, &y1, &x2, &y2);
981
    cairo_clip_extents(cr, &x1, &y1, &x2, &y2);
Lines 990-998 void GraphicsContext::clipOut(const IntRect& r) a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp_sec4
990
    cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
985
    cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
991
    cairo_clip(cr);
986
    cairo_clip(cr);
992
    cairo_set_fill_rule(cr, savedFillRule);
987
    cairo_set_fill_rule(cr, savedFillRule);
993
#else
994
    notImplemented();
995
#endif
996
}
988
}
997
989
998
void GraphicsContext::clipOutEllipseInRect(const IntRect& r)
990
void GraphicsContext::clipOutEllipseInRect(const IntRect& r)
- a/WebCore/platform/graphics/cairo/ImageCairo.cpp -8 / +1 lines
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;
- a/WebCore/platform/graphics/cairo/PathCairo.cpp -13 / +1 lines
Lines 78-92 void Path::clear() a/WebCore/platform/graphics/cairo/PathCairo.cpp_sec1
78
78
79
bool Path::isEmpty() const
79
bool Path::isEmpty() const
80
{
80
{
81
    cairo_t* cr = platformPath()->m_cr;
81
    return !cairo_has_current_point(platformPath()->m_cr);
82
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,5,10)
83
    return !cairo_has_current_point(cr);
84
#else
85
    cairo_path_t* p = cairo_copy_path(cr);
86
    bool hasData = p->num_data;
87
    cairo_path_destroy(p);
88
    return !hasData;
89
#endif
90
}
82
}
91
83
92
bool Path::hasCurrentPoint() const
84
bool Path::hasCurrentPoint() const
Lines 256-266 FloatRect Path::boundingRect() const a/WebCore/platform/graphics/cairo/PathCairo.cpp_sec2
256
{
248
{
257
    cairo_t* cr = platformPath()->m_cr;
249
    cairo_t* cr = platformPath()->m_cr;
258
    double x0, x1, y0, y1;
250
    double x0, x1, y0, y1;
259
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 6, 0)
260
    cairo_path_extents(cr, &x0, &y0, &x1, &y1);
251
    cairo_path_extents(cr, &x0, &y0, &x1, &y1);
261
#else
262
    cairo_stroke_extents(cr, &x0, &y0, &x1, &y1);
263
#endif
264
    return FloatRect(x0, y0, x1 - x0, y1 - y0);
252
    return FloatRect(x0, y0, x1 - x0, y1 - y0);
265
}
253
}
266
254
- a/WebCore/platform/gtk/RenderThemeGtk.cpp -4 lines
Lines 188-194 static bool paintMozWidget(RenderTheme* theme, GtkThemeWidgetType type, RenderOb a/WebCore/platform/gtk/RenderThemeGtk.cpp_sec1
188
    GdkRectangle gdkRect = IntRect(pos.x(), pos.y(), rect.width(), rect.height());
188
    GdkRectangle gdkRect = IntRect(pos.x(), pos.y(), rect.width(), rect.height());
189
    GtkTextDirection direction = gtkTextDirection(o->style()->direction());
189
    GtkTextDirection direction = gtkTextDirection(o->style()->direction());
190
190
191
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,4,0)
192
    // Find the clip rectangle
191
    // Find the clip rectangle
193
    cairo_t *cr = i.context->platformContext();
192
    cairo_t *cr = i.context->platformContext();
194
    double clipX1, clipX2, clipY1, clipY2;
193
    double clipX1, clipX2, clipY1, clipY2;
Lines 202-210 static bool paintMozWidget(RenderTheme* theme, GtkThemeWidgetType type, RenderOb a/WebCore/platform/gtk/RenderThemeGtk.cpp_sec2
202
    gdkClipRect.y = clipPos.y();
201
    gdkClipRect.y = clipPos.y();
203
202
204
    gdk_rectangle_intersect(&gdkRect, &gdkClipRect, &gdkClipRect);
203
    gdk_rectangle_intersect(&gdkRect, &gdkClipRect, &gdkClipRect);
205
#else
206
    GdkRectangle gdkClipRect = gdkRect;
207
#endif
208
204
209
    return moz_gtk_widget_paint(type, i.context->gdkDrawable(), &gdkRect, &gdkClipRect, &mozState, flags, direction) != MOZ_GTK_SUCCESS;
205
    return moz_gtk_widget_paint(type, i.context->gdkDrawable(), &gdkRect, &gdkClipRect, &mozState, flags, direction) != MOZ_GTK_SUCCESS;
210
}
206
}
- a/configure.ac -2 / +1 lines
Lines 191-197 fi a/configure.ac_sec1
191
191
192
# minimum base dependencies
192
# minimum base dependencies
193
LIBSOUP_REQUIRED_VERSION=2.27.91
193
LIBSOUP_REQUIRED_VERSION=2.27.91
194
CAIRO_REQUIRED_VERSION=1.2
194
CAIRO_REQUIRED_VERSION=1.6
195
FONTCONFIG_REQUIRED_VERSION=2.4
195
FONTCONFIG_REQUIRED_VERSION=2.4
196
FREETYPE2_REQUIRED_VERSION=9.0
196
FREETYPE2_REQUIRED_VERSION=9.0
197
LIBXML_REQUIRED_VERSION=2.6
197
LIBXML_REQUIRED_VERSION=2.6
198
- 

Return to Bug 19266