Changeset 118020 in webkit
- Timestamp:
- May 22, 2012 12:23:18 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r118013 r118020 1 2012-05-22 Rafael Brandao <rafael.lobo@openbossa.org> 2 3 [Qt] canvas/philip/tests/2d.path.stroke.overlap.html fails with Qt-4.6.2 or higher 4 https://bugs.webkit.org/show_bug.cgi?id=40362 5 6 Reviewed by Noam Rosenthal. 7 8 * platform/qt/Skipped: Unskip test after fix. 9 1 10 2012-05-22 Emil A Eklund <eae@chromium.org> 2 11 -
trunk/LayoutTests/platform/qt/Skipped
r117939 r118020 2124 2124 # ============================================================================= # 2125 2125 2126 # [Qt] canvas/philip/tests/2d.path.stroke.overlap.html fails with Qt-4.6.2 or higher2127 # https://bugs.webkit.org/show_bug.cgi?id=403622128 canvas/philip/tests/2d.path.stroke.overlap.html2129 2130 2126 # [Qt] editing/execCommand/move-selection-back-line.html fails with Qt >= 4.7.1 2131 2127 # https://bugs.webkit.org/show_bug.cgi?id=50144 -
trunk/Source/WebCore/ChangeLog
r118018 r118020 1 2012-05-22 Rafael Brandao <rafael.lobo@openbossa.org> 2 3 [Qt] canvas/philip/tests/2d.path.stroke.overlap.html fails with Qt-4.6.2 or higher 4 https://bugs.webkit.org/show_bug.cgi?id=40362 5 6 Reviewed by Noam Rosenthal. 7 8 Before drawing the stroke from a certain path, it should make the union of the stroke areas. 9 The previous implementation didn't consider that so the intersection was painted twice. 10 By using QPainterPathStroker, we create a QPainterPath on top of the platform path, and 11 then we fill it with the expected brush. This way we avoid repainting areas. 12 13 * platform/graphics/qt/GraphicsContextQt.cpp: 14 (WebCore::fillPathStroke): 15 (WebCore): 16 (WebCore::GraphicsContext::strokePath): 17 1 18 2012-05-21 Gavin Barraclough <barraclough@apple.com> 2 19 -
trunk/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
r113059 r118020 60 60 #include <QPainter> 61 61 #include <QPainterPath> 62 #include <QPainterPathStroker> 62 63 #include <QPixmap> 63 64 #include <QPolygonF> … … 528 529 } 529 530 531 inline static void fillPathStroke(QPainter* painter, QPainterPathStroker& pathStroker, const QPainterPath& platformPath, const QBrush& brush) 532 { 533 QPainterPath stroke = pathStroker.createStroke(platformPath); 534 painter->fillPath(stroke, brush); 535 } 536 530 537 void GraphicsContext::strokePath(const Path& path) 531 538 { … … 537 544 QPainterPath platformPath = path.platformPath(); 538 545 platformPath.setFillRule(toQtFillRule(fillRule())); 546 QPainterPathStroker pathStroker; 547 pathStroker.setJoinStyle(pen.joinStyle()); 548 pathStroker.setDashOffset(pen.dashOffset()); 549 pathStroker.setMiterLimit(pen.miterLimit()); 550 pathStroker.setCapStyle(pen.capStyle()); 551 pathStroker.setWidth(pen.widthF()); 539 552 540 553 if (hasShadow()) { … … 550 563 QBrush brush(*m_state.strokeGradient->platformGradient()); 551 564 brush.setTransform(m_state.strokeGradient->gradientSpaceTransform()); 552 QPen shadowPen(pen); 553 shadowPen.setBrush(brush); 554 shadowPainter->strokePath(platformPath, shadowPen); 555 } else { 556 shadowPainter->strokePath(platformPath, pen); 557 } 565 fillPathStroke(shadowPainter, pathStroker, platformPath, brush); 566 } else 567 fillPathStroke(shadowPainter, pathStroker, platformPath, pen.brush()); 558 568 shadow->endShadowLayer(this); 559 569 } … … 565 575 QPen shadowPen(pen); 566 576 shadowPen.setColor(shadowColor); 567 p->strokePath(platformPath, shadowPen);577 fillPathStroke(p, pathStroker, platformPath, shadowPen.brush()); 568 578 p->translate(-offset); 569 579 } … … 572 582 if (m_state.strokePattern) { 573 583 AffineTransform affine; 574 pen.setBrush(QBrush(m_state.strokePattern->createPlatformPattern(affine))); 575 p->setPen(pen); 576 p->strokePath(platformPath, pen); 584 QBrush brush = m_state.strokePattern->createPlatformPattern(affine); 585 fillPathStroke(p, pathStroker, platformPath, brush); 577 586 } else if (m_state.strokeGradient) { 578 587 QBrush brush(*m_state.strokeGradient->platformGradient()); 579 588 brush.setTransform(m_state.strokeGradient->gradientSpaceTransform()); 580 pen.setBrush(brush); 581 p->setPen(pen); 582 p->strokePath(platformPath, pen); 589 fillPathStroke(p, pathStroker, platformPath, brush); 583 590 } else 584 p->strokePath(platformPath, pen);591 fillPathStroke(p, pathStroker, platformPath, pen.brush()); 585 592 } 586 593
Note: See TracChangeset
for help on using the changeset viewer.