summaryrefslogtreecommitdiffstats
path: root/src/display
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2011-07-13 22:21:37 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2011-07-13 22:21:37 +0000
commit0d6be77f2af241e47d0df3f19619db85ca8127e7 (patch)
tree510d535eb41530772c79218ece39023d85d42c93 /src/display
parentFix crashes during offscreen rendering, part 1 (diff)
parentFix crashes in print preview (diff)
downloadinkscape-0d6be77f2af241e47d0df3f19619db85ca8127e7.tar.gz
inkscape-0d6be77f2af241e47d0df3f19619db85ca8127e7.zip
Merge from trunk to pull in fix for LP #806105
(bzr r10347.1.13)
Diffstat (limited to 'src/display')
-rw-r--r--src/display/cairo-utils.cpp12
-rw-r--r--src/display/cairo-utils.h1
-rw-r--r--src/display/nr-arena-glyphs.cpp12
-rw-r--r--src/display/sp-canvas.cpp10
4 files changed, 22 insertions, 13 deletions
diff --git a/src/display/cairo-utils.cpp b/src/display/cairo-utils.cpp
index 90f65c33e..8b75f09a6 100644
--- a/src/display/cairo-utils.cpp
+++ b/src/display/cairo-utils.cpp
@@ -345,6 +345,18 @@ ink_cairo_surface_create_for_argb32_pixbuf(GdkPixbuf *pb)
return pbs;
}
+/** @brief Cleanup function for GdkPixbuf.
+ * This function should be passed as the GdkPixbufDestroyNotify parameter
+ * to gdk_pixbuf_new_from_data when creating a GdkPixbuf backed by
+ * a Cairo surface.
+ */
+void
+ink_cairo_pixbuf_cleanup(guchar *pixels, void *data)
+{
+ cairo_surface_t *surface = reinterpret_cast<cairo_surface_t*>(data);
+ cairo_surface_destroy(surface);
+}
+
/** @brief Create an exact copy of a surface.
* Creates a surface that has the same type, content type, dimensions and contents
* as the specified surface. */
diff --git a/src/display/cairo-utils.h b/src/display/cairo-utils.h
index 0c2ac2dd6..1de88785d 100644
--- a/src/display/cairo-utils.h
+++ b/src/display/cairo-utils.h
@@ -106,6 +106,7 @@ void convert_pixels_argb32_to_pixbuf(guchar *data, int w, int h, int rs);
void convert_pixbuf_normal_to_argb32(GdkPixbuf *);
void convert_pixbuf_argb32_to_normal(GdkPixbuf *);
cairo_surface_t *ink_cairo_surface_create_for_argb32_pixbuf(GdkPixbuf *pb);
+void ink_cairo_pixbuf_cleanup(guchar *pixels, void *surface);
G_GNUC_CONST guint32 argb32_from_pixbuf(guint32 in);
G_GNUC_CONST guint32 pixbuf_from_argb32(guint32 in);
diff --git a/src/display/nr-arena-glyphs.cpp b/src/display/nr-arena-glyphs.cpp
index b76e87a78..d09f66a2f 100644
--- a/src/display/nr-arena-glyphs.cpp
+++ b/src/display/nr-arena-glyphs.cpp
@@ -295,28 +295,26 @@ nr_arena_glyphs_group_render(cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPi
}
if (item->arena->rendermode == Inkscape::RENDERMODE_OUTLINE) {
-
+ cairo_save(ct);
guint32 rgba = item->arena->outlinecolor;
ink_cairo_set_source_rgba32(ct, rgba);
cairo_set_tolerance(ct, 1.25); // low quality, but good enough for outline mode
-
- NRRect temp(area->x0, area->y0, area->x1, area->y1);
- Geom::OptRect area_2geom = temp.upgrade_2geom();
+ cairo_new_path(ct);
+ ink_cairo_transform(ct, ggroup->ctm);
for (child = group->children; child != NULL; child = child->next) {
NRArenaGlyphs *g = NR_ARENA_GLYPHS(child);
Geom::PathVector const * pathv = g->font->PathVector(g->glyph);
- Geom::Affine transform = g->g_transform * group->ctm;
+ Geom::Affine transform = g->g_transform;
- cairo_new_path(ct);
cairo_save(ct);
ink_cairo_transform(ct, transform);
feed_pathvector_to_cairo (ct, *pathv);
cairo_fill(ct);
cairo_restore(ct);
}
-
+ cairo_restore(ct);
return item->state;
}
diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp
index 29729ef6c..f6446bdd7 100644
--- a/src/display/sp-canvas.cpp
+++ b/src/display/sp-canvas.cpp
@@ -30,9 +30,7 @@
#include "preferences.h"
#include "inkscape.h"
#include "sodipodi-ctrlrect.h"
-#if ENABLE_LCMS
-#include "color-profile-fns.h"
-#endif // ENABLE_LCMS
+#include "cms-system.h"
#include "display/rendermode.h"
#include "display/cairo-utils.h"
#include "debug/gdk-event-latency-tracker.h"
@@ -1696,9 +1694,9 @@ static void sp_canvas_paint_single_buffer(SPCanvas *canvas, int x0, int y0, int
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
bool fromDisplay = prefs->getBool( "/options/displayprofile/from_display");
if ( fromDisplay ) {
- transf = Inkscape::colorprofile_get_display_per( canvas->cms_key ? *(canvas->cms_key) : "" );
+ transf = Inkscape::CMSSystem::getDisplayPer( canvas->cms_key ? *(canvas->cms_key) : "" );
} else {
- transf = Inkscape::colorprofile_get_display_transform();
+ transf = Inkscape::CMSSystem::getDisplayTransform();
}
if (transf) {
@@ -1707,7 +1705,7 @@ static void sp_canvas_paint_single_buffer(SPCanvas *canvas, int x0, int y0, int
int stride = cairo_image_surface_get_stride(imgs);
for (int i=0; i<h; ++i) {
unsigned char *row = px + i*stride;
- cmsDoTransform(transf, row, row, w);
+ Inkscape::CMSSystem::doTransform(transf, row, row, w);
}
cairo_surface_mark_dirty(imgs);
}