mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 19:00:08 +00:00
gsk: Ignore transforms for font handling
We were turning off hinting and subpixel positioning if the transform isn't 2D affine. The idea behind this was that transforms likely indicate animations, and for animations, this may reduce jitter. But the heuristic of transform==animation is not very reliable, and we pay for this with a jump from hinted to unhinted at the beginning and end of it. Also, the heuristic does not even work for the most relevant 'animation' we have today: scrolling. So, lets drop this for now. We can revisit it later.
This commit is contained in:
parent
59633a6781
commit
5242205a65
@ -2996,7 +2996,6 @@ gsk_gpu_node_processor_add_glyph_node (GskGpuNodeProcessor *self,
|
||||
GskGpuDevice *device;
|
||||
const PangoGlyphInfo *glyphs;
|
||||
PangoFont *font;
|
||||
PangoFont *unhinted = NULL;
|
||||
graphene_point_t offset;
|
||||
guint i, num_glyphs;
|
||||
float scale, inv_scale;
|
||||
@ -3026,13 +3025,6 @@ gsk_gpu_node_processor_add_glyph_node (GskGpuNodeProcessor *self,
|
||||
inv_scale = 1.f / scale;
|
||||
|
||||
glyph_align = gsk_gpu_frame_should_optimize (self->frame, GSK_GPU_OPTIMIZE_GLYPH_ALIGN);
|
||||
if (gsk_transform_get_category (self->modelview) < GSK_TRANSFORM_CATEGORY_2D)
|
||||
{
|
||||
/* With transforms, don't do either subpixel positioning or hinting */
|
||||
glyph_align = FALSE;
|
||||
font = unhinted = gsk_get_hinted_font (font, CAIRO_HINT_STYLE_NONE, CAIRO_ANTIALIAS_DEFAULT);
|
||||
}
|
||||
|
||||
hinting = gsk_font_get_hint_style (font) != CAIRO_HINT_STYLE_NONE;
|
||||
|
||||
for (i = 0; i < num_glyphs; i++)
|
||||
@ -3106,8 +3098,6 @@ gsk_gpu_node_processor_add_glyph_node (GskGpuNodeProcessor *self,
|
||||
|
||||
offset.x += (float) glyphs[i].geometry.width / PANGO_SCALE;
|
||||
}
|
||||
|
||||
g_clear_object (&unhinted);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
Loading…
Reference in New Issue
Block a user