mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-08 11:50:26 +01:00
[ft] Fix wrong assumptions
If subpixel rendering is enabled, but FT returns a 8bit gray bitmap (perhaps because the font has 8bit embedded bitmaps) we were hitting the assertions because the assumptions made were wrong. Fix up.
This commit is contained in:
parent
a0f556f37f
commit
e738079302
1 changed files with 3 additions and 7 deletions
|
|
@ -1182,7 +1182,9 @@ _get_bitmap_surface (FT_Bitmap *bitmap,
|
|||
case FT_PIXEL_MODE_LCD:
|
||||
case FT_PIXEL_MODE_LCD_V:
|
||||
case FT_PIXEL_MODE_GRAY:
|
||||
if (font_options->antialias != CAIRO_ANTIALIAS_SUBPIXEL) {
|
||||
if (font_options->antialias != CAIRO_ANTIALIAS_SUBPIXEL ||
|
||||
bitmap->pixel_mode == FT_PIXEL_MODE_GRAY)
|
||||
{
|
||||
stride = bitmap->pitch;
|
||||
if (own_buffer) {
|
||||
data = bitmap->buffer;
|
||||
|
|
@ -1196,12 +1198,6 @@ _get_bitmap_surface (FT_Bitmap *bitmap,
|
|||
|
||||
format = CAIRO_FORMAT_A8;
|
||||
} else {
|
||||
/* if we get there, the data from the source bitmap
|
||||
* really comes from _fill_xrender_bitmap, and is
|
||||
* made of 32-bit ARGB or ABGR values */
|
||||
assert (own_buffer != 0);
|
||||
assert (bitmap->pixel_mode != FT_PIXEL_MODE_GRAY);
|
||||
|
||||
data = bitmap->buffer;
|
||||
stride = bitmap->pitch;
|
||||
format = CAIRO_FORMAT_ARGB32;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue