1 /* cairo - a vector graphics library with display and print output
3 * Copyright © 2005 Red Hat, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it either under the terms of the GNU Lesser General Public
7 * License version 2.1 as published by the Free Software Foundation
8 * (the "LGPL") or, at your option, under the terms of the Mozilla
9 * Public License Version 1.1 (the "MPL"). If you do not alter this
10 * notice, a recipient may use your version of this file under either
11 * the MPL or the LGPL.
13 * You should have received a copy of the LGPL along with this library
14 * in the file COPYING-LGPL-2.1; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 * You should have received a copy of the MPL along with this library
17 * in the file COPYING-MPL-1.1
19 * The contents of this file are subject to the Mozilla Public License
20 * Version 1.1 (the "License"); you may not use this file except in
21 * compliance with the License. You may obtain a copy of the License at
22 * http://www.mozilla.org/MPL/
24 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
25 * OF ANY KIND, either express or implied. See the LGPL or the MPL for
26 * the specific language governing rights and limitations.
28 * The Original Code is the cairo graphics library.
30 * The Initial Developer of the Original Code is Red Hat, Inc.
33 * Kristian Høgsberg <krh@redhat.com>
36 #ifndef CAIRO_CLIP_PRIVATE_H
37 #define CAIRO_CLIP_PRIVATE_H
39 #include "cairo-types-private.h"
40 #include "cairo-compiler-private.h"
41 #include "cairo-path-fixed-private.h"
42 #include "cairo-reference-count-private.h"
44 extern const cairo_private cairo_rectangle_list_t _cairo_rectangles_nil
;
46 struct _cairo_clip_path
{
47 cairo_reference_count_t ref_count
;
48 cairo_path_fixed_t path
;
49 cairo_fill_rule_t fill_rule
;
51 cairo_antialias_t antialias
;
52 cairo_clip_path_t
*prev
;
56 cairo_clip_mode_t mode
;
58 cairo_bool_t all_clipped
;
61 * Mask-based clipping for cases where the backend
62 * clipping isn't sufficiently able.
64 * The rectangle here represents the
65 * portion of the destination surface that this
66 * clip surface maps to, it does not
67 * represent the extents of the clip region or
70 cairo_surface_t
*surface
;
71 cairo_rectangle_int_t surface_rect
;
73 * Surface clip serial number to store
74 * in the surface when this clip is set
78 * A clip region that can be placed in the surface
80 cairo_region_t
*region
;
82 * If the surface supports path clipping, we store the list of
83 * clipping paths that has been set here as a linked list.
85 cairo_clip_path_t
*path
;
89 _cairo_clip_init (cairo_clip_t
*clip
, cairo_surface_t
*target
);
91 cairo_private cairo_status_t
92 _cairo_clip_init_copy (cairo_clip_t
*clip
, cairo_clip_t
*other
);
94 cairo_private cairo_status_t
95 _cairo_clip_init_deep_copy (cairo_clip_t
*clip
,
97 cairo_surface_t
*target
);
100 _cairo_clip_reset (cairo_clip_t
*clip
);
102 cairo_private cairo_status_t
103 _cairo_clip_clip (cairo_clip_t
*clip
,
104 cairo_path_fixed_t
*path
,
105 cairo_fill_rule_t fill_rule
,
107 cairo_antialias_t antialias
,
108 cairo_surface_t
*target
);
110 cairo_private cairo_status_t
111 _cairo_clip_intersect_to_rectangle (cairo_clip_t
*clip
,
112 cairo_rectangle_int_t
*rectangle
);
114 cairo_private cairo_status_t
115 _cairo_clip_intersect_to_region (cairo_clip_t
*clip
,
116 cairo_region_t
*region
);
118 cairo_private cairo_status_t
119 _cairo_clip_combine_to_surface (cairo_clip_t
*clip
,
121 cairo_surface_t
*dst
,
124 const cairo_rectangle_int_t
*extents
);
127 _cairo_clip_translate (cairo_clip_t
*clip
,
131 cairo_private cairo_rectangle_list_t
*
132 _cairo_clip_copy_rectangle_list (cairo_clip_t
*clip
, cairo_gstate_t
*gstate
);
134 #endif /* CAIRO_CLIP_PRIVATE_H */