summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/graphics/qt/GraphicsContextQt.cpp')
-rw-r--r--WebCore/platform/graphics/qt/GraphicsContextQt.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index 5a29ad4..7e4af40 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -201,7 +201,7 @@ public:
bool hasShadow() const
{
- return shadow.type != ContextShadow::NoShadow;
+ return shadow.m_type != ContextShadow::NoShadow;
}
QRectF clipBoundingRect() const
@@ -440,9 +440,9 @@ void GraphicsContext::strokeArc(const IntRect& rect, int startAngle, int angleSp
if (m_data->hasShadow()) {
p->save();
- p->translate(m_data->shadow.offset);
+ p->translate(m_data->shadow.offset());
QPen pen(p->pen());
- pen.setColor(m_data->shadow.color);
+ pen.setColor(m_data->shadow.m_color);
p->setPen(pen);
p->drawArc(rect, startAngle, angleSpan);
p->restore();
@@ -470,12 +470,12 @@ void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points
p->setRenderHint(QPainter::Antialiasing, shouldAntialias);
if (m_data->hasShadow()) {
p->save();
- p->translate(m_data->shadow.offset);
+ p->translate(m_data->shadow.offset());
if (p->brush().style() != Qt::NoBrush)
- p->setBrush(QBrush(m_data->shadow.color));
+ p->setBrush(QBrush(m_data->shadow.m_color));
QPen pen(p->pen());
if (pen.style() != Qt::NoPen) {
- pen.setColor(m_data->shadow.color);
+ pen.setColor(m_data->shadow.m_color);
p->setPen(pen);
}
p->drawConvexPolygon(polygon);
@@ -519,9 +519,9 @@ void GraphicsContext::fillPath()
path.setFillRule(toQtFillRule(fillRule()));
if (m_data->hasShadow()) {
- p->translate(m_data->shadow.offset);
- p->fillPath(path, m_data->shadow.color);
- p->translate(-m_data->shadow.offset);
+ p->translate(m_data->shadow.offset());
+ p->fillPath(path, QColor(m_data->shadow.m_color));
+ p->translate(-m_data->shadow.offset());
}
if (m_common->state.fillPattern) {
AffineTransform affine;
@@ -547,11 +547,11 @@ void GraphicsContext::strokePath()
path.setFillRule(toQtFillRule(fillRule()));
if (m_data->hasShadow()) {
- p->translate(m_data->shadow.offset);
+ p->translate(m_data->shadow.offset());
QPen shadowPen(pen);
- shadowPen.setColor(m_data->shadow.color);
+ shadowPen.setColor(m_data->shadow.m_color);
p->strokePath(path, shadowPen);
- p->translate(-m_data->shadow.offset);
+ p->translate(-m_data->shadow.offset());
}
if (m_common->state.strokePattern) {
AffineTransform affine;
@@ -653,7 +653,7 @@ void GraphicsContext::fillRect(const FloatRect& rect)
if (shadowPainter) {
drawRepeatPattern(shadowPainter, image, normalizedRect, m_common->state.fillPattern->repeatX(), m_common->state.fillPattern->repeatY());
shadowPainter->setCompositionMode(QPainter::CompositionMode_SourceIn);
- shadowPainter->fillRect(normalizedRect, shadow->color);
+ shadowPainter->fillRect(normalizedRect, shadow->m_color);
shadow->endShadowLayer(p);
}
drawRepeatPattern(p, image, normalizedRect, m_common->state.fillPattern->repeatX(), m_common->state.fillPattern->repeatY());
@@ -664,13 +664,13 @@ void GraphicsContext::fillRect(const FloatRect& rect)
if (shadowPainter) {
shadowPainter->fillRect(normalizedRect, brush);
shadowPainter->setCompositionMode(QPainter::CompositionMode_SourceIn);
- shadowPainter->fillRect(normalizedRect, shadow->color);
+ shadowPainter->fillRect(normalizedRect, shadow->m_color);
shadow->endShadowLayer(p);
}
p->fillRect(normalizedRect, brush);
} else {
if (m_data->hasShadow()) {
- if (shadow->type == ContextShadow::BlurShadow) {
+ if (shadow->m_type == ContextShadow::BlurShadow) {
QPainter* shadowPainter = shadow->beginShadowLayer(p, normalizedRect);
if (shadowPainter) {
shadowPainter->fillRect(normalizedRect, p->brush());
@@ -679,9 +679,9 @@ void GraphicsContext::fillRect(const FloatRect& rect)
} else {
// Solid rectangle fill with no blur shadow can be done faster
// without using the shadow layer at all.
- QColor shadowColor = shadow->color;
+ QColor shadowColor = shadow->m_color;
shadowColor.setAlphaF(shadowColor.alphaF() * p->brush().color().alphaF());
- p->fillRect(normalizedRect.translated(shadow->offset), shadowColor);
+ p->fillRect(normalizedRect.translated(shadow->offset()), shadowColor);
}
}
p->fillRect(normalizedRect, p->brush());
@@ -701,14 +701,14 @@ void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorS
if (m_data->hasShadow()) {
ContextShadow* shadow = contextShadow();
- if (shadow->type != ContextShadow::BlurShadow) {
+ if (shadow->m_type != ContextShadow::BlurShadow) {
// We do not need any layer for simple shadow.
- p->fillRect(normalizedRect.translated(shadow->offset), shadow->color);
+ p->fillRect(normalizedRect.translated(shadow->offset()), shadow->m_color);
} else {
QPainter* shadowPainter = shadow->beginShadowLayer(p, normalizedRect);
if (shadowPainter) {
shadowPainter->setCompositionMode(QPainter::CompositionMode_Source);
- shadowPainter->fillRect(normalizedRect, shadow->color);
+ shadowPainter->fillRect(normalizedRect, shadow->m_color);
shadow->endShadowLayer(p);
}
}
@@ -725,9 +725,9 @@ void GraphicsContext::fillRoundedRect(const IntRect& rect, const IntSize& topLef
Path path = Path::createRoundedRectangle(rect, topLeft, topRight, bottomLeft, bottomRight);
QPainter* p = m_data->p();
if (m_data->hasShadow()) {
- p->translate(m_data->shadow.offset);
- p->fillPath(path.platformPath(), m_data->shadow.color);
- p->translate(-m_data->shadow.offset);
+ p->translate(m_data->shadow.offset());
+ p->fillPath(path.platformPath(), QColor(m_data->shadow.m_color));
+ p->translate(-m_data->shadow.offset());
}
p->fillPath(path.platformPath(), QColor(color));
}
@@ -884,9 +884,9 @@ void GraphicsContext::setPlatformShadow(const FloatSize& size, float blur, const
// Meaning that this graphics context is associated with a CanvasRenderingContext
// We flip the height since CG and HTML5 Canvas have opposite Y axis
m_common->state.shadowOffset = FloatSize(size.width(), -size.height());
- m_data->shadow = ContextShadow(color, blur, size.width(), -size.height());
+ m_data->shadow = ContextShadow(color, blur, FloatSize(size.width(), -size.height()));
} else {
- m_data->shadow = ContextShadow(color, blur, size.width(), size.height());
+ m_data->shadow = ContextShadow(color, blur, FloatSize(size.width(), size.height()));
}
}
@@ -1002,7 +1002,7 @@ void GraphicsContext::setLineDash(const DashArray& dashes, float dashOffset)
pattern.append(dashes[i % dashLength] / penWidth);
pen.setDashPattern(pattern);
- pen.setDashOffset(dashOffset);
+ pen.setDashOffset(dashOffset / penWidth);
} else
pen.setStyle(Qt::SolidLine);
p->setPen(pen);