Skip to content

Commit ef97e8c

Browse files
committedMay 20, 2020
[symbology] When rendering features, split the geometry fetching
and preparation stage from the symbol layer rendering stage, and ensure that QgsSymbolLayer::startFeatureRender and ::stopFeatureRender is correctly called in the right sequence when rendering multi-layer symbols This fixes issues with symbol layers which rely on startFeatureRender and stopFeatureRender to correctly render, e.g. the Random Marker Fill symbol layer. Before this fix, the logic looked like: - for every symbol layer in the symbol, call startFeatureRender - for each part in polygon, prepare the part geometry and then render each symbol layer - for every symbol layer in the symbol, call stopFeatureRender The issue with this approach is that symbol layers which defer rendering to the stopFeatureRender stage are always rendered after ALL other symbol layers in the symbol, regardless of the actual order of the symbol layers. Ultimately this causes Random Marker Fill layers to always render on the top of symbols. The new logic is: - for each part in polygon, prepare the geometry and store the result - for each symbol layer in the symbol: - call startFeatureRender - render the layer using each of the previously prepared parts - call stopFeatureRender This results in correct stacking of the random marker fill in multi layer symbols, because the stopFeatureRender call is correctly called before the next layer's startFeatureRender and renderPolygon calls Also, use QVector instead of QList for rings for improved efficiency
1 parent ea4f2bb commit ef97e8c

20 files changed

+277
-117
lines changed
 

‎python/core/auto_generated/symbology/qgsfillsymbollayer.sip.in

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Caller takes ownership of the returned symbol layer.
4545
virtual void stopRender( QgsSymbolRenderContext &context );
4646

4747

48-
virtual void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
48+
virtual void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context );
4949

5050

5151
virtual QgsStringMap properties() const;
@@ -214,7 +214,7 @@ Caller takes ownership of the returned symbol layer.
214214
virtual void stopRender( QgsSymbolRenderContext &context );
215215

216216

217-
virtual void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
217+
virtual void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context );
218218

219219

220220
virtual QgsStringMap properties() const;
@@ -374,7 +374,7 @@ Caller takes ownership of the returned symbol layer.
374374
virtual void stopRender( QgsSymbolRenderContext &context );
375375

376376

377-
virtual void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
377+
virtual void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context );
378378

379379

380380
virtual QgsStringMap properties() const;
@@ -686,7 +686,7 @@ Base class for polygon renderers generating texture images*
686686
public:
687687

688688
QgsImageFillSymbolLayer();
689-
virtual void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
689+
virtual void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context );
690690

691691

692692
virtual QgsSymbol *subSymbol();
@@ -806,7 +806,7 @@ Used internally when reading/writing symbols.
806806

807807
virtual QString layerType() const;
808808

809-
virtual void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
809+
virtual void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context );
810810

811811
virtual void startRender( QgsSymbolRenderContext &context );
812812

@@ -1952,7 +1952,7 @@ Caller takes ownership of the returned symbol layer.
19521952

19531953
virtual void stopRender( QgsSymbolRenderContext &context );
19541954

1955-
virtual void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
1955+
virtual void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context );
19561956

19571957
virtual QgsStringMap properties() const;
19581958

@@ -2139,7 +2139,7 @@ Caller takes ownership of the returned symbol layer.
21392139
virtual void stopRender( QgsSymbolRenderContext &context );
21402140

21412141

2142-
virtual void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
2142+
virtual void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context );
21432143

21442144

21452145
virtual QgsStringMap properties() const;

‎python/core/auto_generated/symbology/qgslinesymbollayer.sip.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Creates a new QgsSimpleLineSymbolLayer from an SLD XML DOM ``element``.
5252

5353
virtual void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context );
5454

55-
virtual void renderPolygonStroke( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
55+
virtual void renderPolygonStroke( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context );
5656

5757
virtual QgsStringMap properties() const;
5858

@@ -506,7 +506,7 @@ calculating individual symbol angles.
506506

507507
virtual void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context ) ${SIP_FINAL};
508508

