Boundbox on curves is somewhat unstable.
If some code outside the depsgraph evaluation context marks an object
as having the BoundDox dirty, the boundbox will go wrong until the
modifiers are evaluated again.
And that's what happens in the drawing loop (`DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN`).
The same curve type object appears twice in `DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN`:
- the first time the `object->data` is the curve data
- the second time the `object->data` is temporarily replaced by a mesh that has been evaluated
During this temporary replacement, the boundbox is marked as being dirty.
In the example shown in T94078, we see that the boundbox read by the
overlay engine gets wrong after the viewport is updated.
NOTE: boundbox is always required by some engines in order to detect occlusion. Marking a boundbox as dirty during the drawing loop can be bad for performance.
**Solution**
The solution proposed in this patch is to change the boundbox reference of the temporary objects,
so the boundbox of the non-temporary object (with the data curve) is not marked dirty.
An ideal solution might be to add a "boundbox" member to the Mesh struct.
Or replace by default the `ob->data` of the evaluated object by the final
mesh with modifiers.
NOTE: The same object can be represented in different ways. An object of mesh type for example has 4 different meshes (mesh, mesh->edit_mesh->bm, mesh->edit_mesh->mesh_eval_final, mesh->edit_mesh->mesh_eval_cage). This can complicate a bit when choosing the boundbox for the object.
Ref T94078