Skip to content

Commit

Permalink
Fix line atlas (#2908)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimSylvester authored Oct 8, 2024
1 parent 156872f commit eaa52d0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
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

0 comments on commit eaa52d0

Please sign in to comment.