Changeset 64407 in webkit
- Timestamp:
- Jul 30, 2010 10:08:15 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r64405 r64407 1 2010-07-30 Matthew Delaney <mdelaney@apple.com> 2 3 Reviewed by Darin Adler. 4 5 ctx.clearRect improperly clears shadow 6 https://bugs.webkit.org/show_bug.cgi?id=43213 7 8 * canvas/philip/tests/2d.clearRect+fillRect.alpha0-expected.txt: Added. 9 * canvas/philip/tests/2d.clearRect+fillRect.alpha0.5-expected.txt: Added. 10 * canvas/philip/tests/2d.clearRect+fillRect.alpha0.5.html: Added. 11 Same as above but with alpha of one half. 12 * canvas/philip/tests/2d.clearRect+fillRect.alpha0.html: Added. 13 Tests that clearing rect with alpha or 0 has no unwanted side-effects 14 * canvas/philip/tests/2d.clearRect+fillRect.basic-expected.txt: Added. 15 * canvas/philip/tests/2d.clearRect+fillRect.basic.html: Added. 16 Tests clearing a rect and then filling back over doesn't show any 17 side effects (such as caused by not ignoring/restoring appropriate 18 context attributes). 19 * platform/mac/Skipped: unskipping now passing test 20 1 21 2010-07-30 Luiz Agostini <luiz.agostini@openbossa.org> 2 22 -
trunk/LayoutTests/platform/mac/Skipped
r64401 r64407 166 166 canvas/philip/tests/2d.drawImage.broken.html 167 167 canvas/philip/tests/2d.path.clip.empty.html 168 canvas/philip/tests/2d.clearRect.shadow.html169 168 canvas/philip/tests/2d.composite.operation.clear.html 170 169 canvas/philip/tests/2d.composite.operation.darker.html -
trunk/WebCore/ChangeLog
r64406 r64407 1 2010-07-30 Matthew Delaney <mdelaney@apple.com> 2 3 Reviewed by Darin Adler. 4 5 ctx.clearRect improperly clears shadow 6 https://bugs.webkit.org/show_bug.cgi?id=43213 7 8 Tests: canvas/philip/tests/2d.clearRect+fillRect.alpha0.5.html 9 canvas/philip/tests/2d.clearRect+fillRect.alpha0.html 10 canvas/philip/tests/2d.clearRect+fillRect.basic.html 11 12 * html/canvas/CanvasRenderingContext2D.cpp: 13 (WebCore::CanvasRenderingContext2D::setAllAttributesToDefault): 14 Added a new method to wipe out all context attributes to their defaults. 15 (WebCore::CanvasRenderingContext2D::clearRect): 16 Updated clearRect to ignore shadow, alpha, and global composite attributes 17 when clearing the input rect to match the canvas spec. 18 * html/canvas/CanvasRenderingContext2D.h: 19 1 20 2010-07-30 Kinuko Yasuda <kinuko@chromium.org> 2 21 -
trunk/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r64004 r64407 165 165 } 166 166 167 void CanvasRenderingContext2D::setAllAttributesToDefault() 168 { 169 state().m_globalAlpha = 1; 170 state().m_shadowOffset = FloatSize(); 171 state().m_shadowBlur = 0; 172 state().m_shadowColor = Color::transparent; 173 state().m_globalComposite = CompositeSourceOver; 174 175 GraphicsContext* context = drawingContext(); 176 if (!context) 177 return; 178 179 context->setShadow(FloatSize(), 0, Color::transparent, DeviceColorSpace); 180 context->setAlpha(1); 181 context->setCompositeOperation(CompositeSourceOver); 182 } 183 167 184 CanvasStyle* CanvasRenderingContext2D::strokeStyle() const 168 185 { … … 791 808 if (!validateRectForCanvas(x, y, width, height)) 792 809 return; 793 GraphicsContext* c = drawingContext();794 if (!c )810 GraphicsContext* context = drawingContext(); 811 if (!context) 795 812 return; 796 813 if (!state().m_invertibleCTM) 797 814 return; 798 815 FloatRect rect(x, y, width, height); 816 817 save(); 818 setAllAttributesToDefault(); 799 819 willDraw(rect); 800 c->clearRect(rect); 820 context->clearRect(rect); 821 restore(); 801 822 } 802 823 -
trunk/WebCore/html/canvas/CanvasRenderingContext2D.h
r64004 r64407 105 105 void save(); 106 106 void restore(); 107 void setAllAttributesToDefault(); 107 108 108 109 void scale(float sx, float sy);
Note: See TracChangeset
for help on using the changeset viewer.