Changeset 106415 in webkit


Ignore:
Timestamp:
Jan 31, 2012 5:21:32 PM (12 years ago)
Author:
mdelaney@apple.com
Message:

Failing 2d.shadow.enable.off.2.html on Lion
https://bugs.webkit.org/show_bug.cgi?id=77489

Reviewed by Dan Bernstein.

Source/WebCore:

The canvas spec requires that shadows not be drawn under certain
circumstances outlined here: http://www.whatwg.org/specs/web-apps/current-work/#shadows
This patch adds in those checks which allows us to pass now (on Lion)
the philip canvas test that was checking that constraint.

No new tests. Unskipping the test on Lion that this patch fixes.

  • html/canvas/CanvasRenderingContext2D.cpp:

(WebCore::CanvasRenderingContext2D::setAllAttributesToDefault):
(WebCore::CanvasRenderingContext2D::setShadow):
(WebCore::CanvasRenderingContext2D::applyShadow):
(WebCore::CanvasRenderingContext2D::shouldDrawShadows):

  • html/canvas/CanvasRenderingContext2D.h:

(CanvasRenderingContext2D):

LayoutTests:

  • platform/mac-lion/Skipped: We can unskip this test now that this patch has us passing this test.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r106414 r106415  
     12012-01-31  Matthew Delaney  <mdelaney@apple.com>
     2
     3        Failing 2d.shadow.enable.off.2.html on Lion
     4        https://bugs.webkit.org/show_bug.cgi?id=77489
     5
     6        Reviewed by Dan Bernstein.
     7
     8        * platform/mac-lion/Skipped: We can unskip this test now that this patch has us passing this test.
     9
    1102012-01-31  Oliver Hunt  <oliver@apple.com>
    211
  • trunk/LayoutTests/platform/mac-lion/Skipped

    r106310 r106415  
    11# --- Canvas ---
    2 
    3 # <rdar://problem/9121810>
    4 canvas/philip/tests/2d.shadow.enable.off.2.html
    52
    63# This test incorrectly checks the shadow blur's distance and needs to be fixed
  • trunk/Source/WebCore/ChangeLog

    r106411 r106415  
     12012-01-31  Matthew Delaney  <mdelaney@apple.com>
     2
     3        Failing 2d.shadow.enable.off.2.html on Lion
     4        https://bugs.webkit.org/show_bug.cgi?id=77489
     5
     6        Reviewed by Dan Bernstein.
     7
     8        The canvas spec requires that shadows not be drawn under certain
     9        circumstances outlined here: http://www.whatwg.org/specs/web-apps/current-work/#shadows
     10        This patch adds in those checks which allows us to pass now (on Lion)
     11        the philip canvas test that was checking that constraint.
     12
     13        No new tests. Unskipping the test on Lion that this patch fixes.
     14
     15        * html/canvas/CanvasRenderingContext2D.cpp:
     16        (WebCore::CanvasRenderingContext2D::setAllAttributesToDefault):
     17        (WebCore::CanvasRenderingContext2D::setShadow):
     18        (WebCore::CanvasRenderingContext2D::applyShadow):
     19        (WebCore::CanvasRenderingContext2D::shouldDrawShadows):
     20        * html/canvas/CanvasRenderingContext2D.h:
     21        (CanvasRenderingContext2D):
     22
    1232012-01-31  Anders Carlsson  <andersca@apple.com>
    224
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp

    r106247 r106415  
    316316        return;
    317317
    318     context->setLegacyShadow(FloatSize(), 0, Color::transparent, ColorSpaceDeviceRGB);
     318    applyShadow();
    319319    context->setAlpha(1);
    320320    context->setCompositeOperation(CompositeSourceOver);
     
    11511151        return;
    11521152
    1153     c->setLegacyShadow(FloatSize(width, -height), state().m_shadowBlur, state().m_shadowColor, ColorSpaceDeviceRGB);
     1153    applyShadow();
    11541154}
    11551155
     
    11691169        return;
    11701170
    1171     c->setLegacyShadow(FloatSize(width, -height), state().m_shadowBlur, state().m_shadowColor, ColorSpaceDeviceRGB);
     1171    applyShadow();
    11721172}
    11731173
     
    11821182        return;
    11831183
    1184     c->setLegacyShadow(FloatSize(width, -height), state().m_shadowBlur, state().m_shadowColor, ColorSpaceDeviceRGB);
     1184    applyShadow();
    11851185}
    11861186
     
    11951195        return;
    11961196
    1197     c->setLegacyShadow(FloatSize(width, -height), state().m_shadowBlur, state().m_shadowColor, ColorSpaceDeviceRGB);
     1197    applyShadow();
    11981198}
    11991199
     
    12151215    CGColorRelease(shadowColor);
    12161216#else
    1217     dc->setLegacyShadow(FloatSize(width, -height), blur, state().m_shadowColor, ColorSpaceDeviceRGB);
     1217    applyShadow();
    12181218#endif
    12191219}
     
    12331233        return;
    12341234
    1235     float width = state().m_shadowOffset.width();
    1236     float height = state().m_shadowOffset.height();
    1237     c->setLegacyShadow(FloatSize(width, -height), state().m_shadowBlur, state().m_shadowColor, ColorSpaceDeviceRGB);
     1235    if (shouldDrawShadows()) {
     1236        float width = state().m_shadowOffset.width();
     1237        float height = state().m_shadowOffset.height();
     1238        c->setLegacyShadow(FloatSize(width, -height), state().m_shadowBlur, state().m_shadowColor, ColorSpaceDeviceRGB);
     1239    } else
     1240        c->setLegacyShadow(FloatSize(), 0, Color::transparent, ColorSpaceDeviceRGB);
     1241}
     1242
     1243bool CanvasRenderingContext2D::shouldDrawShadows() const
     1244{
     1245    return alphaChannel(state().m_shadowColor) && (state().m_shadowBlur || !state().m_shadowOffset.isZero());
    12381246}
    12391247
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h

    r99349 r106415  
    279279
    280280    void applyShadow();
     281    bool shouldDrawShadows() const;
    281282
    282283    void didDraw(const FloatRect&, unsigned options = CanvasDidDrawApplyAll);
Note: See TracChangeset for help on using the changeset viewer.