Changeset 50527 in webkit


Ignore:
Timestamp:
Nov 4, 2009 1:00:11 PM (14 years ago)
Author:
eric@webkit.org
Message:

2009-11-04 Benjamin Otte <otte@gnome.org>

Reviewed by Gustavo Noronha.

Update Cairo requirement to 1.6.

https://bugs.webkit.org/show_bug.cgi?id=19266

  • configure.ac:

2009-11-04 Benjamin Otte <otte@gnome.org>

Reviewed by Gustavo Noronha.

Update Cairo requirement to 1.6.

Also remove all conditional code and workarounds for older versions of
Cairo.
In particular, gain image quality by removing the use of
CAIRO_FILTER_NEAREST when rendering images and use the default
bilinear filter instead.
https://bugs.webkit.org/show_bug.cgi?id=19266

  • platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::clipOut):
  • platform/graphics/cairo/ImageCairo.cpp: (WebCore::BitmapImage::draw): (WebCore::BitmapImage::drawPattern):
  • platform/graphics/cairo/PathCairo.cpp: (WebCore::Path::isEmpty): (WebCore::Path::boundingRect):
  • platform/gtk/RenderThemeGtk.cpp: (WebCore::paintMozWidget):
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r50430 r50527  
     12009-11-04  Benjamin Otte  <otte@gnome.org>
     2
     3        Reviewed by Gustavo Noronha.
     4
     5        Update Cairo requirement to 1.6.
     6       
     7        https://bugs.webkit.org/show_bug.cgi?id=19266
     8
     9        * configure.ac:
     10
    1112009-11-02  Estêvão Samuel Procópio  <tevaum@gmail.com>
    212
  • trunk/WebCore/ChangeLog

    r50526 r50527  
     12009-11-04  Benjamin Otte  <otte@gnome.org>
     2
     3        Reviewed by Gustavo Noronha.
     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
    1252009-11-04  Kevin Ollivier  <kevino@theolliviers.com>
    226
  • trunk/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp

    r49641 r50527  
    942942        return;
    943943
    944 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,4,0)
    945944    cairo_t* cr = m_data->cr;
    946945    double x1, y1, x2, y2;
     
    953952    cairo_clip(cr);
    954953    cairo_set_fill_rule(cr, savedFillRule);
    955 #else
    956     notImplemented();
    957 #endif
    958954}
    959955
     
    981977        return;
    982978
    983 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,4,0)
    984979    cairo_t* cr = m_data->cr;
    985980    double x1, y1, x2, y2;
     
    991986    cairo_clip(cr);
    992987    cairo_set_fill_rule(cr, savedFillRule);
    993 #else
    994     notImplemented();
    995 #endif
    996988}
    997989
  • trunk/WebCore/platform/graphics/cairo/ImageCairo.cpp

    r46956 r50527  
    126126    cairo_pattern_t* pattern = cairo_pattern_create_for_surface(image);
    127127
    128     // To avoid the unwanted gradient effect (#14017) we use
    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);
     128    cairo_pattern_set_extend(pattern, CAIRO_EXTEND_PAD);
    133129
    134130    float scaleX = srcRect.width() / dstRect.width();
     
    181177    cairo_pattern_set_extend(pattern, CAIRO_EXTEND_REPEAT);
    182178
    183     // Workaround to avoid the unwanted gradient effect (#14017)
    184     cairo_pattern_set_filter(pattern, CAIRO_FILTER_NEAREST);
    185 
    186179    cairo_matrix_t pattern_matrix = cairo_matrix_t(patternTransform);
    187180    cairo_matrix_t phase_matrix = {1, 0, 0, 1, phase.x() + tileRect.x() * patternTransform.a(), phase.y() + tileRect.y() * patternTransform.d()};
  • trunk/WebCore/platform/graphics/cairo/PathCairo.cpp

    r45873 r50527  
    7979bool Path::isEmpty() const
    8080{
    81     cairo_t* cr = 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
     81    return !cairo_has_current_point(platformPath()->m_cr);
    9082}
    9183
     
    257249    cairo_t* cr = platformPath()->m_cr;
    258250    double x0, x1, y0, y1;
    259 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 6, 0)
    260251    cairo_path_extents(cr, &x0, &y0, &x1, &y1);
    261 #else
    262     cairo_stroke_extents(cr, &x0, &y0, &x1, &y1);
    263 #endif
    264252    return FloatRect(x0, y0, x1 - x0, y1 - y0);
    265253}
  • trunk/WebCore/platform/gtk/RenderThemeGtk.cpp

    r45595 r50527  
    189189    GtkTextDirection direction = gtkTextDirection(o->style()->direction());
    190190
    191 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,4,0)
    192191    // Find the clip rectangle
    193192    cairo_t *cr = i.context->platformContext();
     
    203202
    204203    gdk_rectangle_intersect(&gdkRect, &gdkClipRect, &gdkClipRect);
    205 #else
    206     GdkRectangle gdkClipRect = gdkRect;
    207 #endif
    208204
    209205    return moz_gtk_widget_paint(type, i.context->gdkDrawable(), &gdkRect, &gdkClipRect, &mozState, flags, direction) != MOZ_GTK_SUCCESS;
  • trunk/configure.ac

    r50430 r50527  
    192192# minimum base dependencies
    193193LIBSOUP_REQUIRED_VERSION=2.27.91
    194 CAIRO_REQUIRED_VERSION=1.2
     194CAIRO_REQUIRED_VERSION=1.6
    195195FONTCONFIG_REQUIRED_VERSION=2.4
    196196FREETYPE2_REQUIRED_VERSION=9.0
Note: See TracChangeset for help on using the changeset viewer.