summaryrefslogtreecommitdiffstats
path: root/src/display/drawing-group.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-03-13 08:49:02 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-03-13 08:49:02 +0000
commitc424d555260e3b5fae3260173c6bc51d6e4d6f84 (patch)
tree5528d6d516bffe883bdba5870959227f38913c79 /src/display/drawing-group.cpp
parentupdate to trunk (diff)
parentProvide a toggle in the document properties to optionally turn off (diff)
downloadinkscape-c424d555260e3b5fae3260173c6bc51d6e4d6f84.tar.gz
inkscape-c424d555260e3b5fae3260173c6bc51d6e4d6f84.zip
update to trunk
(bzr r11950.1.293)
Diffstat (limited to 'src/display/drawing-group.cpp')
-rw-r--r--src/display/drawing-group.cpp17
1 files changed, 17 insertions, 0 deletions
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) {