summaryrefslogtreecommitdiffstats
path: root/src/extension/internal/cairo-renderer.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2011-02-02 21:24:36 +0000
committerJohan Engelen <goejendaagh@zonnet.nl>2011-02-02 21:24:36 +0000
commit53933f5fea9d07d1ba6304b88439fba257ee8c34 (patch)
tree21f94cd05346fc1236751bb1db3e0850e5aece54 /src/extension/internal/cairo-renderer.cpp
parentTranslations. French translation minor update. (diff)
downloadinkscape-53933f5fea9d07d1ba6304b88439fba257ee8c34.tar.gz
inkscape-53933f5fea9d07d1ba6304b88439fba257ee8c34.zip
update to latest 2geom !
(bzr r10025)
Diffstat (limited to 'src/extension/internal/cairo-renderer.cpp')
-rw-r--r--src/extension/internal/cairo-renderer.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/extension/internal/cairo-renderer.cpp b/src/extension/internal/cairo-renderer.cpp
index bc3c6c484..015b3b2cb 100644
--- a/src/extension/internal/cairo-renderer.cpp
+++ b/src/extension/internal/cairo-renderer.cpp
@@ -157,7 +157,7 @@ static void sp_image_render(SPItem *item, CairoRenderContext *ctx);
static void sp_symbol_render(SPItem *item, CairoRenderContext *ctx);
static void sp_asbitmap_render(SPItem *item, CairoRenderContext *ctx);
-static void sp_shape_render_invoke_marker_rendering(SPMarker* marker, Geom::Matrix tr, SPStyle* style, CairoRenderContext *ctx)
+static void sp_shape_render_invoke_marker_rendering(SPMarker* marker, Geom::Affine tr, SPStyle* style, CairoRenderContext *ctx)
{
bool render = true;
if (marker->markerUnits == SP_MARKER_UNITS_STROKEWIDTH) {
@@ -170,8 +170,8 @@ static void sp_shape_render_invoke_marker_rendering(SPMarker* marker, Geom::Matr
if (render) {
SPItem* marker_item = sp_item_first_item_child (SP_OBJECT (marker));
- tr = (Geom::Matrix)marker_item->transform * (Geom::Matrix)marker->c2p * tr;
- Geom::Matrix old_tr = marker_item->transform;
+ tr = (Geom::Affine)marker_item->transform * (Geom::Affine)marker->c2p * tr;
+ Geom::Affine old_tr = marker_item->transform;
marker_item->transform = tr;
ctx->getRenderer()->renderItem (ctx, marker_item);
marker_item->transform = old_tr;
@@ -199,7 +199,7 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx)
for (int i = 0; i < 2; i++) { // SP_MARKER_LOC and SP_MARKER_LOC_START
if ( shape->marker[i] ) {
SPMarker* marker = SP_MARKER (shape->marker[i]);
- Geom::Matrix tr;
+ Geom::Affine tr;
if (marker->orient_auto) {
tr = sp_shape_marker_get_transform_at_start(pathv.begin()->front());
} else {
@@ -217,7 +217,7 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx)
if ( path_it != pathv.begin()
&& ! ((path_it == (pathv.end()-1)) && (path_it->size_default() == 0)) ) // if this is the last path and it is a moveto-only, there is no mid marker there
{
- Geom::Matrix tr;
+ Geom::Affine tr;
if (marker->orient_auto) {
tr = sp_shape_marker_get_transform_at_start(path_it->front());
} else {
@@ -234,7 +234,7 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx)
/* Put marker between curve_it1 and curve_it2.
* Loop to end_default (so including closing segment), because when a path is closed,
* there should be a midpoint marker between last segment and closing straight line segment */
- Geom::Matrix tr;
+ Geom::Affine tr;
if (marker->orient_auto) {
tr = sp_shape_marker_get_transform(*curve_it1, *curve_it2);
} else {
@@ -250,7 +250,7 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx)
// END position
if ( path_it != (pathv.end()-1) && !path_it->empty()) {
Geom::Curve const &lastcurve = path_it->back_default();
- Geom::Matrix tr;
+ Geom::Affine tr;
if (marker->orient_auto) {
tr = sp_shape_marker_get_transform_at_end(lastcurve);
} else {
@@ -274,7 +274,7 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx)
}
Geom::Curve const &lastcurve = path_last[index];
- Geom::Matrix tr;
+ Geom::Affine tr;
if (marker->orient_auto) {
tr = sp_shape_marker_get_transform_at_end(lastcurve);
} else {
@@ -309,7 +309,7 @@ static void sp_use_render(SPItem *item, CairoRenderContext *ctx)
CairoRenderer *renderer = ctx->getRenderer();
if ((use->x._set && use->x.computed != 0) || (use->y._set && use->y.computed != 0)) {
- Geom::Matrix tp(Geom::Translate(use->x.computed, use->y.computed));
+ Geom::Affine tp(Geom::Translate(use->x.computed, use->y.computed));
ctx->pushState();
ctx->transform(&tp);
translated = true;
@@ -368,7 +368,7 @@ static void sp_image_render(SPItem *item, CairoRenderContext *ctx)
Geom::Translate tp(x, y);
Geom::Scale s(width / (double)w, height / (double)h);
- Geom::Matrix t(s * tp);
+ Geom::Affine t(s * tp);
ctx->renderImage (px, w, h, rs, &t, SP_OBJECT_STYLE (item));
}
@@ -385,7 +385,7 @@ static void sp_symbol_render(SPItem *item, CairoRenderContext *ctx)
// apply viewbox if set
if (0 /*symbol->viewBox_set*/) {
- Geom::Matrix vb2user;
+ Geom::Affine vb2user;
double x, y, width, height;
double view_width, view_height;
x = 0.0;
@@ -423,7 +423,7 @@ static void sp_root_render(SPItem *item, CairoRenderContext *ctx)
ctx->pushState();
renderer->setStateForItem(ctx, item);
- Geom::Matrix tempmat (root->c2p);
+ Geom::Affine tempmat (root->c2p);
ctx->transform(&tempmat);
sp_group_render(item, ctx);
ctx->popState();
@@ -492,12 +492,12 @@ static void sp_asbitmap_render(SPItem *item, CairoRenderContext *ctx)
// Calculate the matrix that will be applied to the image so that it exactly overlaps the source objects
// Matix to put bitmap in correct place on document
- Geom::Matrix t_on_document = (Geom::Matrix)(Geom::Scale (scale_x, -scale_y)) *
- (Geom::Matrix)(Geom::Translate (shift_x, shift_y));
+ Geom::Affine t_on_document = (Geom::Affine)(Geom::Scale (scale_x, -scale_y)) *
+ (Geom::Affine)(Geom::Translate (shift_x, shift_y));
// ctx matrix already includes item transformation. We must substract.
- Geom::Matrix t_item = item->i2d_affine ();
- Geom::Matrix t = t_on_document * t_item.inverse();
+ Geom::Affine t_item = item->i2d_affine ();
+ Geom::Affine t = t_on_document * t_item.inverse();
// Do the export
SPDocument *document = SP_OBJECT(item)->document;
@@ -570,7 +570,7 @@ CairoRenderer::setStateForItem(CairoRenderContext *ctx, SPItem const *item)
CairoRenderState *state = ctx->getCurrentState();
state->clip_path = item->clip_ref->getObject();
state->mask = item->mask_ref->getObject();
- state->item_transform = Geom::Matrix (item->transform);
+ state->item_transform = Geom::Affine (item->transform);
// If parent_has_userspace is true the parent state's transform
// has to be used for the mask's/clippath's context.
@@ -601,7 +601,7 @@ CairoRenderer::renderItem(CairoRenderContext *ctx, SPItem *item)
state->merge_opacity = FALSE;
ctx->pushLayer();
}
- Geom::Matrix tempmat (item->transform);
+ Geom::Affine tempmat (item->transform);
ctx->transform(&tempmat);
sp_item_invoke_render(item, ctx);
@@ -652,7 +652,7 @@ CairoRenderer::setupDocument(CairoRenderContext *ctx, SPDocument *doc, bool page
if (ctx->_vector_based_target)
high *= PT_PER_PX;
- Geom::Matrix tp(Geom::Translate(-d.x0 * (ctx->_vector_based_target ? PX_PER_PT : 1.0),
+ Geom::Affine tp(Geom::Translate(-d.x0 * (ctx->_vector_based_target ? PX_PER_PT : 1.0),
(d.y1 - high) * (ctx->_vector_based_target ? PX_PER_PT : 1.0)));
ctx->transform(&tp);
}
@@ -674,11 +674,11 @@ CairoRenderer::applyClipPath(CairoRenderContext *ctx, SPClipPath const *cp)
CairoRenderContext::CairoRenderMode saved_mode = ctx->getRenderMode();
ctx->setRenderMode(CairoRenderContext::RENDER_MODE_CLIP);
- Geom::Matrix saved_ctm;
+ Geom::Affine saved_ctm;
if (cp->clipPathUnits == SP_CONTENT_UNITS_OBJECTBOUNDINGBOX) {
//SP_PRINT_DRECT("clipd", cp->display->bbox);
NRRect clip_bbox(cp->display->bbox);
- Geom::Matrix t(Geom::Scale(clip_bbox.x1 - clip_bbox.x0, clip_bbox.y1 - clip_bbox.y0));
+ Geom::Affine t(Geom::Scale(clip_bbox.x1 - clip_bbox.x0, clip_bbox.y1 - clip_bbox.y0));
t[4] = clip_bbox.x0;
t[5] = clip_bbox.y0;
t *= ctx->getCurrentState()->transform;
@@ -693,7 +693,7 @@ CairoRenderer::applyClipPath(CairoRenderContext *ctx, SPClipPath const *cp)
SPItem *item = SP_ITEM(child);
// combine transform of the item in clippath and the item using clippath:
- Geom::Matrix tempmat (item->transform);
+ Geom::Affine tempmat (item->transform);
tempmat = tempmat * (ctx->getCurrentState()->item_transform);
// render this item in clippath
@@ -730,7 +730,7 @@ CairoRenderer::applyMask(CairoRenderContext *ctx, SPMask const *mask)
NRRect mask_bbox(mask->display->bbox);
// TODO: should the bbox be transformed if maskUnits != userSpaceOnUse ?
if (mask->maskContentUnits == SP_CONTENT_UNITS_OBJECTBOUNDINGBOX) {
- Geom::Matrix t(Geom::Scale(mask_bbox.x1 - mask_bbox.x0, mask_bbox.y1 - mask_bbox.y0));
+ Geom::Affine t(Geom::Scale(mask_bbox.x1 - mask_bbox.x0, mask_bbox.y1 - mask_bbox.y0));
t[4] = mask_bbox.x0;
t[5] = mask_bbox.y0;
t *= ctx->getCurrentState()->transform;