Changeset 166836 in webkit
- Timestamp:
- Apr 5, 2014 12:57:00 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r166833 r166836 1 2014-04-05 Dirk Schulze <krit@webkit.org> 2 3 Canvas stroke and strokeRect with SourceIn, DestinationIn, SourceOut, DestinationAtop and Copy have errors 4 https://bugs.webkit.org/show_bug.cgi?id=66762 5 6 Reviewed by Andreas Kling. 7 8 330 tests based on canvas-composite-alpha to test correct compositing behavior with 9 strokeRect() and stroke(). 10 11 * fast/canvas/canvas-composite-stroke-alpha-expected.txt: Added. 12 * fast/canvas/canvas-composite-stroke-alpha.html: Added. 13 1 14 2014-04-05 Jeongeun Kim <je_julie.kim@samsung.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r166834 r166836 1 2014-04-05 Dirk Schulze <krit@webkit.org> 2 3 Canvas stroke and strokeRect with SourceIn, DestinationIn, SourceOut, DestinationAtop and Copy have errors 4 https://bugs.webkit.org/show_bug.cgi?id=66762 5 6 Reviewed by Andreas Kling. 7 8 For fill operations we create a new ImageBuffer to ensure that the results are composited 9 correctly according to the Canvas spec. This patch creates a new transparency layer 10 for stroking on certain compositing operators to archive the same. This makes WebKit's 11 behavior interoperable with Firefox and IE as well. 12 13 Test: fast/fast/canvas/canvas-composite-stroke-alpha.html 14 15 * html/canvas/CanvasRenderingContext2D.cpp: 16 (WebCore::CanvasRenderingContext2D::strokeInternal): 17 (WebCore::CanvasRenderingContext2D::strokeRect): 18 1 19 2014-04-05 Yusuke Suzuki <utatane.tea@gmail.com> 2 20 -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r166785 r166836 971 971 972 972 if (!path.isEmpty()) { 973 FloatRect dirtyRect = path.fastBoundingRect(); 974 inflateStrokeRect(dirtyRect); 975 976 c->strokePath(path); 977 didDraw(dirtyRect); 973 if (isFullCanvasCompositeMode(state().m_globalComposite)) { 974 c->beginTransparencyLayer(1); 975 c->strokePath(path); 976 c->endTransparencyLayer(); 977 didDrawEntireCanvas(); 978 } else if (state().m_globalComposite == CompositeCopy) { 979 clearCanvas(); 980 c->strokePath(path); 981 didDrawEntireCanvas(); 982 } else { 983 FloatRect dirtyRect = path.fastBoundingRect(); 984 inflateStrokeRect(dirtyRect); 985 c->strokePath(path); 986 didDraw(dirtyRect); 987 } 978 988 } 979 989 } … … 1148 1158 1149 1159 FloatRect rect(x, y, width, height); 1150 1151 FloatRect boundingRect = rect; 1152 boundingRect.inflate(state().m_lineWidth / 2); 1153 1154 c->strokeRect(rect, state().m_lineWidth); 1155 didDraw(boundingRect); 1160 if (isFullCanvasCompositeMode(state().m_globalComposite)) { 1161 c->beginTransparencyLayer(1); 1162 c->strokeRect(rect, state().m_lineWidth); 1163 c->endTransparencyLayer(); 1164 didDrawEntireCanvas(); 1165 } else if (state().m_globalComposite == CompositeCopy) { 1166 clearCanvas(); 1167 c->strokeRect(rect, state().m_lineWidth); 1168 didDrawEntireCanvas(); 1169 } else { 1170 FloatRect boundingRect = rect; 1171 boundingRect.inflate(state().m_lineWidth / 2); 1172 c->strokeRect(rect, state().m_lineWidth); 1173 didDraw(boundingRect); 1174 } 1156 1175 } 1157 1176
Note: See TracChangeset
for help on using the changeset viewer.