509-
virtual void renderPolygonStroke( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) ${SIP_FINAL};
509+
virtual void renderPolygonStroke( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) ${SIP_FINAL};
510510

511511
virtual QgsUnitTypes::RenderUnit outputUnit() const ${SIP_FINAL};
512512

‎python/core/auto_generated/symbology/qgssymbol.sip.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ If ``correctRingOrientation`` is ``True`` then the ring will be oriented to matc
548548
clockwise for exterior rings and counter-clockwise for interior rings.
549549
%End
550550

551-
static void _getPolygon( QPolygonF &pts, QList<QPolygonF> &holes, QgsRenderContext &context, const QgsPolygon &polygon, bool clipToExtent = true, bool correctRingOrientation = false );
551+
static void _getPolygon( QPolygonF &pts, QVector<QPolygonF> &holes, QgsRenderContext &context, const QgsPolygon &polygon, bool clipToExtent = true, bool correctRingOrientation = false );
552552
%Docstring
553553
Creates a polygon in screen coordinates from a QgsPolygonXYin map coordinates
554554

@@ -1206,7 +1206,7 @@ Ownership of the ``layers`` are transferred to the symbol.
12061206
%End
12071207
void setAngle( double angle );
12081208

1209-
void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
1209+
void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
12101210
%Docstring
12111211
Renders the symbol using the given render ``context``.
12121212

‎python/core/auto_generated/symbology/qgssymbollayer.sip.in

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ Renders the line symbol layer along the line joining ``points``, using the given
979979
.. seealso:: :py:func:`renderPolygonStroke`
980980
%End
981981

982-
virtual void renderPolygonStroke( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
982+
virtual void renderPolygonStroke( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context );
983983
%Docstring
984984
Renders the line symbol layer along the outline of polygon, using the given render ``context``.
985985

@@ -1167,9 +1167,11 @@ class QgsFillSymbolLayer : QgsSymbolLayer
11671167

11681168

11691169

1170-
virtual void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) = 0;
1170+
virtual void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) = 0;
11711171
%Docstring
1172-
QgsFillSymbolLayer cannot be copied
1172+
Renders the fill symbol layer for the polygon whose outer ring is defined by ``points``, using the given render ``context``.
1173+
1174+
The ``rings`` argument optionally specifies a list of polygon rings to render as holes.
11731175
%End
11741176

11751177
virtual void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size );
@@ -1180,7 +1182,7 @@ QgsFillSymbolLayer cannot be copied
11801182

