Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Feature state updates - #15872

Closed
jmalanen wants to merge 6 commits into
masterfrom
jmalanen-feature
Closed

jmalanen wants to merge 6 commits into
masterfrom
jmalanen-feature

Conversation

@jmalanen

@jmalanen jmalanen commented Oct 30, 2019 •

Copy link
Copy Markdown
Contributor

[glfw] Update feature state only when the layer is visible
-- small optimization to the glfw test app

[core] Add feature state support to composite crossfade binder
-- This adds feature state support for eg. fill-pattern
-- Related gl-js PR: mapbox/mapbox-gl-js#8927

[core] Add getMissingImages API to GeometryTile
[core] Pass GeometryTile to paint property binder
-- These two are requirements for the above composite crossfade binder patch

[core] Upload buckets only when there are feature state changes
-- Optimization

Fixes: #15895

@jmalanen
jmalanen force-pushed the jmalanen-feature branch 5 times, most recently from 5fe6a4a to d1ea075 Compare October 31, 2019 11:41
@jmalanen
jmalanen marked this pull request as ready for review October 31, 2019 13:05
@jmalanen
jmalanen requested a review from 1ec5 as a code owner October 31, 2019 13:05
@jmalanen
jmalanen requested review from a team, alexshalamov, pozdnyakov and tmpsantos October 31, 2019 13:05
@jmalanen jmalanen self-assigned this Oct 31, 2019
`@"${_.startCase(propertyName)}"`;
case 'string':
case 'image': // TODO: replace once we implement image expressions
case 'resolvedImage': // TODO: replace once we implement image expressions

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +258 to +269
if (!missingImagesRequested) {
worker.self().invoke(&GeometryTileWorker::onImagesAvailable,
std::move(images),
std::move(patterns),
std::move(versionMap),
imageCorrelationID);
} else {
layoutResult->iconAtlas = makeImageAtlas(images, patterns, versionMap);
missingImagesRequested = false;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a unit test, if for some reason missingImagesRequested is stale and set to true, we will never trigger re-layout when image manager provides requested images.

Comment thread platform/glfw/glfw_view.cpp Outdated
using namespace mbgl;
FeatureState newState;

if (result.size() > 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: !result.empty()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread platform/glfw/glfw_view.cpp Outdated
}
}
} else {
if (view->featureID) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: else if

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread src/mbgl/renderer/bucket.hpp Outdated
}


virtual bool uploadPending() const { return needsUpload() || stateChanged; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why couldn't we just check stateChanged insideneedsUpload()?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

uploaded = false;
updated |= it->second.updateVertexVectors(states, layer, imagePositions, tile);
}
stateChanged = updated;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this snippet being repeated several times, can it be shared?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe put to a basic class?

const style::expression::Value&) = 0;

virtual void updateVertexVectors(const FeatureStates&, const GeometryTileLayer&, const ImagePositions&) {}
virtual bool updateVertexVectors(const FeatureStates&,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls add a comment documenting the returned value

virtual bool updateVertexVectors(const FeatureStates&,
const GeometryTileLayer&,
const ImagePositions&,
GeometryTile&) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not pass tile here, it's better to keep it decoupled from rendering

@chloekraw

Copy link
Copy Markdown
Contributor

@jmalanen does this need a changelog, or is it all internal code so far that doesn't impact developers until we introduce new APIs?

@jmalanen

Copy link
Copy Markdown
Contributor Author

@jmalanen does this need a changelog, or is it all internal code so far that doesn't impact developers until we introduce new APIs?

This is all internal code for now that doesn't impact developers.

@chapmanjacobd

Copy link
Copy Markdown

is there anything that an outside contributor can do to help push this along? I would like to use this feature in mapbox/mapbox-gl-js#7207

@jmalanen
jmalanen removed request for 1ec5 and tmpsantos January 31, 2020 07:32
@jplante

jplante commented Mar 13, 2020

Copy link
Copy Markdown

Our team is very eager for this release as well.

@jmurphy-re

Copy link
Copy Markdown

I'm stuck on an old fork of GL JS waiting for this, I'd love to see this get moving again.

@derrickrung

derrickrung commented Apr 24, 2020 •

Copy link
Copy Markdown

Thanks for all the great work. Super excited about this PR, our team has been looking forward to this for a while. Anything we can help do to get this moved along?

@jmalanen

Copy link
Copy Markdown
Contributor Author

@chapmanjacobd @jmurphy-asurity @jplante @derrickrung

Which one of you are interested in the GL native version?

This is currently on hold, but if you are interested in GL JS please add your request to mapbox/mapbox-gl-js#7207

@jmurphy-re

Copy link
Copy Markdown

Thanks for the update @jmalanen. I'm interested in both, but GL JS is more important to me. Why is this on hold? It seemed like it was nearly ready.

@jmalanen jmalanen closed this Jul 7, 2022
@jmalanen
jmalanen deleted the jmalanen-feature branch July 7, 2022 13:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix feature-state dependent styles for *-pattern properties

10 participants