Commit f1314e48 authored by Caleb Michael Moore's avatar Caleb Michael Moore

clipping in cairo

parent b49654fd
2005-10-08 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-cairo-clip.c/.h: new files. Added clipping in cairo backend.
2005-10-08 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-art-paint-server.c: stopped strangely transformed gradients from getting flipped.
......
......@@ -96,7 +96,9 @@ librsvg_2_cairo_la_SOURCES = \
rsvg-cairo-draw.c \
rsvg-cairo-draw.h \
rsvg-cairo-render.c \
rsvg-cairo-render.h
rsvg-cairo-render.h \
rsvg-cairo-clip.h \
rsvg-cairo-clip.c
librsvg_2_cairo_la_LDFLAGS = -version-info @VERSION_INFO@ -no-undefined -export-dynamic
librsvg_2_cairo_la_LIBADD = librsvg-2-base.la $(LIBGNOME_VFS_LIBS) $(LIBGSF_LIBS) $(LIBCROCO_LIBS) $(LIBRSVG_LIBS) $(FREETYPE_LIBS) $(CAIRO_LIBS)
......
/* vim: set sw=4: -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/*
rsvg-shapes.c: Draw shapes with libart
rsvg-shapes.c: Draw shapes with cairo
Copyright (C) 2000 Eazel, Inc.
Copyright (C) 2002 Dom Lachowicz <cinamod@hotmail.com>
Copyright (C) 2005 Dom Lachowicz <cinamod@hotmail.com>
Copyright (C) 2005 Caleb Moore <c.moore@student.unsw.edu.au>
Copyright (C) 2005 Red Hat, Inc.
This program is free software; you can redistribute it and/or
......@@ -21,14 +21,14 @@
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Raph Levien <raph@artofcode.com>,
Dom Lachowicz <cinamod@hotmail.com>,
Authors: Dom Lachowicz <cinamod@hotmail.com>,
Caleb Moore <c.moore@student.unsw.edu.au>
Carl Worth <cworth@cworth.org>
*/
#include "rsvg-cairo-draw.h"
#include "rsvg-cairo-render.h"
#include "rsvg-cairo-clip.h"
#include "rsvg-styles.h"
#include "rsvg-bpath-util.h"
#include "rsvg-path.h"
......@@ -241,8 +241,8 @@ rsvg_cairo_render_path (RsvgDrawingCtx *ctx, const RsvgBpathDef *bpath_def)
int virgin = 1, need_tmpbuf = 0;
RsvgCairoBbox bbox;
need_tmpbuf = (state->fill != NULL) && (state->stroke != NULL) &&
state->opacity != 0xff;
need_tmpbuf = ((state->fill != NULL) && (state->stroke != NULL) &&
state->opacity != 0xff) || state->clip_path_ref;
if (need_tmpbuf)
rsvg_cairo_push_discrete_layer (ctx);
......@@ -465,6 +465,8 @@ rsvg_cairo_push_discrete_layer (RsvgDrawingCtx *ctx)
if (state->opacity == 0xFF){
cairo_save(render->cr); /* only for the clipping stuff
seems like a bad idea, I dunno*/
if (state->clip_path_ref)
rsvg_cairo_clip(ctx, state->clip_path_ref);
return;
}
surface = cairo_surface_create_similar (cairo_get_target (render->cr),
......@@ -476,6 +478,8 @@ rsvg_cairo_push_discrete_layer (RsvgDrawingCtx *ctx)
render->cr_stack = g_list_prepend(render->cr_stack, render->cr);
render->cr = child_cr;
cairo_save(render->cr);
if (state->clip_path_ref)
rsvg_cairo_clip(ctx, state->clip_path_ref);
}
void
......
......@@ -32,9 +32,9 @@
G_BEGIN_DECLS
typedef struct RsvgCairoRender RsvgCairoRender;
typedef struct _RsvgCairoRender RsvgCairoRender;
struct RsvgCairoRender {
struct _RsvgCairoRender {
RsvgRender super;
cairo_t *cr;
double width;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment