Changeset 150370 in webkit


Ignore:
Timestamp:
May 20, 2013 9:39:30 AM (11 years ago)
Author:
Martin Robinson
Message:

[Cairo] Canvas-shadow behavior is not being as expected
https://bugs.webkit.org/show_bug.cgi?id=108897

Patch by Rashmi Shyamasundar <rashmi.s2@samsung.com> on 2013-05-18
Reviewed by Martin Robinson.

Source/WebCore:

ShadowBlur::endShadowLayer copies the image from shadowContext to cairoContext.
CairoContext-path should be empty for doing this copy. Otherwise, the
original-image area will also get filled with the shadow.

Test: fast/canvas/canvas-image-shadow.html

  • platform/graphics/cairo/GraphicsContextCairo.cpp:

(WebCore::drawPathShadow):

LayoutTests:

Test to verify the shadow of an image drawn on canvas.
This test uses an image whose size is smaller than,
the size of the rectangle which should be filled with the image.

  • fast/canvas/canvas-image-shadow-expected.txt: Added.
  • fast/canvas/canvas-image-shadow.html: Added.
  • fast/canvas/script-tests/canvas-image-shadow.js: Added.

(draw):

Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r150368 r150370  
     12013-05-18  Rashmi Shyamasundar  <rashmi.s2@samsung.com>
     2
     3        [Cairo] Canvas-shadow behavior is not being as expected
     4        https://bugs.webkit.org/show_bug.cgi?id=108897
     5
     6        Reviewed by Martin Robinson.
     7
     8        Test to verify the shadow of an image drawn on canvas.
     9        This test uses an image whose size is smaller than,
     10        the size of the rectangle which should be filled with the image.
     11
     12        * fast/canvas/canvas-image-shadow-expected.txt: Added.
     13        * fast/canvas/canvas-image-shadow.html: Added.
     14        * fast/canvas/script-tests/canvas-image-shadow.js: Added.
     15        (draw):
     16
    1172013-05-20  Christophe Dumez  <ch.dumez@sisa.samsung.com>
    218
  • trunk/Source/WebCore/ChangeLog

    r150366 r150370  
     12013-05-18  Rashmi Shyamasundar  <rashmi.s2@samsung.com>
     2
     3        [Cairo] Canvas-shadow behavior is not being as expected
     4        https://bugs.webkit.org/show_bug.cgi?id=108897
     5
     6        Reviewed by Martin Robinson.
     7
     8        ShadowBlur::endShadowLayer copies the image from shadowContext to cairoContext.
     9        CairoContext-path should be empty for doing this copy. Otherwise, the
     10        original-image area will also get filled with the shadow.
     11
     12        Test: fast/canvas/canvas-image-shadow.html
     13
     14        * platform/graphics/cairo/GraphicsContextCairo.cpp:
     15        (WebCore::drawPathShadow):
     16
    1172013-05-20  Lamarque V. Souza  <Lamarque.Souza@basyskom.com>
    218
  • trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp

    r149566 r150370  
    142142    }
    143143
     144    // The original path may still be hanging around on the context and endShadowLayer
     145    // will take care of properly creating a path to draw the result shadow. We remove the path
     146    // temporarily and then restore it.
     147    // See: https://bugs.webkit.org/show_bug.cgi?id=108897
     148    cairo_new_path(cairoContext);
    144149    shadow.endShadowLayer(context);
    145 
    146     // ShadowBlur::endShadowLayer destroys the current path on the Cairo context. We restore it here.
    147     cairo_new_path(cairoContext);
    148150    cairo_append_path(cairoContext, path.get());
    149151}
Note: See TracChangeset for help on using the changeset viewer.