[Webkit-unassigned] [Bug 68899] New: [CG] Both ShadowBlur and CG Shadow are applied to the rect in GraphicsContext::fillRect()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 27 06:41:02 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=68899

           Summary: [CG] Both ShadowBlur and CG Shadow are applied to the
                    rect in GraphicsContext::fillRect()
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: SVG
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: reni at webkit.org
                CC: eric at webkit.org, zimmermann at kde.org, krit at webkit.org,
                    zherczeg at webkit.org, leviw at chromium.org,
                    timothy_horton at apple.com


Original code:

    bool drawOwnShadow = !isAcceleratedContext() && hasBlurredShadow(m_state) && !m_state.shadowsIgnoreTransforms; // Don't use ShadowBlur for canvas yet.
    if (drawOwnShadow) {
        float shadowBlur = m_state.shadowsUseLegacyRadius ? radiusToLegacyRadius(m_state.shadowBlur) : m_state.shadowBlur;
        // Turn off CG shadows.
        CGContextSaveGState(context);
        CGContextSetShadowWithColor(context, CGSizeZero, 0, 0);

        ShadowBlur contextShadow(FloatSize(shadowBlur, shadowBlur), m_state.shadowOffset, m_state.shadowColor, m_state.shadowColorSpace);
        contextShadow.drawRectShadow(this, rect, RoundedRect::Radii());
    }

    CGContextFillRect(context, rect);


After some debugging it seems that the shadow applied twice both with ShadowBlur and CGShadow.
We halved the rectangle to emphasize this effect:

    // Was CGContextFillRect(context, rect);
    FloatRect tmp2 = FloatRect(rect.x() + rect.width() / 4, rect.y() + rect.height() / 4, rect.width() / 2, rect.height() / 2);
    CGContextFillRect(context, tmp2);

We attached two pics. In without_contextShadow.png the drawRectShadow was commented out while it was enabled on with_contextShadow.png.
The strange thing was the shadow is still drawn when the drawRectShadow was commented out.
Any idea?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list