summaryrefslogtreecommitdiff
path: root/xps/ghostxps.h
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2007-08-07 14:56:25 +0000
committerTor Andersson <tor.andersson@artifex.com>2007-08-07 14:56:25 +0000
commiteedfdd2568c46d64b2b85b6152bf3411cb99a91b (patch)
tree77e1614083625a698405d11f666df7b6c06cdad8 /xps/ghostxps.h
parent3f85518f823c419b987972610576dabad152ffef (diff)
Keep track of the current clip region bounding box. Use the proper bounding box when creating transparency groups.
git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@2879 06663e23-700e-0410-b217-a244a6096597
Diffstat (limited to 'xps/ghostxps.h')
-rw-r--r--xps/ghostxps.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/xps/ghostxps.h b/xps/ghostxps.h
index 50613bb54..c0ee53f16 100644
--- a/xps/ghostxps.h
+++ b/xps/ghostxps.h
@@ -52,6 +52,16 @@
#define dpf
#endif
+#ifndef MIN
+#define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
+#ifndef MAX
+#define MAX(a,b) ((a) < (b) ? (b) : (a))
+#endif
+#ifndef ABS
+#define ABS(a) ((a) < 0 ? -(a) : (a))
+#endif
+
/*
* Forward declarations.
*/
@@ -178,6 +188,13 @@ struct xps_context_s
* 1=nonzero, 0=evenodd
*/
int fill_rule;
+
+ /* We often need the bounding box for the current
+ * area of the page affected by drawing operations.
+ * We keep these bounds updated every time we
+ * clip. The coordinates are in device space.
+ */
+ gs_rect bounds;
};
struct xps_part_s
@@ -323,8 +340,10 @@ int xps_parse_brush(xps_context_t *ctx, xps_resource_t *dict, xps_item_t *node);
int xps_parse_element(xps_context_t *ctx, xps_resource_t *dict, xps_item_t *node);
void xps_set_color(xps_context_t *ctx, float *argb);
-int xps_clip(xps_context_t *ctx);
+int xps_clip(xps_context_t *ctx, gs_rect *saved_bounds);
+int xps_unclip(xps_context_t *ctx, gs_rect *saved_bounds);
int xps_fill(xps_context_t *ctx);
+void xps_bounds_in_user_space(xps_context_t *ctx, gs_rect *user);
/*
* Static XML resources.