[cairo-commit] 3 commits - src/cairo-composite-rectangles.c test/reference

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Aug 28 07:55:51 UTC 2021


 src/cairo-composite-rectangles.c                      |   14 --------------
 test/reference/user-font-mask.quartz.ref.png          |binary
 test/reference/user-font-mask.recording.ref.png       |binary
 test/reference/user-font-mask.script.ref.png          |binary
 test/reference/user-font-mask.xcb-render-0_0.ref.png  |binary
 test/reference/user-font-mask.xcb.ref.png             |binary
 test/reference/user-font-mask.xlib-render-0_0.ref.png |binary
 test/reference/user-font-mask.xlib.ref.png            |binary
 8 files changed, 14 deletions(-)

New commits:
commit 6d169c6995c3df70e8db7a8c88ea48ac9e53462d
Merge: 5e76dd7a5 e73f236da
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Sat Aug 28 07:55:49 2021 +0000

    Merge branch 'cairo-fix-glyph-clipping' into 'master'
    
    Remove the approximate glyph bounds check - with updated ref images
    
    See merge request cairo/cairo!245

commit e73f236da6ad8bc98b99f4e152cc9c85c47fcb11
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Sat Aug 14 19:19:25 2021 +0930

    Update user-font-mask ref images

diff --git a/test/reference/user-font-mask.quartz.ref.png b/test/reference/user-font-mask.quartz.ref.png
new file mode 100644
index 000000000..1ef2160cd
Binary files /dev/null and b/test/reference/user-font-mask.quartz.ref.png differ
diff --git a/test/reference/user-font-mask.recording.ref.png b/test/reference/user-font-mask.recording.ref.png
new file mode 100644
index 000000000..1ef2160cd
Binary files /dev/null and b/test/reference/user-font-mask.recording.ref.png differ
diff --git a/test/reference/user-font-mask.script.ref.png b/test/reference/user-font-mask.script.ref.png
new file mode 100644
index 000000000..1ef2160cd
Binary files /dev/null and b/test/reference/user-font-mask.script.ref.png differ
diff --git a/test/reference/user-font-mask.xcb-render-0_0.ref.png b/test/reference/user-font-mask.xcb-render-0_0.ref.png
new file mode 100644
index 000000000..1ef2160cd
Binary files /dev/null and b/test/reference/user-font-mask.xcb-render-0_0.ref.png differ
diff --git a/test/reference/user-font-mask.xcb.ref.png b/test/reference/user-font-mask.xcb.ref.png
new file mode 100644
index 000000000..1ef2160cd
Binary files /dev/null and b/test/reference/user-font-mask.xcb.ref.png differ
diff --git a/test/reference/user-font-mask.xlib-render-0_0.ref.png b/test/reference/user-font-mask.xlib-render-0_0.ref.png
new file mode 100644
index 000000000..1ef2160cd
Binary files /dev/null and b/test/reference/user-font-mask.xlib-render-0_0.ref.png differ
diff --git a/test/reference/user-font-mask.xlib.ref.png b/test/reference/user-font-mask.xlib.ref.png
new file mode 100644
index 000000000..1ef2160cd
Binary files /dev/null and b/test/reference/user-font-mask.xlib.ref.png differ
commit 4c7a8afb3bf06743ae9502e68e7b964201606536
Author: Matthias Clasen <mclasen at redhat.com>
Date:   Fri Jul 30 19:28:26 2021 -0400

    Remove the approximate glyph bounds check
    
    We are trying to get an approximate bounding box for
    the extents of a glyph string and use it for bailing
    early if there's nothing to do, but the code computing
    that approximation makes invalid assumptions: It assumes
    that a glyph never extends further than max-advance-width
    before or after its position. That is not true in general,
    as can be seen in https://gitlab.gnome.org/GNOME/gtk/-/issues/4132
    In the example there, we have a monospace fonts with ligatures
    that have a negative lsb of two or three times the glyph width.
    
    The optimization here could theoretically be fixed by iterating
    over the font once to determine suitable values for how far
    glyphs can extend before or after their position, but this
    patch just removes it.

diff --git a/src/cairo-composite-rectangles.c b/src/cairo-composite-rectangles.c
index 10f30da92..80e23f23a 100644
--- a/src/cairo-composite-rectangles.c
+++ b/src/cairo-composite-rectangles.c
@@ -473,20 +473,6 @@ _cairo_composite_rectangles_init_for_glyphs (cairo_composite_rectangles_t *exten
 	return CAIRO_INT_STATUS_NOTHING_TO_DO;
     }
 
-    /* Computing the exact bbox and the overlap is expensive.
-     * First perform a cheap test to see if the glyphs are all clipped out.
-     */
-    if (extents->is_bounded & CAIRO_OPERATOR_BOUND_BY_MASK &&
-	_cairo_scaled_font_glyph_approximate_extents (scaled_font,
-						      glyphs, num_glyphs,
-						      &extents->mask))
-    {
-	if (! _cairo_rectangle_intersect (&extents->bounded, &extents->mask)) {
-	    _cairo_composite_rectangles_fini(extents);
-	    return CAIRO_INT_STATUS_NOTHING_TO_DO;
-	}
-    }
-
     status = _cairo_scaled_font_glyph_device_extents (scaled_font,
 						      glyphs, num_glyphs,
 						      &extents->mask,


More information about the cairo-commit mailing list