summaryrefslogtreecommitdiffstats
path: root/src/extension/internal/cairo-render-context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/extension/internal/cairo-render-context.cpp')
-rw-r--r--src/extension/internal/cairo-render-context.cpp29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp
index 5d8b0e076..e65752c84 100644
--- a/src/extension/internal/cairo-render-context.cpp
+++ b/src/extension/internal/cairo-render-context.cpp
@@ -42,7 +42,7 @@
#include "sp-hatch.h"
#include "sp-linear-gradient.h"
#include "sp-radial-gradient.h"
-#include "sp-mesh.h"
+#include "sp-mesh-gradient.h"
#include "sp-pattern.h"
#include "sp-mask.h"
#include "sp-clippath.h"
@@ -986,13 +986,12 @@ void CairoRenderContext::popState(void)
static bool pattern_hasItemChildren(SPPattern *pat)
{
- bool hasItems = false;
- for ( SPObject *child = pat->firstChild() ; child && !hasItems; child = child->getNext() ) {
- if (SP_IS_ITEM (child)) {
- hasItems = true;
+ for (auto& child: pat->children) {
+ if (SP_IS_ITEM (&child)) {
+ return true;
}
}
- return hasItems;
+ return false;
}
cairo_pattern_t*
@@ -1087,10 +1086,10 @@ CairoRenderContext::_createPatternPainter(SPPaintServer const *const paintserver
// show items and render them
for (SPPattern *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) {
if (pat_i && SP_IS_OBJECT(pat_i) && pattern_hasItemChildren(pat_i)) { // find the first one with item children
- for ( SPObject *child = pat_i->firstChild() ; child; child = child->getNext() ) {
- if (SP_IS_ITEM(child)) {
- SP_ITEM(child)->invoke_show(drawing, dkey, SP_ITEM_REFERENCE_FLAGS);
- _renderer->renderItem(pattern_ctx, SP_ITEM(child));
+ for (auto& child: pat_i->children) {
+ if (SP_IS_ITEM(&child)) {
+ SP_ITEM(&child)->invoke_show(drawing, dkey, SP_ITEM_REFERENCE_FLAGS);
+ _renderer->renderItem(pattern_ctx, SP_ITEM(&child));
}
}
break; // do not go further up the chain if children are found
@@ -1116,9 +1115,9 @@ CairoRenderContext::_createPatternPainter(SPPaintServer const *const paintserver
// hide all items
for (SPPattern *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) {
if (pat_i && SP_IS_OBJECT(pat_i) && pattern_hasItemChildren(pat_i)) { // find the first one with item children
- for ( SPObject *child = pat_i->firstChild() ; child; child = child->getNext() ) {
- if (SP_IS_ITEM(child)) {
- SP_ITEM(child)->invoke_hide(dkey);
+ for (auto& child: pat_i->children) {
+ if (SP_IS_ITEM(&child)) {
+ SP_ITEM(&child)->invoke_hide(dkey);
}
}
break; // do not go further up the chain if children are found
@@ -1258,8 +1257,8 @@ CairoRenderContext::_createPatternForPaintServer(SPPaintServer const *const pain
sp_color_get_rgb_floatv(&rg->vector.stops[i].color, rgb);
cairo_pattern_add_color_stop_rgba(pattern, rg->vector.stops[i].offset, rgb[0], rgb[1], rgb[2], rg->vector.stops[i].opacity * alpha);
}
- } else if (SP_IS_MESH (paintserver)) {
- SPMesh *mg = SP_MESH(paintserver);
+ } else if (SP_IS_MESHGRADIENT (paintserver)) {
+ SPMeshGradient *mg = SP_MESHGRADIENT(paintserver);
pattern = mg->pattern_new(_cr, pbox, 1.0);
} else if (SP_IS_PATTERN (paintserver)) {