From a4d440c162b02f2fe2099a0ac1c7796609a686e7 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Wed, 30 Apr 2014 20:40:20 +0200 Subject: Enable 'mix-blend-mode' property (rendering only). (bzr r13326) --- src/display/drawing-item.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/display') diff --git a/src/display/drawing-item.cpp b/src/display/drawing-item.cpp index ccf905e81..938330b02 100644 --- a/src/display/drawing-item.cpp +++ b/src/display/drawing-item.cpp @@ -23,7 +23,6 @@ namespace Inkscape { -#ifdef WITH_CSSBLEND void set_cairo_blend_operator( DrawingContext &dc, unsigned blend_mode ) { // All of the blend modes are implemented in Cairo as of 1.10. @@ -81,7 +80,6 @@ void set_cairo_blend_operator( DrawingContext &dc, unsigned blend_mode ) { break; } } -#endif /** * @class DrawingItem @@ -594,9 +592,8 @@ DrawingItem::render(DrawingContext &dc, Geom::IntRect const &area, unsigned flag if (_cached) { if (_cache) { _cache->prepare(); -#ifdef WITH_CSSBLEND set_cairo_blend_operator( dc, _blend_mode ); -#endif + _cache->paintFromCache(dc, carea); if (!carea) return RENDER_OK; } else { @@ -625,10 +622,8 @@ DrawingItem::render(DrawingContext &dc, Geom::IntRect const &area, unsigned flag nir |= (_filter != NULL && render_filters); // 3. it has a filter nir |= needs_opacity; // 4. it is non-opaque nir |= (_cache != NULL); // 5. it is cached -#ifdef WITH_CSSBLEND nir |= (_blend_mode != SP_CSS_BLEND_NORMAL); // 6. Blend mode not normal nir |= (_isolation == SP_CSS_ISOLATION_ISOLATE); // 7. Explicit isolatiom -#endif /* How the rendering is done. * @@ -740,9 +735,7 @@ DrawingItem::render(DrawingContext &dc, Geom::IntRect const &area, unsigned flag } dc.rectangle(*carea); dc.setSource(&intermediate); -#ifdef WITH_CSSBLEND set_cairo_blend_operator( dc, _blend_mode ); -#endif dc.fill(); dc.setSource(0,0,0,0); // the call above is to clear a ref on the intermediate surface held by dc -- cgit v1.2.3 From 5cd0a6e6d8f397d3cfd56868d1ebe74ab7c6d583 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Thu, 1 May 2014 11:16:33 +0200 Subject: Enable support for 'paint-order', rendering only. (bzr r13329) --- src/display/drawing-shape.cpp | 7 +------ src/display/drawing-text.cpp | 9 +++------ 2 files changed, 4 insertions(+), 12 deletions(-) (limited to 'src/display') diff --git a/src/display/drawing-shape.cpp b/src/display/drawing-shape.cpp index 92d71fad3..1a41bdb3a 100644 --- a/src/display/drawing-shape.cpp +++ b/src/display/drawing-shape.cpp @@ -149,7 +149,6 @@ DrawingShape::_updateItem(Geom::IntRect const &area, UpdateContext const &ctx, u return STATE_ALL; } -#ifdef WITH_SVG2 void DrawingShape::_renderFill(DrawingContext &dc) { @@ -183,7 +182,6 @@ DrawingShape::_renderStroke(DrawingContext &dc) dc.newPath(); // clear path } } -#endif void DrawingShape::_renderMarkers(DrawingContext &dc, Geom::IntRect const &area, unsigned flags, DrawingItem *stop_at) @@ -222,10 +220,9 @@ DrawingShape::_renderItem(DrawingContext &dc, Geom::IntRect const &area, unsigne } -#ifdef WITH_SVG2 if( _nrstyle.paint_order_layer[0] == NRStyle::PAINT_ORDER_NORMAL ) { // This is the most common case, special case so we don't call get_pathvector(), etc. twice -#endif + { // we assume the context has no path Inkscape::DrawingContext::Save save(dc); @@ -255,7 +252,6 @@ DrawingShape::_renderItem(DrawingContext &dc, Geom::IntRect const &area, unsigne _renderMarkers(dc, area, flags, stop_at); return RENDER_OK; -#ifdef WITH_SVG2 } // Handle different paint orders @@ -276,7 +272,6 @@ DrawingShape::_renderItem(DrawingContext &dc, Geom::IntRect const &area, unsigne } } return RENDER_OK; -#endif } void DrawingShape::_clipItem(DrawingContext &dc, Geom::IntRect const & /*area*/) diff --git a/src/display/drawing-text.cpp b/src/display/drawing-text.cpp index a280e221a..4178cb1d8 100644 --- a/src/display/drawing-text.cpp +++ b/src/display/drawing-text.cpp @@ -451,7 +451,6 @@ unsigned DrawingText::_renderItem(DrawingContext &dc, Geom::IntRect const &/*are Inkscape::DrawingContext::Save save(dc); dc.transform(_ctm); -#ifdef WITH_SVG2 // Text doesn't have markers, we can do paint-order quick and dirty. bool fill_first = false; if( _nrstyle.paint_order_layer[0] == NRStyle::PAINT_ORDER_NORMAL || @@ -461,22 +460,20 @@ unsigned DrawingText::_renderItem(DrawingContext &dc, Geom::IntRect const &/*are } // Won't get "stroke fill stroke" but that isn't 'valid' if (has_fill && fill_first) { -#else - if (has_fill) { -#endif _nrstyle.applyFill(dc); dc.fillPreserve(); } + if (has_stroke) { _nrstyle.applyStroke(dc); dc.strokePreserve(); } -#ifdef WITH_SVG2 + if (has_fill && !fill_first) { _nrstyle.applyFill(dc); dc.fillPreserve(); } -#endif + dc.newPath(); // clear path // draw text decoration -- cgit v1.2.3 From 7723d455c0daf1e07da9eba75b362c1d0a8556a5 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Thu, 1 May 2014 21:46:40 +0200 Subject: Enable 'paint-order', (rendering only)... missing changes. (bzr r13330) --- src/display/drawing-shape.h | 2 -- src/display/nr-style.cpp | 4 ---- src/display/nr-style.h | 2 -- 3 files changed, 8 deletions(-) (limited to 'src/display') diff --git a/src/display/drawing-shape.h b/src/display/drawing-shape.h index f37de9ce7..9d93a642f 100644 --- a/src/display/drawing-shape.h +++ b/src/display/drawing-shape.h @@ -39,10 +39,8 @@ protected: virtual DrawingItem *_pickItem(Geom::Point const &p, double delta, unsigned flags); virtual bool _canClip(); -#ifdef WITH_SVG2 void _renderFill(DrawingContext &dc); void _renderStroke(DrawingContext &dc); -#endif void _renderMarkers(DrawingContext &dc, Geom::IntRect const &area, unsigned flags, DrawingItem *stop_at); diff --git a/src/display/nr-style.cpp b/src/display/nr-style.cpp index 3d2d36483..09a28e63c 100644 --- a/src/display/nr-style.cpp +++ b/src/display/nr-style.cpp @@ -69,9 +69,7 @@ NRStyle::NRStyle() , line_through_position(0) , font_size(0) { -#ifdef WITH_SVG2 paint_order_layer[0] = PAINT_ORDER_NORMAL; -#endif } NRStyle::~NRStyle() @@ -165,7 +163,6 @@ void NRStyle::set(SPStyle *style) } -#ifdef WITH_SVG2 for( unsigned i = 0; i < PAINT_ORDER_LAYERS; ++i) { switch (style->paint_order.layer[i]) { case SP_CSS_PAINT_ORDER_NORMAL: @@ -182,7 +179,6 @@ void NRStyle::set(SPStyle *style) break; } } -#endif text_decoration_line = TEXT_DECORATION_LINE_CLEAR; if(style->text_decoration_line.inherit ){ text_decoration_line |= TEXT_DECORATION_LINE_INHERIT; } diff --git a/src/display/nr-style.h b/src/display/nr-style.h index 8b5a0ee3d..ca880c00b 100644 --- a/src/display/nr-style.h +++ b/src/display/nr-style.h @@ -68,7 +68,6 @@ struct NRStyle { cairo_pattern_t *fill_pattern; cairo_pattern_t *stroke_pattern; -#ifdef WITH_SVG2 enum PaintOrderType { PAINT_ORDER_NORMAL, PAINT_ORDER_FILL, @@ -78,7 +77,6 @@ struct NRStyle { static const size_t PAINT_ORDER_LAYERS = 3; PaintOrderType paint_order_layer[PAINT_ORDER_LAYERS]; -#endif #define TEXT_DECORATION_LINE_CLEAR 0x00 #define TEXT_DECORATION_LINE_SET 0x01 -- cgit v1.2.3 From 8f373840d0a408d43d2a6712c638463637890e97 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sat, 3 May 2014 23:37:36 +0200 Subject: Fix bounding box cache issues in general, and prevent the selector tool from updating anything in case of identity affines (which prevents the bounding box from being invalidated) Fixed bugs: - https://launchpad.net/bugs/1256597 (bzr r13333) --- src/display/canvas-arena.cpp | 2 +- src/display/drawing-item.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/display') diff --git a/src/display/canvas-arena.cpp b/src/display/canvas-arena.cpp index 404a94828..25d35fc6b 100644 --- a/src/display/canvas-arena.cpp +++ b/src/display/canvas-arena.cpp @@ -227,7 +227,7 @@ sp_canvas_arena_point (SPCanvasItem *item, Geom::Point p, SPCanvasItem **actual_ { SPCanvasArena *arena = SP_CANVAS_ARENA (item); - arena->drawing.update(Geom::IntRect::infinite(), arena->ctx, DrawingItem::STATE_PICK); + arena->drawing.update(Geom::IntRect::infinite(), arena->ctx, DrawingItem::STATE_PICK | DrawingItem::STATE_BBOX); DrawingItem *picked = arena->drawing.pick(p, arena->drawing.delta, arena->sticky); arena->picked = picked; diff --git a/src/display/drawing-item.cpp b/src/display/drawing-item.cpp index 938330b02..0bfb00b62 100644 --- a/src/display/drawing-item.cpp +++ b/src/display/drawing-item.cpp @@ -407,7 +407,7 @@ DrawingItem::setItemBounds(Geom::OptRect const &bounds) * @param reset State fields that should be reset before processing them. This is * a means to force a recomputation of internal data even if the item * considers it up to date. Mainly for internal use, such as - * propagating bunding box recomputation to children when the item's + * propagating bounding box recomputation to children when the item's * transform changes. */ void -- cgit v1.2.3