dont submit draws for any empty glyphs

This commit is contained in:
Ryan Fleury
2024-01-22 15:18:42 -08:00
parent 834f4f7d20
commit 9a2ae21b89
2 changed files with 9 additions and 4 deletions
@@ -420,7 +420,7 @@ fp_raster(Arena *arena, FP_Handle font_handle, F32 size, FP_RasterMode mode, Str
U64 in_pitch = (U64)dib.dsBm.bmWidthBytes;
U8 *out_data = (U8 *)result.atlas;
U64 out_pitch = atlas_dim.x * 4;
U64 color_sum = 0;
U8 *in_line = (U8 *)in_data;
U8 *out_line = out_data;
for(U64 y = 0; y < atlas_dim.y; y += 1)
@@ -434,12 +434,17 @@ fp_raster(Arena *arena, FP_Handle font_handle, F32 size, FP_RasterMode mode, Str
out_pixel[1] = 255;
out_pixel[2] = 255;
out_pixel[3] = in_pixel_byte;
color_sum += in_pixel_byte;
in_pixel += 4;
out_pixel += 4;
}
in_line += in_pitch;
out_line += out_pitch;
}
if(color_sum == 0)
{
result.atlas_dim = v2s16(0, 0);
}
}
render_target->Release();
}