diff options
-rw-r--r-- | Source/WebCore/platform/graphics/GraphicsContext.cpp | 2 | ||||
-rw-r--r-- | Source/WebCore/platform/graphics/ShadowBlur.cpp | 4 | ||||
-rw-r--r-- | Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp | 31 |
3 files changed, 34 insertions, 3 deletions
diff --git a/Source/WebCore/platform/graphics/GraphicsContext.cpp b/Source/WebCore/platform/graphics/GraphicsContext.cpp index c21173ae2..4ede7da2e 100644 --- a/Source/WebCore/platform/graphics/GraphicsContext.cpp +++ b/Source/WebCore/platform/graphics/GraphicsContext.cpp @@ -671,7 +671,7 @@ void GraphicsContext::fillRoundedRect(const RoundedRect& rect, const Color& colo fillRoundedRect(rect.rect(), rect.radii().topLeft(), rect.radii().topRight(), rect.radii().bottomLeft(), rect.radii().bottomRight(), color, colorSpace); } -#if !USE(CG) +#if !USE(CG) && !PLATFORM(QT) void GraphicsContext::fillRectWithRoundedHole(const IntRect& rect, const RoundedRect& roundedHoleRect, const Color& color, ColorSpace colorSpace) { if (paintingDisabled()) diff --git a/Source/WebCore/platform/graphics/ShadowBlur.cpp b/Source/WebCore/platform/graphics/ShadowBlur.cpp index 335928367..5c92612d2 100644 --- a/Source/WebCore/platform/graphics/ShadowBlur.cpp +++ b/Source/WebCore/platform/graphics/ShadowBlur.cpp @@ -696,9 +696,9 @@ void ShadowBlur::drawInsetShadowWithTiling(GraphicsContext* graphicsContext, con { GraphicsContextStateSaver fillStateSaver(*graphicsContext); - graphicsContext->clearShadow(); graphicsContext->setFillRule(RULE_EVENODD); graphicsContext->setFillColor(m_color, m_colorSpace); + graphicsContext->clearShadow(); graphicsContext->fillPath(exteriorPath); } @@ -772,8 +772,8 @@ void ShadowBlur::drawLayerPieces(GraphicsContext* graphicsContext, const FloatRe } GraphicsContextStateSaver stateSaver(*graphicsContext); - graphicsContext->clearShadow(); graphicsContext->setFillColor(m_color, m_colorSpace); + graphicsContext->clearShadow(); // Note that drawing the ImageBuffer is faster than creating a Image and drawing that, // because ImageBuffer::draw() knows that it doesn't have to copy the image bits. diff --git a/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp index e91c2d287..ec992d648 100644 --- a/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp +++ b/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp @@ -791,6 +791,37 @@ void GraphicsContext::fillRoundedRect(const IntRect& rect, const IntSize& topLef p->fillPath(path.platformPath(), QColor(color)); } +void GraphicsContext::fillRectWithRoundedHole(const IntRect& rect, const RoundedRect& roundedHoleRect, const Color& color, ColorSpace colorSpace) +{ + if (paintingDisabled() || !color.isValid()) + return; + + Path path; + path.addRect(rect); + if (!roundedHoleRect.radii().isZero()) + path.addRoundedRect(roundedHoleRect); + else + path.addRect(roundedHoleRect.rect()); + + QPainterPath platformPath = path.platformPath(); + platformPath.setFillRule(Qt::OddEvenFill); + + QPainter* p = m_data->p(); + if (hasShadow()) { + ShadowBlur* shadow = shadowBlur(); + if (shadow->mustUseShadowBlur(this)) + shadow->drawInsetShadow(this, rect, roundedHoleRect.rect(), roundedHoleRect.radii()); + else { + const QPointF shadowOffset(m_state.shadowOffset.width(), m_state.shadowOffset.height()); + p->translate(shadowOffset); + p->fillPath(platformPath, QColor(m_state.shadowColor)); + p->translate(-shadowOffset); + } + } + + p->fillPath(platformPath, QColor(color)); +} + bool GraphicsContext::isInTransparencyLayer() const { return m_data->layerCount; |