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.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/fitz/res_shade.c b/fitz/res_shade.c
new file mode 100644
index 00000000..d1bd991e
--- /dev/null
+++ b/fitz/res_shade.c
@@ -0,0 +1,29 @@
+#include "fitz-base.h"
+#include "fitz-world.h"
+
+fz_shade *
+fz_keepshade(fz_shade *shade)
+{
+ shade->refs ++;
+ return shade;
+}
+
+void
+fz_dropshade(fz_shade *shade)
+{
+ if (shade && --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);
+}
+