]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
ply-pixel-buffer: Fix fill_with_buffer fastpath when device_scale != 1
authorHans de Goede <hdegoede@redhat.com>
Wed, 7 Nov 2018 14:49:40 +0000 (15:49 +0100)
committerHans de Goede <hdegoede@redhat.com>
Tue, 27 Nov 2018 07:48:56 +0000 (08:48 +0100)
After calling ply_pixel_buffer_crop_area_to_clip_area cropped_area.x/y
are in device coordinates. So when calculating the x/y offset in the
source-buffer due to device-clip areas possible making cropped_area.x/y
larger then just the xoffset/yoffset (in the canvas) we must multiply
the original xoffset/yoffset by device_scale before subtracting.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
src/libply-splash-core/ply-pixel-buffer.c

index de3b10799a723418d44ce5b932a8034856f17524..04aa0d663f480d80d2263b450f204af43a4bb1bd 100644 (file)
@@ -868,8 +868,8 @@ ply_pixel_buffer_fill_with_buffer_at_opacity_with_clip (ply_pixel_buffer_t *canv
                 if (cropped_area.width == 0 || cropped_area.height == 0)
                         return;
 
-                x = cropped_area.x - x_offset;
-                y = cropped_area.y - y_offset;
+                x = cropped_area.x - x_offset * canvas->device_scale;
+                y = cropped_area.y - y_offset * canvas->device_scale;
 
                 ply_pixel_buffer_copy_area (canvas, source, x, y, &cropped_area);