[librsvg/rustification] rsvg-paint-server.c: Remove old gradient code; it is unused now
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/rustification] rsvg-paint-server.c: Remove old gradient code; it is unused now
- Date: Wed, 14 Dec 2016 03:29:25 +0000 (UTC)
commit cd7028edb9d080f16b5b4c8e4185c94f09ab6885
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Dec 13 19:16:28 2016 -0600
rsvg-paint-server.c: Remove old gradient code; it is unused now
rsvg-paint-server.c | 175 ---------------------------------------------------
1 files changed, 0 insertions(+), 175 deletions(-)
---
diff --git a/rsvg-paint-server.c b/rsvg-paint-server.c
index 4c801f6..7f81217 100644
--- a/rsvg-paint-server.c
+++ b/rsvg-paint-server.c
@@ -489,18 +489,6 @@ rsvg_new_pattern (const char *element_name)
return &pattern->super;
}
-static int
-hasstop (GPtrArray * lookin)
-{
- unsigned int i;
- for (i = 0; i < lookin->len; i++) {
- RsvgNode *node = g_ptr_array_index (lookin, i);
- if (rsvg_node_type (node) == RSVG_NODE_TYPE_STOP)
- return 1;
- }
- return 0;
-}
-
typedef const char * (* GetFallbackFn) (RsvgNode *node);
typedef void (* ApplyFallbackFn) (RsvgNode *node, RsvgNode *fallback_node);
@@ -534,169 +522,6 @@ resolve_fallbacks (RsvgDrawingCtx *ctx,
}
static const char *
-gradient_get_fallback (RsvgNode *node)
-{
- if (rsvg_node_type (node) == RSVG_NODE_TYPE_LINEAR_GRADIENT) {
- RsvgLinearGradient *g = (RsvgLinearGradient *) node;
- return g->fallback;
- } else if (rsvg_node_type (node) == RSVG_NODE_TYPE_RADIAL_GRADIENT) {
- RsvgRadialGradient *g = (RsvgRadialGradient *) node;
- return g->fallback;
- } else
- return NULL;
-}
-
-static void
-linear_gradient_apply_fallback (RsvgNode *node, RsvgNode *fallback_node)
-{
- RsvgLinearGradient *grad;
-
- g_assert (rsvg_node_type (node) == RSVG_NODE_TYPE_LINEAR_GRADIENT);
- grad = (RsvgLinearGradient *) node;
-
- if (rsvg_node_type (fallback_node) == RSVG_NODE_TYPE_LINEAR_GRADIENT) {
- RsvgLinearGradient *fallback = (RsvgLinearGradient *) fallback_node;
-
- if (!grad->hasx1 && fallback->hasx1) {
- grad->hasx1 = TRUE;
- grad->x1 = fallback->x1;
- }
- if (!grad->hasy1 && fallback->hasy1) {
- grad->hasy1 = TRUE;
- grad->y1 = fallback->y1;
- }
- if (!grad->hasx2 && fallback->hasx2) {
- grad->hasx2 = TRUE;
- grad->x2 = fallback->x2;
- }
- if (!grad->hasy2 && fallback->hasy2) {
- grad->hasy2 = TRUE;
- grad->y2 = fallback->y2;
- }
- if (!grad->hastransform && fallback->hastransform) {
- grad->hastransform = TRUE;
- grad->affine = fallback->affine;
- }
- if (!grad->hasspread && fallback->hasspread) {
- grad->hasspread = TRUE;
- grad->spread = fallback->spread;
- }
- if (!grad->hasbbox && fallback->hasbbox) {
- grad->hasbbox = TRUE;
- grad->obj_bbox = fallback->obj_bbox;
- }
- if (!hasstop (grad->super.children) && hasstop (fallback->super.children)) {
- grad->super.children = fallback->super.children;
- }
- } else if (rsvg_node_type (fallback_node) == RSVG_NODE_TYPE_RADIAL_GRADIENT) {
- RsvgRadialGradient *fallback = (RsvgRadialGradient *) fallback_node;
-
- if (!grad->hastransform && fallback->hastransform) {
- grad->hastransform = TRUE;
- grad->affine = fallback->affine;
- }
- if (!grad->hasspread && fallback->hasspread) {
- grad->hasspread = TRUE;
- grad->spread = fallback->spread;
- }
- if (!grad->hasbbox && fallback->hasbbox) {
- grad->hasbbox = TRUE;
- grad->obj_bbox = fallback->obj_bbox;
- }
- if (!hasstop (grad->super.children) && hasstop (fallback->super.children)) {
- grad->super.children = fallback->super.children;
- }
- }
-}
-
-void
-rsvg_linear_gradient_fix_fallback (RsvgDrawingCtx *ctx, RsvgLinearGradient * grad)
-{
- resolve_fallbacks (ctx,
- (RsvgNode *) grad,
- (RsvgNode *) grad,
- gradient_get_fallback,
- linear_gradient_apply_fallback);
-}
-
-static void
-radial_gradient_apply_fallback (RsvgNode *node, RsvgNode *fallback_node)
-{
- RsvgRadialGradient *grad;
-
- g_assert (rsvg_node_type (node) == RSVG_NODE_TYPE_RADIAL_GRADIENT);
- grad = (RsvgRadialGradient *) node;
-
- if (rsvg_node_type (fallback_node) == RSVG_NODE_TYPE_RADIAL_GRADIENT) {
- RsvgRadialGradient *fallback = (RsvgRadialGradient *) fallback_node;
-
- if (!grad->hascx && fallback->hascx) {
- grad->hascx = TRUE;
- grad->cx = fallback->cx;
- }
- if (!grad->hascy && fallback->hascy) {
- grad->hascy = TRUE;
- grad->cy = fallback->cy;
- }
- if (!grad->hasfx && fallback->hasfx) {
- grad->hasfx = TRUE;
- grad->fx = fallback->fx;
- }
- if (!grad->hasfy && fallback->hasfy) {
- grad->hasfy = TRUE;
- grad->fy = fallback->fy;
- }
- if (!grad->hasr && fallback->hasr) {
- grad->hasr = TRUE;
- grad->r = fallback->r;
- }
- if (!grad->hastransform && fallback->hastransform) {
- grad->hastransform = TRUE;
- grad->affine = fallback->affine;
- }
- if (!grad->hasspread && fallback->hasspread) {
- grad->hasspread = TRUE;
- grad->spread = fallback->spread;
- }
- if (!grad->hasbbox && fallback->hasbbox) {
- grad->hasbbox = TRUE;
- grad->obj_bbox = fallback->obj_bbox;
- }
- if (!hasstop (grad->super.children) && hasstop (fallback->super.children)) {
- grad->super.children = fallback->super.children;
- }
- } else if (rsvg_node_type (fallback_node) == RSVG_NODE_TYPE_LINEAR_GRADIENT) {
- RsvgLinearGradient *fallback = (RsvgLinearGradient *) fallback_node;
-
- if (!grad->hastransform && fallback->hastransform) {
- grad->hastransform = TRUE;
- grad->affine = fallback->affine;
- }
- if (!grad->hasspread && fallback->hasspread) {
- grad->hasspread = TRUE;
- grad->spread = fallback->spread;
- }
- if (!grad->hasbbox && fallback->hasbbox) {
- grad->hasbbox = TRUE;
- grad->obj_bbox = fallback->obj_bbox;
- }
- if (!hasstop (grad->super.children) && hasstop (fallback->super.children)) {
- grad->super.children = fallback->super.children;
- }
- }
-}
-
-void
-rsvg_radial_gradient_fix_fallback (RsvgDrawingCtx *ctx, RsvgRadialGradient * grad)
-{
- resolve_fallbacks (ctx,
- (RsvgNode *) grad,
- (RsvgNode *) grad,
- gradient_get_fallback,
- radial_gradient_apply_fallback);
-}
-
-static const char *
pattern_get_fallback (RsvgNode *node)
{
if (rsvg_node_type (node) == RSVG_NODE_TYPE_PATTERN) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]