11811183
protected:
11821184
QgsFillSymbolLayer( bool locked = false );
1183-
void _renderPolygon( QPainter *p, const QPolygonF &points, const QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
1185+
void _renderPolygon( QPainter *p, const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context );
11841186
%Docstring
11851187
Default method to render polygon
11861188
%End

‎python/core/auto_generated/symbology/qgssymbollayerutils.sip.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ Determines an SVG symbol's name from its ``path``.
713713
Calculate the centroid point of a QPolygonF
714714
%End
715715

716-
static QPointF polygonPointOnSurface( const QPolygonF &points, QList<QPolygonF> *rings = 0 );
716+
static QPointF polygonPointOnSurface( const QPolygonF &points, const QVector<QPolygonF> *rings = 0 );
717717
%Docstring
718718
Calculate a point on the surface of a QPolygonF
719719
%End

‎src/core/annotations/qgsannotation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ void QgsAnnotation::drawFrame( QgsRenderContext &context ) const
358358

359359
QPolygonF poly;
360360
poly.reserve( 9 + ( mHasFixedMapPosition ? 3 : 0 ) );
361-
QList<QPolygonF> rings; //empty list
361+
QVector<QPolygonF> rings; //empty list
362362
for ( int i = 0; i < 4; ++i )
363363
{
364364
QLineF currentSegment = segment( i, &context );

‎src/core/layout/qgslayoutitemmapoverview.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void QgsLayoutItemMapOverview::draw( QPainter *painter )
127127
QPolygonF intersectPolygon;
128128
intersectPolygon = mapTransform.map( intersectExtent );
129129

130-
QList<QPolygonF> rings; //empty list
130+
QVector<QPolygonF> rings; //empty list
131131
if ( !mInverted )
132132
{
133133
//Render the intersecting map extent

‎src/core/layout/qgslayoutitempage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ void QgsLayoutItemPage::draw( QgsLayoutItemRenderContext &context )
280280
// round up
281281
QPolygonF pagePolygon = QPolygonF( QRectF( maxBleedPixels, maxBleedPixels,
282282
std::ceil( rect().width() * scale ) - 2 * maxBleedPixels, std::ceil( rect().height() * scale ) - 2 * maxBleedPixels ) );
283-
QList<QPolygonF> rings; //empty list
283+
QVector<QPolygonF> rings; //empty list
284284

285285
symbol->renderPolygon( pagePolygon, &rings, nullptr, context.renderContext() );
286286
symbol->stopRender( context.renderContext() );

‎src/core/layout/qgslayoutitempolygon.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void QgsLayoutItemPolygon::_draw( QgsLayoutItemRenderContext &context, const QSt
117117
double scale = context.renderContext().convertToPainterUnits( 1, QgsUnitTypes::RenderMillimeters );
118118
QTransform t = QTransform::fromScale( scale, scale );
119119

120-
QList<QPolygonF> rings; //empty
120+
QVector<QPolygonF> rings; //empty
121121
QPainterPath polygonPath;
122122
polygonPath.addPolygon( mPolygon );
123123

‎src/core/layout/qgslayoutitemshape.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ void QgsLayoutItemShape::draw( QgsLayoutItemRenderContext &context )
217217
}
218218
}
219219

220-
QList<QPolygonF> rings; //empty list
220+
QVector<QPolygonF> rings; //empty list
221221

222222
symbol()->startRender( context.renderContext() );
223223
symbol()->renderPolygon( shapePolygon, &rings, nullptr, context.renderContext() );

‎src/core/symbology/qgsfillsymbollayer.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ void QgsSimpleFillSymbolLayer::stopRender( QgsSymbolRenderContext &context )
263263
Q_UNUSED( context )
264264
}
265265

266-
void QgsSimpleFillSymbolLayer::renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context )
266+
void QgsSimpleFillSymbolLayer::renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context )
267267
{
268268
QPainter *p = context.renderContext().painter();
269269
if ( !p )
@@ -842,7 +842,7 @@ void QgsGradientFillSymbolLayer::stopRender( QgsSymbolRenderContext &context )
842842
Q_UNUSED( context )
843843
}
844844

845-
void QgsGradientFillSymbolLayer::renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context )
845+
void QgsGradientFillSymbolLayer::renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context )
846846
{
847847
QPainter *p = context.renderContext().painter();
848848
if ( !p )
@@ -1129,7 +1129,7 @@ void QgsShapeburstFillSymbolLayer::stopRender( QgsSymbolRenderContext &context )
11291129
Q_UNUSED( context )
11301130
}
11311131

1132-
void QgsShapeburstFillSymbolLayer::renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context )
1132+
void QgsShapeburstFillSymbolLayer::renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context )
11331133
{
11341134
QPainter *p = context.renderContext().painter();
11351135
if ( !p )
@@ -1560,7 +1560,7 @@ QgsImageFillSymbolLayer::QgsImageFillSymbolLayer()
15601560
setSubSymbol( new QgsLineSymbol() );
15611561
}
15621562

