[librsvg: 26/30] Handle cairo errors when creating a mask
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 26/30] Handle cairo errors when creating a mask
- Date: Wed, 23 Jun 2021 23:05:40 +0000 (UTC)
commit 68c435b7e2afab9692c8827454887e1facc93e19
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Jun 21 20:56:59 2021 -0500
Handle cairo errors when creating a mask
Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/516>
src/drawing_ctx.rs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/drawing_ctx.rs b/src/drawing_ctx.rs
index a196bc70..0da7acf1 100644
--- a/src/drawing_ctx.rs
+++ b/src/drawing_ctx.rs
@@ -809,10 +809,12 @@ impl DrawingCtx {
&bbox,
acquired_nodes,
)
- .map(|mask_surf| {
+ .and_then(|mask_surf| {
if let Some(surf) = mask_surf {
self.cr.set_matrix(affines.compositing.into());
- self.cr.mask_surface(&surf, 0.0, 0.0);
+ Ok(self.cr.mask_surface(&surf, 0.0, 0.0)?)
+ } else {
+ Ok(())
}
})
.map(|_: ()| bbox)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]