~vanvugt/mir/frontend-server

« back to all changes in this revision

Viewing changes to examples/render_overlays.cpp

Fix thread-safety of Renderable::transformation(). The transformation matrix
is written to and read from different threads. However only the former does
so while holding a lock.

To resolve this we must return a copy instead of a reference, so that the
real BasicSurface.transformation_matrix is always locked when it's being
read.

Approved by Alexandros Frantzis, PS Jenkins bot, Alan Griffiths.

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
        return 1.0f;
76
76
    }
77
77
 
78
 
    glm::mat4 const& transformation() const override
 
78
    glm::mat4 transformation() const override
79
79
    {
80
80
        return trans;
81
81
    }