RESOLVED FIXED 218324
REGRESSION(r269065): [GPU Process]: Order of drawing has to be preserved when drawing a canvas to another canvas
https://bugs.webkit.org/show_bug.cgi?id=218324
Summary REGRESSION(r269065): [GPU Process]: Order of drawing has to be preserved when...
Said Abou-Hallawa
Reported 2020-10-28 23:12:53 PDT
When drawing an ImageBuffer to another ImageBuffer, the DrawingContext of the source and the destination ImageBuffers have to be flushed immediately. Otherwise an older version or a newer version of the source ImageBuffer might be drawn to the destination ImageBuffer. Consider this example and assume GPU rendering is enabled for canvas. <script> var canvas1 = document.getElementById('canvas1'); var canvas2 = document.getElementById('canvas2'); var canvas3 = document.getElementById('canvas3'); var ctx3 = canvas3.getContext('2d'); ctx3.fillStyle = 'red'; ctx3.fillRect(0, 0, 100, 100); var ctx1 = canvas1.getContext('2d'); ctx1.drawImage(canvas3, 0, 0); ctx3.fillStyle = 'green'; ctx3.fillRect(0, 0, 100, 100); var ctx2 = canvas2.getContext('2d'); ctx2.drawImage(canvas3, 0, 0); ctx3.fillStyle = 'blue'; ctx3.fillRect(0, 0, 100, 100); </script> 1. If we do not flush any of the canvases after the "drawImage" calls, the first two canvases will not be drawn. This means an older version of canvas3 is drawn to canvas1 and canvas2. 2. If we flush canvas3 after the "drawImage" calls, all the canvases will be filled with blue. This means a newer version of canvas3 is drawn to canvas1 and canvas2.
Attachments
Patch (9.16 KB, patch)
2020-10-28 23:16 PDT, Said Abou-Hallawa
no flags
Said Abou-Hallawa
Comment 1 2020-10-28 23:16:43 PDT
EWS
Comment 2 2020-10-29 11:36:03 PDT
Committed r269159: <https://trac.webkit.org/changeset/269159> All reviewed patches have been landed. Closing bug and clearing flags on attachment 412616 [details].
Radar WebKit Bug Importer
Comment 3 2020-10-29 11:37:17 PDT
Note You need to log in before you can comment on or make changes to this bug.