Bug 1722232 - Revert changeset 5689add84fe2 (bug 1717685) and take the upstream version of the fix from https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/195 instead. r=jrmuizel
authorJonathan Kew <jkew@mozilla.com>
Sun, 25 Jul 2021 17:30:00 +0000
changeset 586588 f02e38dccb1cff6b44025db642e4b4000d6327f2
parent 586587 da82969d4cf5275e34591ad7dac9e5e8029858e5
child 586589 e5cfc59f90639430e04b5aa9755309191553fc10
push id38642
push userarchaeopteryx@coole-files.de
push dateMon, 26 Jul 2021 09:34:30 +0000
treeherdermozilla-central@0c272222c17b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1722232, 1717685
milestone92.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1722232 - Revert changeset 5689add84fe2 (bug 1717685) and take the upstream version of the fix from https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/195 instead. r=jrmuizel Differential Revision: https://phabricator.services.mozilla.com/D120801
gfx/cairo/cairo/src/cairo-recording-surface.c
--- a/gfx/cairo/cairo/src/cairo-recording-surface.c
+++ b/gfx/cairo/cairo/src/cairo-recording-surface.c
@@ -1984,24 +1984,26 @@ static cairo_status_t
 						 command->tag.tag_name,
 						 command->tag.attributes);
 	    break;
 
 	default:
 	    ASSERT_NOT_REACHED;
 	}
 
+	/* It's possible that a degenerate clip caused the command to end up doing nothing when replayed. */
+	if (unlikely (status == CAIRO_INT_STATUS_NOTHING_TO_DO))
+	    status = CAIRO_INT_STATUS_SUCCESS;
+
 	if (type == CAIRO_RECORDING_CREATE_REGIONS && command->header.region != CAIRO_RECORDING_REGION_NATIVE) {
 	    if (status == CAIRO_INT_STATUS_SUCCESS) {
 		command->header.region = CAIRO_RECORDING_REGION_NATIVE;
 	    } else if (status == CAIRO_INT_STATUS_IMAGE_FALLBACK) {
 		command->header.region = CAIRO_RECORDING_REGION_IMAGE_FALLBACK;
 		status = CAIRO_INT_STATUS_SUCCESS;
-	    } else if (status == CAIRO_INT_STATUS_NOTHING_TO_DO) {
-		status = CAIRO_INT_STATUS_SUCCESS;
 	    } else {
 		assert (_cairo_int_status_is_error (status));
 	    }
 	}
 
 	if (unlikely (status))
 	    break;
     }