freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2-demos] master d719135: * graph/x11/grx11.c (gr_x11_blitter_re


From: Werner Lemberg
Subject: [freetype2-demos] master d719135: * graph/x11/grx11.c (gr_x11_blitter_reset): Minor improvement.
Date: Fri, 23 Sep 2022 22:28:42 -0400 (EDT)

branch: master
commit d719135f686218a8d461fb8408b0cbf7369c9f51
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>

    * graph/x11/grx11.c (gr_x11_blitter_reset): Minor improvement.
---
 graph/x11/grx11.c | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/graph/x11/grx11.c b/graph/x11/grx11.c
index 4727c2d..6926ddc 100644
--- a/graph/x11/grx11.c
+++ b/graph/x11/grx11.c
@@ -119,8 +119,8 @@
                         int            width,
                         int            height )
   {
-    long  pitch;
-    int   delta;
+    int  delta;
+    int  pitch;
 
 
     /* clip rectangle to source bitmap */
@@ -157,22 +157,20 @@
       return 1;
 
     /* now, setup the blitter */
-    pitch = blit->src_pitch = source->pitch;
+    blit->x      = x;
+    blit->y      = y;
+    blit->width  = width;
+    blit->height = height;
 
-    blit->src_line  = source->buffer + y * pitch;
+    pitch = blit->src_pitch = source->pitch;
     if ( pitch < 0 )
-      blit->src_line -= ( source->rows - 1 ) * pitch;
+      y -= source->rows - 1;
+    blit->src_line  = source->buffer + y * pitch;
 
     pitch = blit->dst_pitch = target->bytes_per_line;
-
-    blit->dst_line = (unsigned char*)target->data + y * pitch;
     if ( pitch < 0 )
-      blit->dst_line -= ( target->height - 1 ) * pitch;
-
-    blit->x      = x;
-    blit->y      = y;
-    blit->width  = width;
-    blit->height = height;
+      y -= target->height - 1;
+    blit->dst_line = (unsigned char*)target->data + y * pitch;
 
     return 0;
   }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]