summaryrefslogtreecommitdiff
path: root/fitz/res_shade.c
diff options
context:
space:
mode:
Diffstat (limited to 'fitz/res_shade.c')
-rw-r--r--fitz/res_shade.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/fitz/res_shade.c b/fitz/res_shade.c
new file mode 100644
index 00000000..67a64e4e
--- /dev/null
+++ b/fitz/res_shade.c
@@ -0,0 +1,28 @@
+#include <fitz.h>
+
+fz_shade *
+fz_keepshade(fz_shade *shade)
+{
+ shade->refs ++;
+ return shade;
+}
+
+void
+fz_dropshade(fz_shade *shade)
+{
+ if (--shade->refs == 0)
+ {
+ if (shade->cs)
+ fz_dropcolorspace(shade->cs);
+ fz_free(shade->mesh);
+ fz_free(shade);
+ }
+}
+
+fz_rect
+fz_boundshade(fz_shade *shade, fz_matrix ctm)
+{
+ ctm = fz_concat(shade->matrix, ctm);
+ return fz_transformaabb(ctm, shade->bbox);
+}
+