diff options
author | Feng Qian <fqian@google.com> | 2009-06-18 18:20:56 -0700 |
---|---|---|
committer | Feng Qian <fqian@google.com> | 2009-06-18 18:20:56 -0700 |
commit | 1edef79f87f9c52c21d69c87c19f8e2b140a9119 (patch) | |
tree | cad337ef493b0d9710bf3ae478cb87cb534f598d /WebCore/platform/graphics/qt/GraphicsContextQt.cpp | |
parent | b83fc086000e27bc227580bd0e35b9d7bee1179a (diff) | |
parent | c9c4d65c1547996ed3748026904d6e7f09aec2b4 (diff) | |
download | external_webkit-1edef79f87f9c52c21d69c87c19f8e2b140a9119.zip external_webkit-1edef79f87f9c52c21d69c87c19f8e2b140a9119.tar.gz external_webkit-1edef79f87f9c52c21d69c87c19f8e2b140a9119.tar.bz2 |
Merge commit 'goog/master-webkit-merge' into webkit-merge-44544
Diffstat (limited to 'WebCore/platform/graphics/qt/GraphicsContextQt.cpp')
-rw-r--r-- | WebCore/platform/graphics/qt/GraphicsContextQt.cpp | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp index ccf4b06..ed7ac47 100644 --- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp +++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp @@ -99,7 +99,7 @@ static inline QPainter::CompositionMode toQtCompositionMode(CompositeOperator op case CompositeHighlight: return QPainter::CompositionMode_SourceOver; case CompositePlusLighter: - return QPainter::CompositionMode_SourceOver; + return QPainter::CompositionMode_Plus; } return QPainter::CompositionMode_SourceOver; @@ -153,6 +153,18 @@ static Qt::PenStyle toQPenStyle(StrokeStyle style) return Qt::NoPen; } +static inline Qt::FillRule toQtFillRule(WindRule rule) +{ + switch(rule) { + case RULE_EVENODD: + return Qt::OddEvenFill; + case RULE_NONZERO: + return Qt::WindingFill; + } + qDebug("Qt: unrecognized wind rule!"); + return Qt::OddEvenFill; +} + struct TransparencyLayer { TransparencyLayer(const QPainter* p, const QRect &rect) @@ -563,7 +575,7 @@ void GraphicsContext::strokeArc(const IntRect& rect, int startAngle, int angleSp QPainter *p = m_data->p(); const bool antiAlias = p->testRenderHint(QPainter::Antialiasing); - p->setRenderHint(QPainter::Antialiasing, m_data->antiAliasingForRectsAndLines); + p->setRenderHint(QPainter::Antialiasing, true); p->drawArc(rect, startAngle * 16, angleSpan * 16); @@ -606,6 +618,7 @@ void GraphicsContext::fillPath() QPainter *p = m_data->p(); QPainterPath path = m_data->currentPath; + path.setFillRule(toQtFillRule(fillRule())); switch (m_common->state.fillColorSpace) { case SolidColorSpace: @@ -634,6 +647,7 @@ void GraphicsContext::strokePath() QPainter *p = m_data->p(); QPen pen = p->pen(); QPainterPath path = m_data->currentPath; + path.setFillRule(toQtFillRule(fillRule())); switch (m_common->state.strokeColorSpace) { case SolidColorSpace: @@ -1097,7 +1111,13 @@ void GraphicsContext::addInnerRoundedRectClip(const IntRect& rect, rect.width() - (thickness * 2), rect.height() - (thickness * 2))); path.setFillRule(Qt::OddEvenFill); - m_data->p()->setClipPath(path, Qt::IntersectClip); + + QPainter *p = m_data->p(); + + const bool antiAlias = p->testRenderHint(QPainter::Antialiasing); + p->setRenderHint(QPainter::Antialiasing, true); + p->setClipPath(path, Qt::IntersectClip); + p->setRenderHint(QPainter::Antialiasing, antiAlias); } void GraphicsContext::concatCTM(const TransformationMatrix& transform) |