From d4ba8eaa4a621ac60d99a4aad7531d080cece2cd Mon Sep 17 00:00:00 2001 From: David Mathog Date: Sat, 8 Feb 2014 09:44:12 +0100 Subject: DrawingContext: change variable names ct to dc (bug #1272073) Fixed bugs: - https://launchpad.net/bugs/1272073 (bzr r13009) --- src/display/drawing-group.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/display/drawing-group.cpp') diff --git a/src/display/drawing-group.cpp b/src/display/drawing-group.cpp index b5ce18891..38ace001f 100644 --- a/src/display/drawing-group.cpp +++ b/src/display/drawing-group.cpp @@ -98,12 +98,12 @@ DrawingGroup::_updateItem(Geom::IntRect const &area, UpdateContext const &ctx, u } unsigned -DrawingGroup::_renderItem(DrawingContext &ct, Geom::IntRect const &area, unsigned flags, DrawingItem *stop_at) +DrawingGroup::_renderItem(DrawingContext &dc, Geom::IntRect const &area, unsigned flags, DrawingItem *stop_at) { if (stop_at == NULL) { // normal rendering for (ChildrenList::iterator i = _children.begin(); i != _children.end(); ++i) { - i->render(ct, area, flags, stop_at); + i->render(dc, area, flags, stop_at); } } else { // background rendering @@ -111,11 +111,11 @@ DrawingGroup::_renderItem(DrawingContext &ct, Geom::IntRect const &area, unsigne if (&*i == stop_at) return RENDER_OK; // do not render the stop_at item at all if (i->isAncestorOf(stop_at)) { // render its ancestors without masks, opacity or filters - i->render(ct, area, flags | RENDER_FILTER_BACKGROUND, stop_at); + i->render(dc, area, flags | RENDER_FILTER_BACKGROUND, stop_at); // stop further rendering return RENDER_OK; } else { - i->render(ct, area, flags, stop_at); + i->render(dc, area, flags, stop_at); } } } @@ -123,10 +123,10 @@ DrawingGroup::_renderItem(DrawingContext &ct, Geom::IntRect const &area, unsigne } void -DrawingGroup::_clipItem(DrawingContext &ct, Geom::IntRect const &area) +DrawingGroup::_clipItem(DrawingContext &dc, Geom::IntRect const &area) { for (ChildrenList::iterator i = _children.begin(); i != _children.end(); ++i) { - i->clip(ct, area); + i->clip(dc, area); } } -- cgit v1.2.3 From e7a3f5b74d1f5a95390ee95b06371d184c1812f7 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Thu, 13 Mar 2014 05:45:38 +0100 Subject: Provide a toggle in the document properties to optionally turn off antialiasing for display and export. Fixes a nearly 10 year old bug #170356 Fixed bugs: - https://launchpad.net/bugs/170356 (bzr r13144) --- src/display/drawing-group.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/display/drawing-group.cpp') diff --git a/src/display/drawing-group.cpp b/src/display/drawing-group.cpp index 38ace001f..c03e0f3ba 100644 --- a/src/display/drawing-group.cpp +++ b/src/display/drawing-group.cpp @@ -22,6 +22,7 @@ DrawingGroup::DrawingGroup(Drawing &drawing) : DrawingItem(drawing) , _style(NULL) , _child_transform(NULL) + , _uses_antialiasing(true) {} DrawingGroup::~DrawingGroup() @@ -47,6 +48,15 @@ DrawingGroup::setStyle(SPStyle *style) _setStyleCommon(_style, style); } +void +DrawingGroup::setAntialiasing(bool a) +{ + if (_uses_antialiasing != a) { + _uses_antialiasing = a; + _markForUpdate(STATE_ALL, true); + } +} + /** * Set additional transform for the group. * This is applied after the normal transform and mainly useful for @@ -100,6 +110,13 @@ DrawingGroup::_updateItem(Geom::IntRect const &area, UpdateContext const &ctx, u unsigned DrawingGroup::_renderItem(DrawingContext &dc, Geom::IntRect const &area, unsigned flags, DrawingItem *stop_at) { + DrawingContext::Save aa_save; + + if (!_uses_antialiasing) { + aa_save.save(dc); + cairo_set_antialias(dc.raw(), CAIRO_ANTIALIAS_NONE); + } + if (stop_at == NULL) { // normal rendering for (ChildrenList::iterator i = _children.begin(); i != _children.end(); ++i) { -- cgit v1.2.3 From 32ef25632164e5af8766a5364400b579edde4ebf Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Thu, 13 Mar 2014 23:37:07 +0100 Subject: Reimplement global aliasing toggle as a 'shape-rendering' property on the root element. (bzr r13146) --- src/display/drawing-group.cpp | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'src/display/drawing-group.cpp') diff --git a/src/display/drawing-group.cpp b/src/display/drawing-group.cpp index c03e0f3ba..38ace001f 100644 --- a/src/display/drawing-group.cpp +++ b/src/display/drawing-group.cpp @@ -22,7 +22,6 @@ DrawingGroup::DrawingGroup(Drawing &drawing) : DrawingItem(drawing) , _style(NULL) , _child_transform(NULL) - , _uses_antialiasing(true) {} DrawingGroup::~DrawingGroup() @@ -48,15 +47,6 @@ DrawingGroup::setStyle(SPStyle *style) _setStyleCommon(_style, style); } -void -DrawingGroup::setAntialiasing(bool a) -{ - if (_uses_antialiasing != a) { - _uses_antialiasing = a; - _markForUpdate(STATE_ALL, true); - } -} - /** * Set additional transform for the group. * This is applied after the normal transform and mainly useful for @@ -110,13 +100,6 @@ DrawingGroup::_updateItem(Geom::IntRect const &area, UpdateContext const &ctx, u unsigned DrawingGroup::_renderItem(DrawingContext &dc, Geom::IntRect const &area, unsigned flags, DrawingItem *stop_at) { - DrawingContext::Save aa_save; - - if (!_uses_antialiasing) { - aa_save.save(dc); - cairo_set_antialias(dc.raw(), CAIRO_ANTIALIAS_NONE); - } - if (stop_at == NULL) { // normal rendering for (ChildrenList::iterator i = _children.begin(); i != _children.end(); ++i) { -- cgit v1.2.3