Skip to content
  • Daniel Stone's avatar
    gl-renderer: Account for offset in output region translation · 3ebd8704
    Daniel Stone authored and Daniel Stone's avatar Daniel Stone committed
    In 55bcb93f
    
     ("gl-renderer: Use helper for conversion to EGL rects"),
    we extracted and lovingly commented the transformation from global to
    output co-ordinate space used for EGL_KHR_swap_buffer_with_damage, into
    a new helper function.
    
    The commenting correctly noted the steps we need to perform the
    transformation: shifting by the output's offset into global space,
    followed by applying the output's scale and rotation transformations.
    
    Unfortunately, the code did not live up to the high standards of the
    comment, and forgot to translate by the output's offset. This meant that
    for multiple outputs, we would probably end up with wildly out-of-bounds
    co-ordinates.
    
    Fix the code to first translate by the output's offset in global space,
    ensuring that both our swap_buffers_with_damage, and our partial_update
    co-ordinate sets, can spark joy for those blessed with more than one
    output.
    
    Signed-off-by: default avatarDaniel Stone <daniels@collabora.com>
    3ebd8704