Skip to content
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

Fix line atlas #2908

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions platform/darwin/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Generated list files from code generation
/scripts/generate-style-code.list
/scripts/update-examples.list
vulkan.xcworkspace

24 changes: 11 additions & 13 deletions src/mbgl/renderer/layers/render_line_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,19 +558,17 @@ void RenderLineLayer::update(gfx::ShaderRegistry& shaders,

// texture
if (const auto& atlases = tile.getAtlasTextures(); atlases && atlases->icon) {
if (!iconTweaker) {
iconTweaker = std::make_shared<gfx::DrawableAtlasesTweaker>(
atlases,
std::nullopt,
idLineImageTexture,
/*isText*/ false,
/*sdfIcons*/ true, // to force linear filter
/*rotationAlignment_*/ AlignmentType::Auto,
/*iconScaled*/ false,
/*textSizeIsZoomConstant_*/ false);
}

builder->addTweaker(iconTweaker);
auto iconTweaker = std::make_shared<gfx::DrawableAtlasesTweaker>(
atlases,
std::nullopt,
idLineImageTexture,
/*isText*/ false,
/*sdfIcons*/ true, // to force linear filter
/*rotationAlignment_*/ AlignmentType::Auto,
/*iconScaled*/ false,
/*textSizeIsZoomConstant_*/ false);

builder->addTweaker(std::move(iconTweaker));

setSegments(builder, bucket);

Expand Down
2 changes: 0 additions & 2 deletions src/mbgl/renderer/layers/render_line_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ class RenderLineLayer final : public RenderLayer {
gfx::ShaderGroupPtr lineGradientShaderGroup;
gfx::ShaderGroupPtr lineSDFShaderGroup;
gfx::ShaderGroupPtr linePatternShaderGroup;

gfx::DrawableTweakerPtr iconTweaker;
#endif
};

Expand Down
Loading