[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2-demos] master ffcc5c0: [graph] Fix mishandling of LCDv format
From: |
Werner Lemberg |
Subject: |
[freetype2-demos] master ffcc5c0: [graph] Fix mishandling of LCDv formats. |
Date: |
Thu, 18 Aug 2022 12:10:24 -0400 (EDT) |
branch: master
commit ffcc5c03a40ec35ef63d7a5a29097572ac9c9f3e
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>
[graph] Fix mishandling of LCDv formats.
* graph/gblblit.c (gblender_blit)init): Triple the LCDv pitch.
* graph/gblany.h (_gblender_blit_{vrgb,vbgr}_*): Updated accordingly.
---
graph/gblany.h | 8 ++++----
graph/gblblit.c | 6 ++++--
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/graph/gblany.h b/graph/gblany.h
index 949409b..23a913d 100644
--- a/graph/gblany.h
+++ b/graph/gblany.h
@@ -279,7 +279,7 @@ GCONCAT( _gblender_blit_vrgb_, GDST_TYPE )( GBlenderBlit
blit,
GBLENDER_CHANNEL_VARS( blender, fore.r, fore.g, fore.b );
int h = blit->height;
- int src_pitch = blit->src_pitch;
+ int src_pitch = blit->src_pitch / 3;
const unsigned char* src_line = blit->src_line + blit->src_x;
unsigned char* dst_line = blit->dst_line + blit->dst_x*GDST_INCR;
@@ -322,7 +322,7 @@ GCONCAT( _gblender_blit_vrgb_, GDST_TYPE )( GBlenderBlit
blit,
}
while (--w > 0);
- src_line += blit->src_pitch*3;
+ src_line += blit->src_pitch;
dst_line += blit->dst_pitch;
}
while (--h > 0);
@@ -342,7 +342,7 @@ GCONCAT( _gblender_blit_vbgr_, GDST_TYPE )( GBlenderBlit
blit,
GBLENDER_CHANNEL_VARS( blender, fore.r, fore.g, fore.b );
int h = blit->height;
- int src_pitch = blit->src_pitch;
+ int src_pitch = blit->src_pitch / 3;
const unsigned char* src_line = blit->src_line + blit->src_x;
unsigned char* dst_line = blit->dst_line + blit->dst_x*GDST_INCR;
@@ -385,7 +385,7 @@ GCONCAT( _gblender_blit_vbgr_, GDST_TYPE )( GBlenderBlit
blit,
}
while (--w > 0);
- src_line += blit->src_pitch*3;
+ src_line += blit->src_pitch;
dst_line += blit->dst_pitch;
}
while (--h > 0);
diff --git a/graph/gblblit.c b/graph/gblblit.c
index c513d1c..d847cf7 100644
--- a/graph/gblblit.c
+++ b/graph/gblblit.c
@@ -252,7 +252,7 @@ gblender_blit_init( GBlenderBlit blit,
GBlenderSourceFormat src_format;
const unsigned char* src_buffer = glyph->buffer;
- const int src_pitch = glyph->pitch;
+ int src_pitch = glyph->pitch;
int src_width = glyph->width;
int src_height = glyph->rows;
unsigned char* dst_buffer = target->buffer;
@@ -276,10 +276,12 @@ gblender_blit_init( GBlenderBlit blit,
break;
case gr_pixel_mode_lcdv: src_format = GBLENDER_SOURCE_VRGB;
src_height /= 3;
+ src_pitch *= 3;
gblender_use_channels( surface->gblender, 1 );
break;
case gr_pixel_mode_lcdv2: src_format = GBLENDER_SOURCE_VBGR;
src_height /= 3;
+ src_pitch *= 3;
gblender_use_channels( surface->gblender, 1 );
break;
case gr_pixel_mode_bgra: src_format = GBLENDER_SOURCE_BGRA;
@@ -347,7 +349,7 @@ gblender_blit_init( GBlenderBlit blit,
blit->src_pitch = src_pitch;
if ( src_pitch < 0 )
- src_y -= glyph->rows - 1;
+ src_y -= src_height - 1;
blit->src_line = src_buffer + src_pitch * src_y;
blit->src_x = src_x;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2-demos] master ffcc5c0: [graph] Fix mishandling of LCDv formats.,
Werner Lemberg <=