diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2013-09-13 21:14:45 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2013-09-13 21:14:45 +0000 |
| commit | 0697088a2e3fbb3f7777db721e8c5e4661311dbe (patch) | |
| tree | f7171656bbb4330a5aef0c30b01981d64196993d /src/display/drawing-image.cpp | |
| parent | Use g_match_info_free instead of g_match_info_unref (diff) | |
| download | inkscape-0697088a2e3fbb3f7777db721e8c5e4661311dbe.tar.gz inkscape-0697088a2e3fbb3f7777db721e8c5e4661311dbe.zip | |
Improve the functions which create GdkPixbuf from Cairo surface
and vice versa. Simplifies some code.
Also introduce proper refcounting into svg_preview_cache.cpp
and fix its users.
(bzr r12512)
Diffstat (limited to 'src/display/drawing-image.cpp')
| -rw-r--r-- | src/display/drawing-image.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/display/drawing-image.cpp b/src/display/drawing-image.cpp index bdb7c15b0..b94d48774 100644 --- a/src/display/drawing-image.cpp +++ b/src/display/drawing-image.cpp @@ -22,7 +22,7 @@ namespace Inkscape { DrawingImage::DrawingImage(Drawing &drawing) : DrawingItem(drawing) , _pixbuf(NULL) - , _surface(NULL) + , _surface(NULL) // this is owned by _pixbuf! , _style(NULL) , _new_surface(NULL) {} @@ -33,7 +33,6 @@ DrawingImage::~DrawingImage() sp_style_unref(_style); if (_pixbuf) { if (_new_surface) cairo_surface_destroy(_new_surface); - cairo_surface_destroy(_surface); g_object_unref(_pixbuf); } } @@ -50,7 +49,7 @@ DrawingImage::setARGB32Pixbuf(GdkPixbuf *pb) cairo_surface_destroy(_surface); } _pixbuf = pb; - _surface = pb ? ink_cairo_surface_create_for_argb32_pixbuf(pb) : NULL; + _surface = pb ? ink_cairo_surface_get_for_pixbuf(pb) : NULL; _markForUpdate(STATE_ALL, false); } |
