In the current ATSUI code there was a 'todo' to attempt clipping on image surfaces. The cairo-thing-to-do here would be to return CAIRO_INT_STATUS_UNSUPPORTED for non-quartz surfaces, which then falls back on looking for the glyph masks provided by looking up (glyph..)_INFO_SURFACE. Then cairo will just compose the glyph surfaces on the image surface and clip them for us. The problem is most visible in the clip_operator test where some of the text is not clipped. 3 patches follow implementing the fix, for easier review.
Created attachment 8233 [details] [review] patch 1/3. Refactors out code that creates a CGBitmapContextRef from an image surface.
Created attachment 8234 [details] [review] patch 2/3. Switches glyph rendering to fallback for non-quartz surfaces.
Created attachment 8235 [details] [review] patch 3/3. Implements initialising the glyph mask surface.
Created attachment 8236 [details] clip-operator test output before patches.
Created attachment 8237 [details] clip-operator test output after patches. The corrected output differs slightly from the reference image. It appears that the ft glyphs are wider by subpixel amounts than the atsui ones, possibly because hinting is still not disabled in the atsui tests.
Thanks Brian. I think you should go on and commit these. You do have a developer account, right?
Comment on attachment 8233 [details] [review] patch 1/3. Refactors out code that creates a CGBitmapContextRef from an image surface. committed patch as aed4029a104d22cbd363ab9e365320980d22bc86
Committed 2nd and 3rd patches as 504cbdae37232d65f5c1f8913e55ac63397ad4f0
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.