Changeset 64322 in webkit


Ignore:
Timestamp:
Jul 29, 2010 4:43:54 PM (14 years ago)
Author:
Martin Robinson
Message:

2010-07-29 Martin Robinson <mrobinson@igalia.com>

Unreviewed, rolling out r64318.
http://trac.webkit.org/changeset/64318
https://bugs.webkit.org/show_bug.cgi?id=41732

This change broke many tests.

  • platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::drawEllipse): (WebCore::GraphicsContext::drawConvexPolygon): (WebCore::GraphicsContext::fillPath): (WebCore::GraphicsContext::strokePath): (WebCore::GraphicsContext::drawPath): (WebCore::GraphicsContext::drawFocusRing): (WebCore::GraphicsContext::addInnerRoundedRectClip): (WebCore::GraphicsContext::beginPath): (WebCore::GraphicsContext::addPath): (WebCore::GraphicsContext::clipOut): (WebCore::GraphicsContext::fillRoundedRect):
  • platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r64318 r64322  
     12010-07-29  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Unreviewed, rolling out r64318.
     4        http://trac.webkit.org/changeset/64318
     5        https://bugs.webkit.org/show_bug.cgi?id=41732
     6
     7        This change broke many tests.
     8
     9        * platform/graphics/cairo/GraphicsContextCairo.cpp:
     10        (WebCore::GraphicsContext::drawEllipse):
     11        (WebCore::GraphicsContext::drawConvexPolygon):
     12        (WebCore::GraphicsContext::fillPath):
     13        (WebCore::GraphicsContext::strokePath):
     14        (WebCore::GraphicsContext::drawPath):
     15        (WebCore::GraphicsContext::drawFocusRing):
     16        (WebCore::GraphicsContext::addInnerRoundedRectClip):
     17        (WebCore::GraphicsContext::beginPath):
     18        (WebCore::GraphicsContext::addPath):
     19        (WebCore::GraphicsContext::clipOut):
     20        (WebCore::GraphicsContext::fillRoundedRect):
     21        * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
     22
    1232010-07-29  Martin Robinson  <mrobinson@igalia.com>
    224
  • trunk/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp

    r64318 r64322  
    55 * Copyright (C) 2008 Nuanti Ltd.
    66 * Copyright (C) 2009 Brent Fulgham <bfulgham@webkit.org>
    7  * Copyright (C) 2010 Igalia S.L.
    87 *
    98 * Redistribution and use in source and binary forms, with or without
     
    145144}
    146145
    147 static void appendPathToCairoContext(cairo_t* to, cairo_t* from)
    148 {
    149     cairo_path_t* cairoPath = cairo_copy_path(from);
    150     cairo_append_path(to, cairoPath);
    151     cairo_path_destroy(cairoPath);
    152 }
    153 
    154 // We apply the pending path built via addPath to the Cairo context
    155 // lazily. This prevents interaction between the path and other routines
    156 // such as fillRect.
    157 static void setPathOnCairoContext(cairo_t* to, cairo_t* from)
    158 {
    159     cairo_new_path(to);
    160     appendPathToCairoContext(to, from);
    161 }
    162 
    163 static void appendWebCorePathToCairoContext(cairo_t* context, const Path& path)
    164 {
    165     appendPathToCairoContext(context, path.platformPath()->m_cr);
    166 }
    167 
    168146void GraphicsContext::calculateShadowBufferDimensions(IntSize& shadowBufferSize, FloatRect& shadowRect, float& kernelSize, const FloatRect& sourceRect, const FloatSize& shadowSize, float shadowBlur)
    169147{
     
    403381        cairo_set_line_width(cr, strokeThickness());
    404382        cairo_stroke(cr);
    405     } else
    406         cairo_new_path(cr);
     383    }
     384
     385    cairo_new_path(cr);
    407386}
    408387
     
    520499        cairo_set_line_width(cr, strokeThickness());
    521500        cairo_stroke(cr);
    522     } else
    523         cairo_new_path(cr);
    524 
     501    }
     502
     503    cairo_new_path(cr);
    525504    cairo_restore(cr);
    526505}
     
    544523    cairo_t* cr = m_data->cr;
    545524
    546     setPathOnCairoContext(cr, m_data->m_pendingPath.m_cr);
    547 
    548525    cairo_set_fill_rule(cr, fillRule() == RULE_EVENODD ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);
    549526    drawPathShadow(this, m_common, true, false);
     
    559536
    560537    cairo_t* cr = m_data->cr;
    561 
    562     setPathOnCairoContext(cr, m_data->m_pendingPath.m_cr);
    563 
    564538    drawPathShadow(this, m_common, false, true);
    565539
     
    575549
    576550    cairo_t* cr = m_data->cr;
    577 
    578     setPathOnCairoContext(cr, m_data->m_pendingPath.m_cr);
    579551
    580552    cairo_set_fill_rule(cr, fillRule() == RULE_EVENODD ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);
     
    702674    int radius = (width - 1) / 2;
    703675    for (unsigned i = 0; i < rectCount; i++)
    704         appendWebCorePathToCairoContext(cr, Path::createRoundedRectangle(rects[i], FloatSize(radius, radius)));
     676        addPath(Path::createRoundedRectangle(rects[i], FloatSize(radius, radius)));
    705677
    706678    // Force the alpha to 50%.  This matches what the Mac does with outline rings.
     
    869841        return;
    870842
    871     cairo_t* cr = m_data->cr;
    872843    clip(rect);
    873844
     
    879850    r.inflate(-thickness);
    880851    p.addEllipse(r);
    881     appendWebCorePathToCairoContext(cr, p);
    882 
     852    addPath(p);
     853
     854    cairo_t* cr = m_data->cr;
    883855    cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr);
    884856    cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
     
    11081080        return;
    11091081
    1110     cairo_new_path(m_data->m_pendingPath.m_cr);
     1082    cairo_t* cr = m_data->cr;
     1083    cairo_new_path(cr);
    11111084}
    11121085
     
    11161089        return;
    11171090
    1118     cairo_matrix_t currentMatrix;
    1119     cairo_get_matrix(m_data->cr, &currentMatrix);
    1120     cairo_set_matrix(m_data->m_pendingPath.m_cr, &currentMatrix);
    1121     appendWebCorePathToCairoContext(m_data->m_pendingPath.m_cr, path);
     1091    cairo_t* cr = m_data->cr;
     1092    cairo_path_t* p = cairo_copy_path(path.platformPath()->m_cr);
     1093    cairo_append_path(cr, p);
     1094    cairo_path_destroy(p);
    11221095}
    11231096
     
    11521125    cairo_clip_extents(cr, &x1, &y1, &x2, &y2);
    11531126    cairo_rectangle(cr, x1, y1, x2 - x1, y2 - y1);
    1154     appendWebCorePathToCairoContext(cr, path);
     1127    addPath(path);
    11551128
    11561129    cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr);
     
    12111184    cairo_t* cr = m_data->cr;
    12121185    cairo_save(cr);
    1213     appendWebCorePathToCairoContext(cr, Path::createRoundedRectangle(r, topLeft, topRight, bottomLeft, bottomRight));
     1186    beginPath();
     1187    addPath(Path::createRoundedRectangle(r, topLeft, topRight, bottomLeft, bottomRight));
    12141188    setColor(cr, color);
    12151189    drawPathShadow(this, m_common, true, false);
  • trunk/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h

    r64318 r64322  
    9696    cairo_t* cr;
    9797    Vector<float> layers;
    98     CairoPath m_pendingPath;
    9998
    10099#if PLATFORM(GTK)
Note: See TracChangeset for help on using the changeset viewer.