summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2013-09-25 10:00:17 +0000
committertavmjong-free <tavmjong@free.fr>2013-09-25 10:00:17 +0000
commite6f45cc425825b4326f1c312a84e4845f84b599a (patch)
tree42439f21814dbf1870d8f5632fa63ba8eafbf543 /src
parentUpdating libdepixelize version (diff)
downloadinkscape-e6f45cc425825b4326f1c312a84e4845f84b599a.tar.gz
inkscape-e6f45cc425825b4326f1c312a84e4845f84b599a.zip
Proper fix for bug 1127103 (Filter changes color when object flipped.)
(bzr r12590)
Diffstat (limited to 'src')
-rw-r--r--src/display/nr-filter-slot.cpp18
-rw-r--r--src/style.cpp4
2 files changed, 9 insertions, 13 deletions
diff --git a/src/display/nr-filter-slot.cpp b/src/display/nr-filter-slot.cpp
index fe67972d6..755a30a74 100644
--- a/src/display/nr-filter-slot.cpp
+++ b/src/display/nr-filter-slot.cpp
@@ -83,11 +83,15 @@ cairo_surface_t *FilterSlot::getcairo(int slot_nr)
switch (slot_nr) {
case NR_FILTER_SOURCEGRAPHIC: {
cairo_surface_t *tr = _get_transformed_source_graphic();
+ // Assume all source graphics are sRGB
+ set_cairo_surface_ci( tr, SP_CSS_COLOR_INTERPOLATION_SRGB );
_set_internal(NR_FILTER_SOURCEGRAPHIC, tr);
cairo_surface_destroy(tr);
} break;
case NR_FILTER_BACKGROUNDIMAGE: {
cairo_surface_t *bg = _get_transformed_background();
+ // Assume all backgrounds are sRGB
+ set_cairo_surface_ci( bg, SP_CSS_COLOR_INTERPOLATION_SRGB );
_set_internal(NR_FILTER_BACKGROUNDIMAGE, bg);
cairo_surface_destroy(bg);
} break;
@@ -129,9 +133,6 @@ cairo_surface_t *FilterSlot::_get_transformed_source_graphic()
if (trans.isTranslation()) {
cairo_surface_reference(_source_graphic);
-
- // Assume all source graphics are sRGB
- set_cairo_surface_ci( _source_graphic, SP_CSS_COLOR_INTERPOLATION_SRGB );
return _source_graphic;
}
@@ -148,8 +149,6 @@ cairo_surface_t *FilterSlot::_get_transformed_source_graphic()
cairo_paint(tsg_ct);
cairo_destroy(tsg_ct);
- // Assume all source graphics are sRGB
- set_cairo_surface_ci( tsg, SP_CSS_COLOR_INTERPOLATION_SRGB );
return tsg;
}
@@ -177,17 +176,15 @@ cairo_surface_t *FilterSlot::_get_transformed_background()
tbg = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, _slot_w, _slot_h);
}
- // Assume all source graphics are sRGB
- set_cairo_surface_ci( tbg, SP_CSS_COLOR_INTERPOLATION_SRGB );
-
return tbg;
}
cairo_surface_t *FilterSlot::get_result(int res)
{
+ cairo_surface_t *result = getcairo(res);
+
Geom::Affine trans = _units.get_matrix_pb2display();
if (trans.isIdentity()) {
- cairo_surface_t *result = getcairo(res);
cairo_surface_reference(result);
return result;
}
@@ -196,12 +193,13 @@ cairo_surface_t *FilterSlot::get_result(int res)
cairo_surface_get_content(_source_graphic),
_source_graphic_area.width(),
_source_graphic_area.height());
+ copy_cairo_surface_ci( result, r );
cairo_t *r_ct = cairo_create(r);
cairo_translate(r_ct, -_source_graphic_area.left(), -_source_graphic_area.top());
ink_cairo_transform(r_ct, trans);
cairo_translate(r_ct, _slot_x, _slot_y);
- cairo_set_source_surface(r_ct, getcairo(res), 0, 0);
+ cairo_set_source_surface(r_ct, result, 0, 0);
cairo_set_operator(r_ct, CAIRO_OPERATOR_SOURCE);
cairo_paint(r_ct);
cairo_destroy(r_ct);
diff --git a/src/style.cpp b/src/style.cpp
index 03c90bc09..2807a7d9a 100644
--- a/src/style.cpp
+++ b/src/style.cpp
@@ -3170,9 +3170,7 @@ sp_style_clear(SPStyle *style)
style->color_interpolation.value = style->color_interpolation.computed = SP_CSS_COLOR_INTERPOLATION_SRGB;
style->color_interpolation_filters.set = FALSE;
style->color_interpolation_filters.inherit = FALSE;
- style->color_interpolation_filters.value = style->color_interpolation_filters.computed = SP_CSS_COLOR_INTERPOLATION_SRGB;
- //this line changed because rendering issues: Bug lp:1127103
- //style->color_interpolation_filters.value = style->color_interpolation_filters.computed = SP_CSS_COLOR_INTERPOLATION_LINEARRGB;
+ style->color_interpolation_filters.value = style->color_interpolation_filters.computed = SP_CSS_COLOR_INTERPOLATION_LINEARRGB;
style->fill.clear();