From e54a6126cef33a2345127ddee6f633ac57f63b5e Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 17 Nov 2014 14:57:39 +0100 Subject: Don't fill with invalid fill color WebInspector may set a default invalid fill color to disable fill, we shouldn't fill with black in this case. Change-Id: Ida1eaf187aca7fbca27449a9829c452f99634558 Reviewed-by: Andras Becsi --- Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp index da02416d5..4cbf17a24 100644 --- a/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp +++ b/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp @@ -660,6 +660,9 @@ void GraphicsContext::fillPath(const Path& path) if (paintingDisabled()) return; + if (!(m_state.fillPattern || m_state.fillGradient || m_state.fillColor.isValid())) + return; + QPainter* p = m_data->p(); QPainterPath platformPath = path.platformPath(); platformPath.setFillRule(toQtFillRule(fillRule())); @@ -824,6 +827,9 @@ void GraphicsContext::fillRect(const FloatRect& rect) if (paintingDisabled()) return; + if (!(m_state.fillPattern || m_state.fillGradient || m_state.fillColor.isValid())) + return; + QPainter* p = m_data->p(); QRectF normalizedRect = rect.normalized(); -- cgit v1.2.3