Do not invalidate when using the path both as cached and uncached


Consider the following sequence with QCanvasPath p:

(1) stroke(p, 123)
(2) stroke(p, -1)
(3) stroke(p, 123)

Call (3) could just use the cached data (1) generates. Yet currently the
in-between call with group -1 triggers an update of the geometry in
call (3), for no good reason.

To remedy this, try not to mix the the handling of uncached (group ==
-1) and cached paths together. QCCachedPath and
ctx.cachedStroke/FillPaths should be reserved for cached paths, and not
touched in any way when the path group is -1.

Rather, store the command count and generation for the uncached case in
the QCContext, handling them the same way as preparedPath and
preparedPathTransform.

Pick-to: 6.11
Change-Id: I96185b6569507807df7c3678954bc177759f13af
Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
commitab2c24aadaeff70e3d95c68a16c730d124b89d40
parente3c5dd657989174a6e974903a339f8f40f263061
authorLaszlo Agocs <laszlo.agocs@qt.io>
committerLaszlo Agocs <laszlo.agocs@qt.io>
commit timeThu, 23 Apr 2026 08:00:46 +0000