From 576944bb0d0227a2a51c4ef2d400297b510e426d Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Wed, 23 Oct 2019 20:17:12 +0200 Subject: [PATCH 1/2] Fix test atemp to set source --- src/display/drawing-item.cpp | 9 +-------- src/display/sp-canvas.cpp | 1 + 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/display/drawing-item.cpp b/src/display/drawing-item.cpp index ae7dfe40ef..90cdfbace1 100644 --- a/src/display/drawing-item.cpp +++ b/src/display/drawing-item.cpp @@ -799,11 +799,7 @@ DrawingItem::render(DrawingContext &dc, Geom::IntRect const &area, unsigned flag unsigned render_result = RENDER_OK; // 1. Render clipping path with alpha = opacity. - if (parent()) { - ict.setSource(0,0,0,_opacity); - } else { - ict.setSource(255, 255, 255, 1); - } + ict.setSource(0,0,0,_opacity); // Since clip can be combined with opacity, the result could be incorrect // for overlapping clip children. To fix this we use the SOURCE operator // instead of the default OVER. @@ -881,9 +877,6 @@ DrawingItem::render(DrawingContext &dc, Geom::IntRect const &area, unsigned flag dc.setOperator(ink_css_blend_to_cairo_operator(_mix_blend_mode)); dc.fill(); dc.setSource(0,0,0,0); - // Web isolation only works if parent doesnt have transform - - // the call above is to clear a ref on the intermediate surface held by dc return render_result; diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp index 216c8437f4..fb7e29eb08 100644 --- a/src/display/sp-canvas.cpp +++ b/src/display/sp-canvas.cpp @@ -1928,6 +1928,7 @@ void SPCanvas::paintXRayBuffer(Geom::IntRect const &paint_rect, Geom::IntRect co cairo_set_operator(buf.ct, CAIRO_OPERATOR_SOURCE); cairo_paint(buf.ct); cairo_translate(buf.ct, paint_rect.left(), paint_rect.top()); + cairo_set_operator(buf.ct, CAIRO_OPERATOR_OVER); // cairo_surface_write_to_png( copy_backing, "debug1.png" ); -- GitLab From 9b1e7b6d287f936ad85bef3ba3af20ebb4ad8462 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Wed, 23 Oct 2019 20:20:01 +0200 Subject: [PATCH 2/2] Remove parent check --- src/display/drawing-item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/display/drawing-item.cpp b/src/display/drawing-item.cpp index 90cdfbace1..b76ad98706 100644 --- a/src/display/drawing-item.cpp +++ b/src/display/drawing-item.cpp @@ -739,7 +739,7 @@ DrawingItem::render(DrawingContext &dc, Geom::IntRect const &area, unsigned flag nir |= needs_opacity; // 4. it is non-opaque nir |= (_mix_blend_mode != SP_CSS_BLEND_NORMAL); // 5. it has blend mode nir |= (_isolation == SP_CSS_ISOLATION_ISOLATE); // 6. it is isolated - nir |= !parent(); // 7. is root need isolation from background + if (prev_nir && !needs_intermediate_rendering) { setCached(false, true); if (_has_cache_iterator) { -- GitLab