1563-
void QgsImageFillSymbolLayer::renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context )
1563+
void QgsImageFillSymbolLayer::renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context )
15641564
{
15651565
QPainter *p = context.renderContext().painter();
15661566
if ( !p )
@@ -1606,8 +1606,7 @@ void QgsImageFillSymbolLayer::renderPolygon( const QPolygonF &points, QList<QPol
16061606
mStroke->renderPolyline( points, context.feature(), context.renderContext(), -1, SELECT_FILL_BORDER && context.selected() );
16071607
if ( rings )
16081608
{
1609-
QList<QPolygonF>::const_iterator ringIt = rings->constBegin();
1610-
for ( ; ringIt != rings->constEnd(); ++ringIt )
1609+
for ( auto ringIt = rings->constBegin(); ringIt != rings->constEnd(); ++ringIt )
16111610
{
16121611
mStroke->renderPolyline( *ringIt, context.feature(), context.renderContext(), -1, SELECT_FILL_BORDER && context.selected() );
16131612
}
@@ -3507,7 +3506,7 @@ void QgsCentroidFillSymbolLayer::stopRender( QgsSymbolRenderContext &context )
35073506
mMarker->stopRender( context.renderContext() );
35083507
}
35093508

3510-
void QgsCentroidFillSymbolLayer::renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context )
3509+
void QgsCentroidFillSymbolLayer::renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context )
35113510
{
35123511
if ( !mPointOnAllParts )
35133512
{
@@ -3758,7 +3757,7 @@ QString QgsRasterFillSymbolLayer::layerType() const
37583757
return QStringLiteral( "RasterFill" );
37593758
}
37603759

3761-
void QgsRasterFillSymbolLayer::renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context )
3760+
void QgsRasterFillSymbolLayer::renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context )
37623761
{
37633762
QPainter *p = context.renderContext().painter();
37643763
if ( !p )
@@ -4009,7 +4008,7 @@ void QgsRandomMarkerFillSymbolLayer::stopRender( QgsSymbolRenderContext &context
40094008
mMarker->stopRender( context.renderContext() );
40104009
}
40114010

4012-
void QgsRandomMarkerFillSymbolLayer::renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context )
4011+
void QgsRandomMarkerFillSymbolLayer::renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context )
40134012
{
40144013
Part part;
40154014
part.exterior = points;

‎src/core/symbology/qgsfillsymbollayer.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class CORE_EXPORT QgsSimpleFillSymbolLayer : public QgsFillSymbolLayer
6565

6666
void stopRender( QgsSymbolRenderContext &context ) override;
6767

68-
void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
68+
void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
6969

7070
QgsStringMap properties() const override;
7171

@@ -229,7 +229,7 @@ class CORE_EXPORT QgsGradientFillSymbolLayer : public QgsFillSymbolLayer
229229

230230
void stopRender( QgsSymbolRenderContext &context ) override;
231231

232-
void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
232+
void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
233233

234234
QgsStringMap properties() const override;
235235

@@ -391,7 +391,7 @@ class CORE_EXPORT QgsShapeburstFillSymbolLayer : public QgsFillSymbolLayer
391391

392392
void stopRender( QgsSymbolRenderContext &context ) override;
393393

394-
void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
394+
void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
395395

396396
QgsStringMap properties() const override;
397397

@@ -648,7 +648,7 @@ class CORE_EXPORT QgsImageFillSymbolLayer: public QgsFillSymbolLayer
648648
public:
649649

650650
QgsImageFillSymbolLayer();
651-
void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
651+
void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
652652

653653
QgsSymbol *subSymbol() override { return mStroke.get(); }
654654
bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
@@ -754,7 +754,7 @@ class CORE_EXPORT QgsRasterFillSymbolLayer: public QgsImageFillSymbolLayer
754754

755755
// implemented from base classes
756756
QString layerType() const override;
757-
void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
757+
void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
758758
void startRender( QgsSymbolRenderContext &context ) override;
759759
void stopRender( QgsSymbolRenderContext &context ) override;
760760
QgsStringMap properties() const override;
@@ -1759,7 +1759,7 @@ class CORE_EXPORT QgsRandomMarkerFillSymbolLayer : public QgsFillSymbolLayer
17591759
QString layerType() const override;
17601760
void startRender( QgsSymbolRenderContext &context ) override;
17611761
void stopRender( QgsSymbolRenderContext &context ) override;
1762-
void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
1762+
void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
17631763
QgsStringMap properties() const override;
17641764
QgsRandomMarkerFillSymbolLayer *clone() const override SIP_FACTORY;
17651765

@@ -1895,7 +1895,7 @@ class CORE_EXPORT QgsRandomMarkerFillSymbolLayer : public QgsFillSymbolLayer
18951895
struct Part
18961896
{
18971897
QPolygonF exterior;
1898-
QList<QPolygonF> rings;
1898+
QVector<QPolygonF> rings;
18991899
};
19001900

19011901
QVector< Part > mCurrentParts;
@@ -1942,7 +1942,7 @@ class CORE_EXPORT QgsCentroidFillSymbolLayer : public QgsFillSymbolLayer
19421942

19431943
void stopRender( QgsSymbolRenderContext &context ) override;
19441944

1945-
void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
1945+
void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
19461946

19471947
QgsStringMap properties() const override;
19481948

‎src/core/symbology/qgslinesymbollayer.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ void QgsSimpleLineSymbolLayer::stopRender( QgsSymbolRenderContext &context )
238238
Q_UNUSED( context )
239239
}
240240

241-
void QgsSimpleLineSymbolLayer::renderPolygonStroke( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context )
241+
void QgsSimpleLineSymbolLayer::renderPolygonStroke( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context )
242242
{
243243
QPainter *p = context.renderContext().painter();
244244
if ( !p )
@@ -263,8 +263,7 @@ void QgsSimpleLineSymbolLayer::renderPolygonStroke( const QPolygonF &points, QLi
263263
if ( rings )
264264
{
265265
//add polygon rings
266-
QList<QPolygonF>::const_iterator it = rings->constBegin();
267-
for ( ; it != rings->constEnd(); ++it )
266+
for ( auto it = rings->constBegin(); it != rings->constEnd(); ++it )
268267
{
269268
QPolygonF ring = *it;
270269
clipPath.addPolygon( ring );
@@ -867,7 +866,7 @@ void QgsTemplatedLineSymbolLayerBase::renderPolyline( const QPolygonF &points, Q
867866
context.renderContext().painter()->restore();
868867
}
869868

870-
void QgsTemplatedLineSymbolLayerBase::renderPolygonStroke( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context )
869+
void QgsTemplatedLineSymbolLayerBase::renderPolygonStroke( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context )
871870
{
872871
const QgsCurvePolygon *curvePolygon = dynamic_cast<const QgsCurvePolygon *>( context.renderContext().geometry() );
873872

‎src/core/symbology/qgslinesymbollayer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class CORE_EXPORT QgsSimpleLineSymbolLayer : public QgsLineSymbolLayer
6868
void stopRender( QgsSymbolRenderContext &context ) override;
6969
void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context ) override;
7070
//overridden so that clip path can be set when using draw inside polygon option
71-
void renderPolygonStroke( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
71+
void renderPolygonStroke( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
7272
QgsStringMap properties() const override;
7373
QgsSimpleLineSymbolLayer *clone() const override SIP_FACTORY;
7474
void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
@@ -467,7 +467,7 @@ class CORE_EXPORT QgsTemplatedLineSymbolLayerBase : public QgsLineSymbolLayer
467467
const QgsMapUnitScale &averageAngleMapUnitScale() const { return mAverageAngleLengthMapUnitScale; }
468468

469469
void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context ) FINAL;
470-
void renderPolygonStroke( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) FINAL;
470+
void renderPolygonStroke( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) FINAL;
471471
QgsUnitTypes::RenderUnit outputUnit() const FINAL;
472472
void setMapUnitScale( const QgsMapUnitScale &scale ) FINAL;
473473
QgsMapUnitScale mapUnitScale() const FINAL;

0 commit comments

Comments
 (0)
Please sign in to comment.