Instead of repeatedly using getShadow(), the shadow state handling should be implemented in setPlatformShadow().
Created attachment 64412 [details] Patch
The patch is just the slightly minor version from Patch 1 in https://bugs.webkit.org/show_bug.cgi?id=34479, which I rolled out because it breaks: canvas/philip/tests/2d.shadow.enable.blur.html canvas/philip/tests/2d.shadow.offset.positiveX.html canvas/philip/tests/2d.shadow.offset.positiveY.html fast/canvas/canvas-shadow.html Now the problem is tackled propery. The small diff against the previous is: diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp index a409328..94e6f67 100644 --- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp +++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp @@ -665,7 +665,7 @@ void GraphicsContext::fillRect(const FloatRect& rect) shadowDestRect.translate(m_data->shadowOffset); pShadow->setCompositionMode(QPainter::CompositionMode_Source); - pShadow->fillRect(shadowDestRect, m_data->shadowColor); + pShadow->fillRect(shadowImage->rect(), m_data->shadowColor); pShadow->setCompositionMode(QPainter::CompositionMode_DestinationIn); } @@ -895,7 +895,7 @@ void GraphicsContext::setPlatformShadow(const FloatSize& size, float blur, const // Can't paint the shadow with invalid or invisible color. m_data->shadowType = GraphicsContextPlatformPrivate::NoShadow; } else { - if (blur >= 1) { + if (blur > 0) { // Shadow is always blurred, even the offset is zero. m_data->shadowType = GraphicsContextPlatformPrivate::BlurShadow; } else {
Manually committed r65362: http://trac.webkit.org/changeset/65362