summaryrefslogtreecommitdiffstats
path: root/src/display/drawing-surface.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2011-08-19 07:33:48 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2011-08-19 07:33:48 +0000
commita49c525365ff86ea1e22281d3a3b66d7ef0087c1 (patch)
tree91c9f6d2b29fc5e1141835c560a44dd0a5a6bd89 /src/display/drawing-surface.cpp
parentFix large memory leaks in the swatches panel (diff)
downloadinkscape-a49c525365ff86ea1e22281d3a3b66d7ef0087c1.tar.gz
inkscape-a49c525365ff86ea1e22281d3a3b66d7ef0087c1.zip
Fix rendering glitches appearing when filtered, cached groups have
filtered, cached children (bzr r10347.1.36)
Diffstat (limited to 'src/display/drawing-surface.cpp')
-rw-r--r--src/display/drawing-surface.cpp33
1 files changed, 29 insertions, 4 deletions
diff --git a/src/display/drawing-surface.cpp b/src/display/drawing-surface.cpp
index e5564f2b3..5cbfaa3fe 100644
--- a/src/display/drawing-surface.cpp
+++ b/src/display/drawing-surface.cpp
@@ -275,26 +275,51 @@ DrawingCache::paintFromCache(DrawingContext &ct, Geom::OptIntRect &area)
} else {
cairo_rectangle_int_t to_repaint;
cairo_region_get_extents(dirty_region, &to_repaint);
- *area = _convertRect(to_repaint);
+ area = _convertRect(to_repaint);
cairo_region_subtract_rectangle(cache_region, &to_repaint);
}
cairo_region_destroy(dirty_region);
if (!cairo_region_is_empty(cache_region)) {
- Inkscape::DrawingContext::Save save(ct);
int nr = cairo_region_num_rectangles(cache_region);
cairo_rectangle_int_t tmp;
for (int i = 0; i < nr; ++i) {
cairo_region_get_rectangle(cache_region, i, &tmp);
ct.rectangle(_convertRect(tmp));
}
- ct.clip();
ct.setSource(this);
- ct.paint();
+ ct.fill();
}
cairo_region_destroy(cache_region);
}
+// debugging utility
+void
+DrawingCache::_dumpCache(Geom::OptIntRect const &area)
+{
+ static int dumpnr = 0;
+ cairo_surface_t *surface = ink_cairo_surface_copy(_surface);
+ DrawingContext ct(surface, _origin);
+ if (!cairo_region_is_empty(_clean_region)) {
+ Inkscape::DrawingContext::Save save(ct);
+ int nr = cairo_region_num_rectangles(_clean_region);
+ cairo_rectangle_int_t tmp;
+ for (int i = 0; i < nr; ++i) {
+ cairo_region_get_rectangle(_clean_region, i, &tmp);
+ ct.rectangle(_convertRect(tmp));
+ }
+ ct.setSource(0,1,0,0.1);
+ ct.fill();
+ }
+ ct.rectangle(*area);
+ ct.setSource(1,0,0,0.1);
+ ct.fill();
+ char *fn = g_strdup_printf("dump%d.png", dumpnr++);
+ cairo_surface_write_to_png(surface, fn);
+ cairo_surface_destroy(surface);
+ g_free(fn);
+}
+
cairo_rectangle_int_t
DrawingCache::_convertRect(Geom::IntRect const &area)
{