Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fix strokeStyle changes not being applied for successive stroke line …
…operations. https://bugs.webkit.org/show_bug.cgi?id=245465 Reviewed by Darin Adler. The recordStrokeLineWithColorAndThickness optimised path skips serialising the state object, but fails to mark that we've applied the necessary changes. This means that you can then change state back to it's original value, and we won't detect that it changed. * LayoutTests/fast/canvas/canvas-strokePath-strokeStyle-expected.html: Added. * LayoutTests/fast/canvas/canvas-strokePath-strokeStyle.html: Added. * Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::strokePath): Canonical link: https://commits.webkit.org/254889@main
- Loading branch information
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<script> | ||
var canvas = document.createElement('canvas'); | ||
document.body.appendChild(canvas); | ||
var ctx = canvas.getContext('2d'); | ||
|
||
canvas.width = 200; | ||
canvas.height = 200; | ||
|
||
ctx.fillStyle = "#f00"; | ||
ctx.fillRect(0, 0, 100, 200); | ||
|
||
ctx.fillStyle = "#000"; | ||
ctx.fillRect(100, 0, 100, 200); | ||
|
||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<script> | ||
var canvas = document.createElement('canvas'); | ||
document.body.appendChild(canvas); | ||
var ctx = canvas.getContext('2d'); | ||
|
||
canvas.width = 200; | ||
canvas.height = 200; | ||
ctx.lineWidth = 100; | ||
|
||
ctx.clearRect(0, 0, 200, 200); | ||
|
||
// draw red line | ||
ctx.strokeStyle = "#f00"; | ||
ctx.beginPath(); | ||
ctx.moveTo(50, 0); | ||
ctx.lineTo(50, 200); | ||
ctx.stroke(); | ||
|
||
// draw green line | ||
ctx.strokeStyle = "#000"; | ||
ctx.beginPath(); | ||
ctx.moveTo(150, 0); | ||
ctx.lineTo(150, 200); | ||
ctx.stroke(); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters