Line tweaker (#2050)

This commit is contained in:
Tim Sylvester
2024-01-25 10:57:53 -08:00
committed by GitHub
parent ec9afb5256
commit e7d6f6a84d
21 changed files with 141 additions and 152 deletions

View File

@@ -70,31 +70,6 @@ std::optional<Color> RenderLayer::getSolidBackground() const {
}
#if MLN_DRAWABLE_RENDERER
void RenderLayer::replaceTweaker(LayerTweakerPtr& curTweaker,
LayerTweakerPtr newTweaker,
const std::vector<LayerGroupBasePtr>& layerGroups) {
const auto prevTweaker = curTweaker;
// We need to re-create the tweaker because it doesn't yet support modifying evaluated
// properties, but we don't want to stop updating drawables (as in the `layerChanged` case)
// so we need to update the tweaker reference on the outstanding drawables so that they
// pass the check in `updateExisting`.
// TODO: Once the tweaker doesn't need to be re-created on each property evaluation, this won't be needed.
for (const auto& group : layerGroups) {
if (group) {
group->addLayerTweaker(newTweaker);
visitLayerGroupDrawables(*group, [&](gfx::Drawable& drawable) {
if (drawable.getLayerTweaker() == prevTweaker) {
drawable.setLayerTweaker(newTweaker);
}
});
}
}
curTweaker = std::move(newTweaker);
}
void RenderLayer::layerChanged(const TransitionParameters&,
const Immutable<style::Layer::Impl>&,
UniqueChangeRequestVec&) {