]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
obey destination position in fill_with_argb32_data
authorRay Strode <rstrode@redhat.com>
Thu, 10 May 2007 16:34:52 +0000 (12:34 -0400)
committerRay Strode <rstrode@redhat.com>
Thu, 10 May 2007 16:34:52 +0000 (12:34 -0400)
src/ply-video-buffer.c
src/ply-video-buffer.h

index e15f2523c1f45cf0f0d9773508ac72917db8c160..baaafaf9e65ca108dbcee7cfb8a91951a0dd64bc 100644 (file)
@@ -609,7 +609,6 @@ ply_video_buffer_fill_with_argb32_data (PlyVideoBuffer     *buffer,
                                         unsigned long       y,
                                         unsigned long       width,
                                         unsigned long       height,
-                                        unsigned long       bytes_per_row,
                                         uint32_t           *data)
 {
   uint32_t pixel_value;
@@ -617,7 +616,6 @@ ply_video_buffer_fill_with_argb32_data (PlyVideoBuffer     *buffer,
 
   assert (buffer != NULL);
   assert (ply_video_buffer_device_is_open (buffer));
-  assert (width * 4 <= bytes_per_row);
 
   if (area == NULL)
     area = &buffer->area;
@@ -628,19 +626,23 @@ ply_video_buffer_fill_with_argb32_data (PlyVideoBuffer     *buffer,
         {
           uint8_t red, green, blue, alpha;
 
-          alpha = ((data[bytes_per_row / 4 * row + column] & 0xff000000) >> 24);
-          red = ((data[bytes_per_row / 4 * row + column]   & 0x00ff0000) >> 16);
-          green = ((data[bytes_per_row / 4 * row + column] & 0x0000ff00) >> 8);
-          blue = ((data[bytes_per_row / 4 * row + column]  & 0x000000ff));
+          alpha = ((data[width * row + column] & 0xff000000) >> 24);
+          red = ((data[width * row + column]   & 0x00ff0000) >> 16);
+          green = ((data[width * row + column] & 0x0000ff00) >> 8);
+          blue = ((data[width * row + column]  & 0x000000ff));
 
           pixel_value = 
             ply_video_buffer_convert_color_to_pixel_value (buffer, red, green,
                                                            blue, alpha);
           if (alpha == 0xff)
-            ply_video_buffer_set_value_at_pixel (buffer, column, row,
+            ply_video_buffer_set_value_at_pixel (buffer,
+                                                 area->x + (column - x),
+                                                 area->y + (row - y),
                                                  pixel_value);
           else
-            ply_video_buffer_blend_value_at_pixel (buffer, column, row,
+            ply_video_buffer_blend_value_at_pixel (buffer,
+                                                   area->x + (column - x),
+                                                   area->y + (row - y),
                                                    pixel_value);
         }
     }
@@ -698,8 +700,7 @@ animate_at_time (PlyVideoBuffer *buffer,
       }
     }
 
-  ply_video_buffer_fill_with_argb32_data (buffer, NULL, 0, 0, 1024, 768, 
-                                          1024 * 4, data);
+  ply_video_buffer_fill_with_argb32_data (buffer, NULL, 0, 0, 1024, 768, data);
 }
 
 int
index e4dfa513c8596b4716544fbfb5980a4b47981501..d84f30ffb2ff3d883efce0976604209af567501f 100644 (file)
@@ -61,7 +61,6 @@ bool ply_video_buffer_fill_with_argb32_data (PlyVideoBuffer      *buffer,
                                              unsigned long        y,
                                              unsigned long        width,
                                              unsigned long        height,
-                                             unsigned long        bytes_per_row,
                                              uint32_t            *data);