Changeset 87307 in webkit
- Timestamp:
- May 25, 2011 11:45:56 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r87306 r87307 1 2011-05-25 Julien Chaffraix <jchaffraix@codeaurora.org> 2 3 Reviewed by James Robinson. 4 5 http://philip.html5.org/tests/canvas/suite/tests/2d.composite.uncovered.fill.source-in.html fails 6 https://bugs.webkit.org/show_bug.cgi?id=39027 7 8 And: 9 10 - Fix LayoutTests/canvas/philip/tests/2d.composite.uncovered.fill.source-out.html 11 https://bugs.webkit.org/show_bug.cgi?id=48295 12 13 - Fix LayoutTests/canvas/philip/tests/2d.composite.uncovered.pattern.source-in.html 14 https://bugs.webkit.org/show_bug.cgi?id=48304 15 16 - Fix LayoutTests/canvas/philip/tests/2d.composite.uncovered.pattern.source-out.html 17 https://bugs.webkit.org/show_bug.cgi?id=48305 18 19 * canvas/philip/tests/2d.composite.uncovered.pattern.source-in-expected.txt: 20 * canvas/philip/tests/2d.composite.uncovered.pattern.source-out-expected.txt: 21 Those 2 tests need a trailing line that was added as part of this change. 22 23 * fast/canvas/canvas-composite-alpha.html: Updated the test result to match the specification. 24 The changes are fairly simple: 25 - Clear up the destination rectangle as it should be always transparent now (source is transparent 26 outside the source rectangle). 27 - Clear the composition rectangle if source or destination is transparent. 28 - Fixed the test when run in the browser. 29 Validated the changes against FF and Opera (IE 9 cannot render this test). 30 31 * platform/chromium/test_expectations.txt: 32 * platform/gtk/Skipped: 33 * platform/mac/Skipped: 34 * platform/qt/Skipped: 35 Re-enable 4 tests. 36 1 37 2011-05-20 Robert Hogan <robert@webkit.org> 2 38 -
trunk/LayoutTests/canvas/philip/tests/2d.composite.uncovered.pattern.source-in-expected.txt
r71481 r87307 1 1 Passed 2 -
trunk/LayoutTests/canvas/philip/tests/2d.composite.uncovered.pattern.source-out-expected.txt
r71481 r87307 1 1 Passed 2 -
trunk/LayoutTests/fast/canvas/canvas-composite-alpha.html
r44041 r87307 50 50 ], 51 51 [ 52 { source: [0, 0, 0, 0], composition: [255, 0, 0, 255], destination: [0, 255, 0, 255] },53 { source: [0, 0, 0, 0], composition: [0, 0, 0, 0], destination: [0, 0, 0, 0] }, 54 { source: [0, 0, 0, 0], composition: [ 255, 0, 0, 1], destination: [0, 255, 0, 1] },55 { source: [0, 0, 0, 0], composition: [0, 0, 0, 0], destination: [ 255, 0, 0, 255] },56 { source: [0, 0, 0, 0], composition: [0, 255, 0, 1], destination: [255, 0, 0, 255] },57 { source: [0, 0, 0, 0], composition: [0, 0, 0, 0], destination: [0, 255, 0, 255] },58 { source: [0, 0, 0, 0], composition: [255, 0, 0, 64], destination: [0, 255, 0, 127] },59 { source: [0, 0, 0, 0], composition: [255, 0, 0, 127], destination: [0, 255, 0, 127] },60 { source: [0, 0, 0, 0], composition: [255, 0, 0, 127], destination: [0, 255, 0, 255] },61 { source: [0, 0, 0, 0], composition: [128, 0, 0, 127], destination: [0, 126, 0, 127] },62 { source: [0, 0, 0, 0], composition: [126, 0, 0, 127], destination: [0, 127, 0, 255] },63 { source: [0, 0, 0, 0], composition: [255, 0, 0, 32], destination: [ 255, 0, 0, 63] },64 { source: [0, 0, 0, 0], composition: [255, 127, 0, 8], destination: [ 255, 64, 0, 63] },65 { source: [0, 0, 0, 0], composition: [255, 0, 0, 96], destination: [0, 255, 0, 127] },66 { source: [0, 0, 0, 0], composition: [255, 0, 255, 96], destination: [0, 255, 255, 127] }67 ], 68 [ 69 { source: [255, 0, 0, 255], composition: [0, 0, 0, 0], destination: [0, 255, 0, 255] },70 { source: [255, 0, 0, 255], composition: [255, 0, 0, 255], destination: [0, 0, 0, 0] }, 71 { source: [255, 0, 0, 255], composition: [255, 0, 0, 254], destination: [0, 255, 0, 1] },72 { source: [0, 0, 0, 0], composition: [0, 0, 0, 0], destination: [ 255, 0, 0, 255] },73 { source: [0, 255, 0, 1], composition: [0, 0, 0, 0], destination: [ 255, 0, 0, 255] },74 { source: [0, 0, 0, 0], composition: [0, 0, 0, 0], destination: [0, 255, 0, 255] },75 { source: [255, 0, 0, 127], composition: [255, 0, 0, 64], destination: [0, 255, 0, 127] },76 { source: [255, 0, 0, 255], composition: [255, 0, 0, 128], destination: [0, 255, 0, 127] },77 { source: [255, 0, 0, 127], composition: [0, 0, 0, 0], destination: [0, 255, 0, 255] },78 { source: [127, 0, 0, 255], composition: [127, 0, 0, 128], destination: [0, 126, 0, 127] },79 { source: [126, 0, 0, 127], composition: [0, 0, 0, 0], destination: [0, 127, 0, 255] },80 { source: [255, 0, 0, 127], composition: [255, 0, 0, 96], destination: [ 255, 0, 0, 63] },81 { source: [255, 127, 0, 32], composition: [255, 132, 0, 25], destination: [ 255, 64, 0, 63] },82 { source: [255, 0, 0, 191], composition: [255, 0, 0, 96], destination: [0, 255, 0, 127] },83 { source: [255, 0, 255, 191], composition: [255, 0, 255, 96], destination: [0, 255, 255, 127] }52 { source: [0, 0, 0, 0], composition: [255, 0, 0, 255], destination: [0, 0, 0, 0] }, 53 { source: [0, 0, 0, 0], composition: [0, 0, 0, 0], destination: [0, 0, 0, 0] }, 54 { source: [0, 0, 0, 0], composition: [0, 0, 0, 0], destination: [0, 0, 0, 0] }, 55 { source: [0, 0, 0, 0], composition: [0, 0, 0, 0], destination: [0, 0, 0, 0] }, 56 { source: [0, 0, 0, 0], composition: [0, 0, 0, 0], destination: [0, 0, 0, 0] }, 57 { source: [0, 0, 0, 0], composition: [0, 0, 0, 0], destination: [0, 0, 0, 0] }, 58 { source: [0, 0, 0, 0], composition: [255, 0, 0, 64], destination: [0, 0, 0, 0] }, 59 { source: [0, 0, 0, 0], composition: [255, 0, 0, 127], destination: [0, 0, 0, 0] }, 60 { source: [0, 0, 0, 0], composition: [255, 0, 0, 127], destination: [0, 0, 0, 0] }, 61 { source: [0, 0, 0, 0], composition: [128, 0, 0, 127], destination: [0, 0, 0, 0] }, 62 { source: [0, 0, 0, 0], composition: [126, 0, 0, 127], destination: [0, 0, 0, 0] }, 63 { source: [0, 0, 0, 0], composition: [255, 0, 0, 32], destination: [0, 0, 0, 0] }, 64 { source: [0, 0, 0, 0], composition: [255, 127, 0, 8], destination: [0, 0, 0, 0] }, 65 { source: [0, 0, 0, 0], composition: [255, 0, 0, 96], destination: [0, 0, 0, 0] }, 66 { source: [0, 0, 0, 0], composition: [255, 0, 255, 96], destination: [0, 0, 0, 0] } 67 ], 68 [ 69 { source: [255, 0, 0, 255], composition: [0, 0, 0, 0], destination: [0, 0, 0, 0] }, 70 { source: [255, 0, 0, 255], composition: [255, 0, 0, 255], destination: [0, 0, 0, 0] }, 71 { source: [255, 0, 0, 255], composition: [255, 0, 0, 254], destination: [0, 0, 0, 0] }, 72 { source: [0, 0, 0, 0], composition: [0, 0, 0, 0], destination: [0, 0, 0, 0] }, 73 { source: [0, 255, 0, 1], composition: [0, 0, 0, 0], destination: [0, 0, 0, 0] }, 74 { source: [0, 0, 0, 0], composition: [0, 0, 0, 0], destination: [0, 0, 0, 0] }, 75 { source: [255, 0, 0, 127], composition: [255, 0, 0, 64], destination: [0, 0, 0, 0] }, 76 { source: [255, 0, 0, 255], composition: [255, 0, 0, 128], destination: [0, 0, 0, 0] }, 77 { source: [255, 0, 0, 127], composition: [0, 0, 0, 0], destination: [0, 0, 0, 0] }, 78 { source: [127, 0, 0, 255], composition: [127, 0, 0, 128], destination: [0, 0, 0, 0] }, 79 { source: [126, 0, 0, 127], composition: [0, 0, 0, 0], destination: [0, 0, 0, 0] }, 80 { source: [255, 0, 0, 127], composition: [255, 0, 0, 96], destination: [0, 0, 0, 0] }, 81 { source: [255, 127, 0, 32], composition: [255, 132, 0, 25], destination: [0, 0, 0, 0] }, 82 { source: [255, 0, 0, 191], composition: [255, 0, 0, 96], destination: [0, 0, 0, 0] }, 83 { source: [255, 0, 255, 191], composition: [255, 0, 255, 96], destination: [0, 0, 0, 0] } 84 84 ], 85 85 [ … … 434 434 drawTable(useFillRect); 435 435 drawTable(usePathAndFill); 436 layoutTestController.notifyDone(); 436 if (window.layoutTestController) 437 layoutTestController.notifyDone(); 437 438 } 438 439 </script> -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r87306 r87307 2005 2005 BUGWK39177 : canvas/philip/tests/2d.composite.uncovered.fill.destination-atop.html = TEXT 2006 2006 BUGWK39177 : canvas/philip/tests/2d.composite.uncovered.fill.destination-in.html = TEXT 2007 BUGWK39177 : canvas/philip/tests/2d.composite.uncovered.fill.source-in.html = TEXT2008 BUGWK39177 : canvas/philip/tests/2d.composite.uncovered.fill.source-out.html = TEXT2009 2007 BUGWK39177 : canvas/philip/tests/2d.composite.uncovered.image.copy.html = TEXT 2010 2008 BUGWK39177 : canvas/philip/tests/2d.composite.uncovered.image.destination-atop.html = TEXT … … 2015 2013 BUGWK39177 : canvas/philip/tests/2d.composite.uncovered.pattern.destination-atop.html = TEXT 2016 2014 BUGWK39177 : canvas/philip/tests/2d.composite.uncovered.pattern.destination-in.html = TEXT 2017 BUGWK39177 : canvas/philip/tests/2d.composite.uncovered.pattern.source-in.html = TEXT2018 BUGWK39177 : canvas/philip/tests/2d.composite.uncovered.pattern.source-out.html = TEXT2019 2015 BUGWK39168 : canvas/philip/tests/2d.fillStyle.parse.system.html = TEXT 2020 2016 BUGWK45991 : canvas/philip/tests/2d.pattern.image.undefined.html = TEXT -
trunk/LayoutTests/platform/gtk/Skipped
r87306 r87307 1002 1002 canvas/philip/tests/2d.composite.uncovered.fill.destination-atop.html 1003 1003 canvas/philip/tests/2d.composite.uncovered.fill.destination-in.html 1004 canvas/philip/tests/2d.composite.uncovered.fill.source-in.html1005 canvas/philip/tests/2d.composite.uncovered.fill.source-out.html1006 1004 canvas/philip/tests/2d.composite.uncovered.image.copy.html 1007 1005 canvas/philip/tests/2d.composite.uncovered.image.destination-atop.html … … 1012 1010 canvas/philip/tests/2d.composite.uncovered.pattern.destination-atop.html 1013 1011 canvas/philip/tests/2d.composite.uncovered.pattern.destination-in.html 1014 canvas/philip/tests/2d.composite.uncovered.pattern.source-in.html1015 canvas/philip/tests/2d.composite.uncovered.pattern.source-out.html1016 1012 canvas/philip/tests/2d.drawImage.broken.html 1017 1013 canvas/philip/tests/2d.imageData.create1.type.html -
trunk/LayoutTests/platform/mac/Skipped
r87274 r87307 158 158 canvas/philip/tests/2d.composite.uncovered.fill.destination-atop.html 159 159 canvas/philip/tests/2d.composite.uncovered.fill.destination-in.html 160 canvas/philip/tests/2d.composite.uncovered.fill.source-in.html161 canvas/philip/tests/2d.composite.uncovered.fill.source-out.html162 160 canvas/philip/tests/2d.composite.uncovered.image.copy.html 163 161 canvas/philip/tests/2d.composite.uncovered.image.destination-atop.html … … 168 166 canvas/philip/tests/2d.composite.uncovered.pattern.destination-atop.html 169 167 canvas/philip/tests/2d.composite.uncovered.pattern.destination-in.html 170 canvas/philip/tests/2d.composite.uncovered.pattern.source-in.html171 canvas/philip/tests/2d.composite.uncovered.pattern.source-out.html172 168 canvas/philip/tests/2d.imageData.object.round.html 173 169 canvas/philip/tests/2d.imageData.object.wrap.html -
trunk/LayoutTests/platform/qt/Skipped
r87306 r87307 1821 1821 canvas/philip/tests/2d.composite.uncovered.fill.destination-atop.html 1822 1822 canvas/philip/tests/2d.composite.uncovered.fill.destination-in.html 1823 canvas/philip/tests/2d.composite.uncovered.fill.source-in.html1824 canvas/philip/tests/2d.composite.uncovered.fill.source-out.html1825 1823 canvas/philip/tests/2d.composite.uncovered.image.copy.html 1826 1824 canvas/philip/tests/2d.composite.uncovered.image.destination-atop.html … … 1831 1829 canvas/philip/tests/2d.composite.uncovered.pattern.destination-atop.html 1832 1830 canvas/philip/tests/2d.composite.uncovered.pattern.destination-in.html 1833 canvas/philip/tests/2d.composite.uncovered.pattern.source-in.html1834 canvas/philip/tests/2d.composite.uncovered.pattern.source-out.html1835 1831 canvas/philip/tests/2d.drawImage.broken.html 1836 1832 canvas/philip/tests/2d.gradient.radial.cone.behind.html -
trunk/Source/WebCore/ChangeLog
r87303 r87307 1 2011-05-25 Julien Chaffraix <jchaffraix@codeaurora.org> 2 3 Reviewed by James Robinson. 4 5 http://philip.html5.org/tests/canvas/suite/tests/2d.composite.uncovered.fill.source-in.html fails 6 https://bugs.webkit.org/show_bug.cgi?id=39027 7 8 And: 9 10 - Fix LayoutTests/canvas/philip/tests/2d.composite.uncovered.fill.source-out.html 11 https://bugs.webkit.org/show_bug.cgi?id=48295 12 13 - Fix LayoutTests/canvas/philip/tests/2d.composite.uncovered.pattern.source-in.html 14 https://bugs.webkit.org/show_bug.cgi?id=48304 15 16 - Fix LayoutTests/canvas/philip/tests/2d.composite.uncovered.pattern.source-out.html 17 https://bugs.webkit.org/show_bug.cgi?id=48305 18 19 Those 4 tests have the same root cause for failing. Instead of splitting them in 2 fixes, I squashed 20 them together as the fix is common. 21 22 Based on an older work by Ariya Hidayat. 23 24 * html/canvas/CanvasRenderingContext2D.cpp: 25 (WebCore::CanvasRenderingContext2D::fill): 26 (WebCore::CanvasRenderingContext2D::fillRect): Added call displayTransparencyEverywhere for those 2 27 cases if we have to. 28 29 (WebCore::CanvasRenderingContext2D::shouldDisplayTransparencyEverywhere): This method returns true if 30 the spec says to display transparency everywhere. We only do so for source-in and source-out for now. 31 (WebCore::CanvasRenderingContext2D::displayTransparencyEverywhere): This method implements the spec 32 (which matches other browsers' behavior) and "display transparency elsewhere". 33 34 * html/canvas/CanvasRenderingContext2D.h: Added the two previous methods. 35 1 36 2011-05-25 Levi Weintraub <leviw@chromium.org> 2 37 -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r87171 r87307 941 941 942 942 if (!m_path.isEmpty()) { 943 if (shouldDisplayTransparencyElsewhere()) 944 displayTransparencyElsewhere<Path>(m_path); 945 943 946 c->fillPath(m_path); 944 947 didDraw(m_path.boundingRect()); … … 1045 1048 FloatRect rect(x, y, width, height); 1046 1049 1050 if (shouldDisplayTransparencyElsewhere()) 1051 displayTransparencyElsewhere<IntRect>(enclosingIntRect(rect)); 1052 1047 1053 c->fillRect(rect); 1048 1054 didDraw(rect); … … 1489 1495 { 1490 1496 setGlobalCompositeOperation(operation); 1497 } 1498 1499 bool CanvasRenderingContext2D::shouldDisplayTransparencyElsewhere() const 1500 { 1501 // See 4.8.11.1.3 Compositing 1502 // CompositeSourceAtop is not listed here as the platforms already implement the specification's behavior. 1503 return state().m_globalComposite == CompositeSourceIn || state().m_globalComposite == CompositeSourceOut; 1504 } 1505 1506 template<class T> void CanvasRenderingContext2D::displayTransparencyElsewhere(const T& area) 1507 { 1508 ASSERT(shouldDisplayTransparencyElsewhere()); 1509 1510 FloatRect canvasRect(0, 0, canvas()->width(), canvas()->height()); 1511 canvasRect = state().m_transform.inverse().mapRect(canvasRect); 1512 1513 GraphicsContext* c = drawingContext(); 1514 c->save(); 1515 c->clipOut(area); 1516 c->setCompositeOperation(CompositeClear); 1517 c->fillRect(canvasRect); 1518 c->restore(); 1491 1519 } 1492 1520 -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h
r85501 r87307 293 293 #endif 294 294 295 bool shouldDisplayTransparencyElsewhere() const; 296 template<class T> void displayTransparencyElsewhere(const T& area); 297 295 298 void prepareGradientForDashboard(CanvasGradient* gradient) const; 296 299
Note: See TracChangeset
for help on using the changeset viewer.