Skip to content

calculate layout properties per-feature#1267

Closed
ansis wants to merge 7 commits intomasterfrom
per-feature-layout-props
Closed

calculate layout properties per-feature#1267
ansis wants to merge 7 commits intomasterfrom
per-feature-layout-props

Conversation

@ansis
Copy link
Contributor

@ansis ansis commented Jun 11, 2015

Instead of having one layout property value for an entire layer, calculate values separately for each feature. This will eventually enable things like multiple fonts within a single layer.

Since the style functions don't make use of the feature properties yet all properties within a layer still have identical values.

This should not have any impact rendering.

@jfirebaugh want to review?

@jfirebaugh
Copy link
Contributor

This has a potential performance impact, right? It's now calling StyleDeclaration::calculate once per feature, rather than once per layer. We've talked about optimizing this based on whether or not a particular style property value was data-driven or not.

We could make calculate multi-step. The first step done per-layer, does a partial calculation based on the zoom, and returns a function for calculating the second step. The second step is done per-feature to finish the calculation, and for now it would ignore the input parameter.

@ansis
Copy link
Contributor Author

ansis commented Jun 11, 2015

Yeah, it's making LineBucket around 25% slow. Waiting until the function par is implemented sounds good.

Instead of having one layout property value for an entire layer,
calculate values separately for each feature. This will eventually
enable things like multiple different fonts within a single layer.

Since the style functions don't support data driven styles yet, there is
no way for functions to return different results per-feature.
constant values for these features can be added to and read from the
buffers:

line-color
line-width
line-blur
line-gap-width
line-opacity
text-color
icon-color
text-halo-color
icon-halo-color
icon-opacity
@ansis ansis force-pushed the per-feature-layout-props branch from 8da9867 to 0fb7bff Compare June 15, 2015 23:20
@ansis ansis force-pushed the per-feature-layout-props branch from 83ca3f1 to b0dfc7b Compare June 18, 2015 18:21
@jfirebaugh
Copy link
Contributor

Rolled into #1300.

@jfirebaugh jfirebaugh closed this Jun 23, 2015
@jfirebaugh jfirebaugh deleted the per-feature-layout-props branch June 23, 2015 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants