New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested layers, layer level comp-op and opacity #3474
Conversation
8c2b7b0
to
9585f93
Compare
I have tried to add buffer recycling. Some performance benefit ~0.1 millisecond was measurable on the following style. Times before and after the change:
<Map background-color="white">
<Parameters>
<Parameter name="sizes">256, 256</Parameter>
<Parameter name="bbox">-1, -1, 1, 1</Parameter>
</Parameters>
<Datasource name="d">
<Parameter name="type">csv</Parameter>
<Parameter name="inline">
x, y
0, 0
</Parameter>
</Datasource>
<Style name="s">
<Rule>
<MarkersSymbolizer file="../../data/images/marker.png" width="256" height="256" ignore-placement="true" />
</Rule>
</Style>
<Layer comp-op="multiply"><StyleName>s</StyleName><Datasource base="d"></Datasource>
<Layer comp-op="multiply"><StyleName>s</StyleName><Datasource base="d"></Datasource>
<Layer comp-op="multiply"><StyleName>s</StyleName><Datasource base="d"></Datasource>
</Layer></Layer></Layer>
<Layer comp-op="multiply"><StyleName>s</StyleName><Datasource base="d"></Datasource>
<Layer comp-op="multiply"><StyleName>s</StyleName><Datasource base="d"></Datasource>
<Layer comp-op="multiply"><StyleName>s</StyleName><Datasource base="d"></Datasource>
</Layer></Layer></Layer>
</Map> |
How is the progress? Would be awesome to have it. It's like object oriented layering, short OOL ;-) |
@tds4u You can use it in downstream. |
Cool monkeys :-). It's rebased. I would like to add some rationale behind this. From design perspective I would prefer some component separated from Mapnik as described in this Compositing Ideas. That would also be more flexible for adding new features or optimizations like drawing layers concurrently. On the other side that requires to at least slightly modify all components using Mapnik. Given the simplicity of this implementation in Mapnik, naturalness of nested layers design and backward compatibility, I decided to do it in Mapnik. But have to say I'm still not absolutely certain whether it was a good idea. |
@talaj - Lets give it a go in 3.1.x and see if this implementation plays well. I'm going to merge, thanks! |
Hmm.. there are some serialisation issues.. WIP |
Enables grouped compositing and improves layer organization.
Layers are rendered recursively, creating it's own buffer if
comp-op
oropacity
properties are set. Otherwise, rendering buffer is inherited from parent layer.All tests are passing except some SVGs with changes in grouping SVG elements per
Layer
.Here is a simple example.