fix(qbz-qt): rasterize every Canvas on the GUI thread
The owner hit a segfault after clicking around. Cooperative and Threaded rasterize on the scene-graph RENDER thread, and RoundedImage is instantiated in 25 files — every card, row and queue row — so list recycling creates and destroys hundreds of these while async artwork callbacks schedule repaints on them. The render thread can be mid-draw on a pixmap whose Canvas is already gone. The ambient field makes it worse by repainting 30 times a second for the whole window lifetime on that same thread. Immediate keeps paint and destruction on one thread. renderTarget: Image already meant CPU raster, so nothing looks different. Not yet confirmed on hardware: the decisive check is running the previous binary with QSG_RENDER_LOOP=basic, which gives Cooperative no separate thread to race with. If that survives the repro and the default loop does not, this is the cause. cc
This commit is contained in:
3 files changed
+15
-3
No files matched your search
@@ -135,7 +135,10 @@ Item {
|
|||||||
id: canvas
|
id: canvas
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
renderTarget: Canvas.Image
|
renderTarget: Canvas.Image
|
||||||
renderStrategy: Canvas.Cooperative
|
// See RoundedImage.qml: GUI-thread raster. This canvas repaints from
|
||||||
|
// libraryArtworkReady and from four async image probes, on a card the
|
||||||
|
// feed recycles.
|
||||||
|
renderStrategy: Canvas.Immediate
|
||||||
|
|
||||||
// Dimension probes: Canvas cannot query a loaded image's intrinsic
|
// Dimension probes: Canvas cannot query a loaded image's intrinsic
|
||||||
// size and the crop fit needs it (RoundedImage's pattern, one per
|
// size and the crop fit needs it (RoundedImage's pattern, one per
|
||||||
|
|||||||
@@ -45,7 +45,10 @@ Canvas {
|
|||||||
: true
|
: true
|
||||||
|
|
||||||
renderTarget: Canvas.Image
|
renderTarget: Canvas.Image
|
||||||
renderStrategy: Canvas.Cooperative
|
// See RoundedImage.qml. This one repaints 30x/s for the whole window
|
||||||
|
// lifetime, so it is the canvas most likely to be mid-raster when another
|
||||||
|
// is torn down on the same render thread.
|
||||||
|
renderStrategy: Canvas.Immediate
|
||||||
|
|
||||||
// The shader clock (t = time * 0.75). Accumulated at ~30fps.
|
// The shader clock (t = time * 0.75). Accumulated at ~30fps.
|
||||||
property real t: Math.random() * 40.0
|
property real t: Math.random() * 40.0
|
||||||
|
|||||||
@@ -25,7 +25,13 @@ Canvas {
|
|||||||
property string fit: "crop"
|
property string fit: "crop"
|
||||||
|
|
||||||
renderTarget: Canvas.Image
|
renderTarget: Canvas.Image
|
||||||
renderStrategy: Canvas.Cooperative
|
// GUI-thread raster. Cooperative/Threaded rasterize on the SCENE GRAPH
|
||||||
|
// RENDER THREAD, and this item is created and destroyed by list recycling
|
||||||
|
// while async artwork callbacks schedule repaints — the render thread can
|
||||||
|
// be mid-draw on a pixmap whose Canvas is already gone. Immediate keeps
|
||||||
|
// paint and destruction on one thread. renderTarget: Image already meant
|
||||||
|
// CPU raster, so this costs no visual change.
|
||||||
|
renderStrategy: Canvas.Immediate
|
||||||
|
|
||||||
// Dimension probe: Canvas can't query the loaded image's intrinsic
|
// Dimension probe: Canvas can't query the loaded image's intrinsic
|
||||||
// size, and PreserveAspectCrop needs it. A hidden Image doubles as
|
// size, and PreserveAspectCrop needs it. A hidden Image doubles as
|
||||||
|
|||||||
Reference in new issue
Block a user