bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#35468: [PATCH] Refactor draw_glyph_string on X and w32


From: Eli Zaretskii
Subject: bug#35468: [PATCH] Refactor draw_glyph_string on X and w32
Date: Sun, 05 May 2019 05:34:56 +0300

> From: Alex Gramiak <address@hidden>
> Cc: address@hidden, address@hidden
> Date: Sat, 04 May 2019 13:29:34 -0600
> 
> > The way I wrote it was confusing: by the 'draw' method I actually
> > meant the external APIs called by the 'draw' method, like
> > XftDrawGlyphs.  Compare that with w32's ExtTextOutW in w32font_draw.
> 
> Ah, I see. I'll keep the setter and rename it to, say,
> set_device_context_font.

"Device context" is a w32-specific concept, I wouldn't propagate it
into an abstraction.  set_font sounds much better to me.

> > I don't think I understand the difficulties, sorry.  Why is
> > s->img->mask a problem?
> 
> I meant problem as in that it's "leaking" the internals a bit.

Yes, but where and why do you need to leak it?

> > What details does glyph_has_image hide?  Is that just to test
> > s->img->pixmap?
> 
> On most platforms, yes, but the Cairo drawing uses s->img->cr_data
> instead.

A macro should do here, there's no need for an interface, IMO.

> >>         if (!gdif->glyph_image_uses_mask (s))
> >
> > And what does glyph_image_uses_mask hide?  AFAIU, the current code
> > simply looks at s->img->mask, and if so, why do we need an interface
> > for that?
> 
> I was thinking that since AFAIU the Cairo drawing doesn't set
> s->img->mask it wouldn't make sense, from an interface POV, to check it
> directly. I suppose it doesn't really matter in that case, and it would
> be faster to just check s->img->mask even if the backend doesn't use it.

Yes, I think so.





reply via email to

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