Changeset 64335 in webkit


Ignore:
Timestamp:
Jul 29, 2010 11:13:10 PM (14 years ago)
Author:
Martin Robinson
Message:

2010-07-29 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r64313.
http://trac.webkit.org/changeset/64313
https://bugs.webkit.org/show_bug.cgi?id=43233

Some Chromium bots are not happy with it for some unknown
reason. (Requested by dumi on #webkit).

  • bindings/js/JSCustomVoidCallback.cpp: (WebCore::JSCustomVoidCallback::~JSCustomVoidCallback):
  • bindings/scripts/CodeGeneratorJS.pm:
  • bindings/scripts/test/JS/JSTestCallback.cpp: (WebCore::JSTestCallback::~JSTestCallback):
  • platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::SQLiteDatabase): (WebCore::SQLiteDatabase::close): (WebCore::SQLiteDatabase::lock): (WebCore::SQLiteDatabase::unlock):
  • platform/sql/SQLiteDatabase.h:
  • platform/sql/SQLiteStatement.cpp: (WebCore::SQLiteStatement::prepare): (WebCore::SQLiteStatement::step):
  • storage/AbstractDatabase.cpp:
  • storage/AbstractDatabase.h:
  • storage/DatabaseTracker.cpp:
  • storage/DatabaseTracker.h:
  • storage/SQLStatement.cpp: (WebCore::SQLStatement::execute):
  • storage/SQLStatementSync.cpp: (WebCore::SQLStatementSync::execute):
  • storage/SQLTransaction.cpp: (WebCore::SQLTransaction::checkAndHandleClosedDatabase): (WebCore::SQLTransaction::performNextStep): (WebCore::SQLTransaction::performPendingCallback): (WebCore::SQLTransaction::deliverTransactionCallback): (WebCore::SQLTransaction::postflightAndCommit): (WebCore::SQLTransaction::deliverTransactionErrorCallback): (WebCore::SQLTransaction::cleanupAfterTransactionErrorCallback):
  • storage/SQLTransaction.h:
  • storage/chromium/DatabaseTrackerChromium.cpp:
  • workers/WorkerThread.cpp: (WebCore::WorkerThread::stop):
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r64334 r64335  
    9797        (WebCore::GraphicsContext::addInnerRoundedRectClip): Use the new appendWebCorePathToCairoContext helper instead
    9898        of addPath (which will blow away any path callers are building).
     99        (WebCore::GraphicsContext::beginPath): Clear out m_pendingPath here instead of the main native context.
     100        (WebCore::GraphicsContext::addPath): Add the path to m_pendingPath instead of the main native context.
     101        Also ensure that the transformation matrix of the m_pendingPath is equal to that of the main
     102        cairo context.
     103        (WebCore::GraphicsContext::clipOut): Use the appendWebCorePathToCairoContext helper here.
     104        (WebCore::GraphicsContext::fillRoundedRect): Ditto and remove an unnecessary beginPath call.
     105        * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h: Add a new m_pendingPath member.
     106
     1072010-07-29  Martin Robinson  <mrobinson@igalia.com>
     108
     109        Reviewed by Dirk Schulze.
     110
     111        [Cairo] Bring behavior of paths on the Cairo GraphicsContext into line with the CoreGraphics port
     112        https://bugs.webkit.org/show_bug.cgi?id=41732
     113
     114        Do not apply paths added to the Cairo GraphicsContext, until they are used.
     115        This prevents drawing routines such as fillRect from interacting with any
     116        path which callers are constructing on the GraphicsContext.
     117
     118         This behavior is necessary to close bug https://bugs.webkit.org/show_bug.cgi?id=41308
     119         so tests for that issue will test this fix.
     120
     121        * platform/graphics/cairo/GraphicsContextCairo.cpp:
     122        (WebCore::appendPathToCairoContext): Added. A helper method which adds a path
     123        to a native Cairo context.
     124        (WebCore::setPathOnCairoContext): Added. Like appendPathToCairoContext, but clears the
     125        existing path first.
     126        (WebCore::appendWebCorePathToCairoContext): Added. Like appendPathToCairoContext, but
     127        operates on a WebCore path.
     128        (WebCore::fillCurrentCairoPath): Added. Helper which fills the current cairo context path.
     129        (WebCore::strokeCurrentCairoPath): Added. Helper which strokes the current cairo context path.
     130        (WebCore::GraphicsContext::drawEllipse): Only clear the Cairo path if cairo_stroke
     131        was not called, because cairo_stroke implicitly clears the path.
     132        (WebCore::GraphicsContext::drawConvexPolygon): Ditto.
     133        (WebCore::GraphicsContext::fillPath): Copy the path from m_pendingPath to the context
     134        and clear m_pendingPath, instead of relying on the pre-existing context path. Do the
     135        actual fill via the new helper.
     136        (WebCore::GraphicsContext::strokePath): Ditto.
     137        (WebCore::GraphicsContext::drawPath): Ditto.
     138        (WebCore::GraphicsContext::fillRect): Use the new fillCurrentCairoPath helper.
     139        (WebCore::GraphicsContext::drawFocusRing): Use the new appendWebCorePathToCairoContext helper instead
     140        of addPath (which will blow away any path callers are building).
     141        (WebCore::GraphicsContext::addInnerRoundedRectClip): Use the new appendWebCorePathToCairoContext helper instead
     142        of addPath (which will blow away any path callers are building).
     143        (WebCore::GraphicsContext::strokeRect): Use the new strokeCurrentCairoPath helper.
    99144        (WebCore::GraphicsContext::beginPath): Clear out m_pendingPath here instead of the main native context.
    100145        (WebCore::GraphicsContext::addPath): Add the path to m_pendingPath instead of the main native context.
  • trunk/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp

    r64322 r64335  
    55 * Copyright (C) 2008 Nuanti Ltd.
    66 * Copyright (C) 2009 Brent Fulgham <bfulgham@webkit.org>
     7 * Copyright (C) 2010 Igalia S.L.
    78 *
    89 * Redistribution and use in source and binary forms, with or without
     
    144145}
    145146
     147static 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.
     157static void setPathOnCairoContext(cairo_t* to, cairo_t* from)
     158{
     159    cairo_new_path(to);
     160    appendPathToCairoContext(to, from);
     161}
     162
     163static void appendWebCorePathToCairoContext(cairo_t* context, const Path& path)
     164{
     165    appendPathToCairoContext(context, path.platformPath()->m_cr);
     166}
     167
    146168void GraphicsContext::calculateShadowBufferDimensions(IntSize& shadowBufferSize, FloatRect& shadowRect, float& kernelSize, const FloatRect& sourceRect, const FloatSize& shadowSize, float shadowBlur)
    147169{
     
    200222    context->createPlatformShadow(shadowBuffer.release(), shadowColor, shadowRect, kernelSize);
    201223#endif
     224}
     225
     226static void fillCurrentCairoPath(GraphicsContext* context, GraphicsContextPrivate* gcp, cairo_t* cairoContext)
     227{
     228    cairo_set_fill_rule(cairoContext, context->fillRule() == RULE_EVENODD ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);
     229    drawPathShadow(context, gcp, true, false);
     230
     231    setPlatformFill(context, cairoContext, gcp);
     232    cairo_new_path(cairoContext);
     233}
     234
     235static void strokeCurrentCairoPath(GraphicsContext* context, GraphicsContextPrivate* gcp, cairo_t* cairoContext)
     236{
     237    drawPathShadow(context, gcp, false, true);
     238    setPlatformStroke(context, cairoContext, gcp);
     239    cairo_new_path(cairoContext);
    202240}
    203241
     
    381419        cairo_set_line_width(cr, strokeThickness());
    382420        cairo_stroke(cr);
    383     }
    384 
    385     cairo_new_path(cr);
     421    } else
     422        cairo_new_path(cr);
    386423}
    387424
     
    499536        cairo_set_line_width(cr, strokeThickness());
    500537        cairo_stroke(cr);
    501     }
    502 
    503     cairo_new_path(cr);
     538    } else
     539        cairo_new_path(cr);
     540
    504541    cairo_restore(cr);
    505542}
     
    523560    cairo_t* cr = m_data->cr;
    524561
    525     cairo_set_fill_rule(cr, fillRule() == RULE_EVENODD ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);
    526     drawPathShadow(this, m_common, true, false);
    527 
    528     setPlatformFill(this, cr, m_common);
    529     cairo_new_path(cr);
     562    setPathOnCairoContext(cr, m_data->m_pendingPath.m_cr);
     563    fillCurrentCairoPath(this, m_common, cr);
    530564}
    531565
     
    536570
    537571    cairo_t* cr = m_data->cr;
    538     drawPathShadow(this, m_common, false, true);
    539 
    540     setPlatformStroke(this, cr, m_common);
    541     cairo_new_path(cr);
    542 
     572    setPathOnCairoContext(cr, m_data->m_pendingPath.m_cr);
     573    strokeCurrentCairoPath(this, m_common, cr);
    543574}
    544575
     
    549580
    550581    cairo_t* cr = m_data->cr;
     582
     583    setPathOnCairoContext(cr, m_data->m_pendingPath.m_cr);
    551584
    552585    cairo_set_fill_rule(cr, fillRule() == RULE_EVENODD ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);
     
    566599    cairo_save(cr);
    567600    cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height());
    568     fillPath();
     601    fillCurrentCairoPath(this, m_common, cr);
    569602    cairo_restore(cr);
    570603}
     
    674707    int radius = (width - 1) / 2;
    675708    for (unsigned i = 0; i < rectCount; i++)
    676         addPath(Path::createRoundedRectangle(rects[i], FloatSize(radius, radius)));
     709        appendWebCorePathToCairoContext(cr, Path::createRoundedRectangle(rects[i], FloatSize(radius, radius)));
    677710
    678711    // Force the alpha to 50%.  This matches what the Mac does with outline rings.
     
    841874        return;
    842875
     876    cairo_t* cr = m_data->cr;
    843877    clip(rect);
    844878
     
    850884    r.inflate(-thickness);
    851885    p.addEllipse(r);
    852     addPath(p);
    853 
    854     cairo_t* cr = m_data->cr;
     886    appendWebCorePathToCairoContext(cr, p);
     887
    855888    cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr);
    856889    cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
     
    963996    cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height());
    964997    cairo_set_line_width(cr, width);
    965     strokePath();
     998    strokeCurrentCairoPath(this, m_common, cr);
    966999    cairo_restore(cr);
    9671000}
     
    10801113        return;
    10811114
    1082     cairo_t* cr = m_data->cr;
    1083     cairo_new_path(cr);
     1115    cairo_new_path(m_data->m_pendingPath.m_cr);
    10841116}
    10851117
     
    10891121        return;
    10901122
    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);
     1123    cairo_matrix_t currentMatrix;
     1124    cairo_get_matrix(m_data->cr, &currentMatrix);
     1125    cairo_set_matrix(m_data->m_pendingPath.m_cr, &currentMatrix);
     1126    appendWebCorePathToCairoContext(m_data->m_pendingPath.m_cr, path);
    10951127}
    10961128
     
    11251157    cairo_clip_extents(cr, &x1, &y1, &x2, &y2);
    11261158    cairo_rectangle(cr, x1, y1, x2 - x1, y2 - y1);
    1127     addPath(path);
     1159    appendWebCorePathToCairoContext(cr, path);
    11281160
    11291161    cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr);
     
    11841216    cairo_t* cr = m_data->cr;
    11851217    cairo_save(cr);
    1186     beginPath();
    1187     addPath(Path::createRoundedRectangle(r, topLeft, topRight, bottomLeft, bottomRight));
     1218    appendWebCorePathToCairoContext(cr, Path::createRoundedRectangle(r, topLeft, topRight, bottomLeft, bottomRight));
    11881219    setColor(cr, color);
    11891220    drawPathShadow(this, m_common, true, false);
  • trunk/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h

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