diff options
Diffstat (limited to 'Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
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; |