Skip to content

Commit 055850b

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 1d1ac96 commit 055850b

7 files changed

+29
-16
lines changed

include/mbgl/gfx/dynamic_texture.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class DynamicTexture {
3939
return addImage(image.data ? image.data.get() : nullptr, image.size, id);
4040
}
4141
std::optional<TextureHandle> addImage(const void* pixelData, const Size& imageSize, int32_t id = -1);
42-
42+
4343
void removeTexture(const TextureHandle& texHandle);
4444

4545
private:

src/mbgl/gfx/drawable_atlases_tweaker.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ void DrawableAtlasesTweaker::setupTextures(gfx::Drawable& drawable, const bool l
1616
assert(*glyphTextureId != *iconTextureId);
1717
drawable.setTexture(atlases ? gfx::Context::getDynamicTextureAlpha()->getTextureAtlas() : nullptr,
1818
*glyphTextureId);
19-
drawable.setTexture(atlases ? gfx::Context::getDynamicTextureRGBA()->getTextureAtlas() : nullptr, *iconTextureId);
19+
drawable.setTexture(atlases ? gfx::Context::getDynamicTextureRGBA()->getTextureAtlas() : nullptr,
20+
*iconTextureId);
2021
} else {
21-
drawable.setTexture(
22-
atlases ? (isText ? gfx::Context::getDynamicTextureAlpha()->getTextureAtlas() : gfx::Context::getDynamicTextureRGBA()->getTextureAtlas()) : nullptr,
23-
*glyphTextureId);
22+
drawable.setTexture(atlases ? (isText ? gfx::Context::getDynamicTextureAlpha()->getTextureAtlas()
23+
: gfx::Context::getDynamicTextureRGBA()->getTextureAtlas())
24+
: nullptr,
25+
*glyphTextureId);
2426
}
2527
}
2628
}

src/mbgl/mtl/context.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Context::~Context() noexcept {
6363
#if !defined(NDEBUG)
6464
Log::Debug(Event::General, "Rendering Stats:\n" + stats.toString("\n"));
6565
#endif
66-
//assert(stats.isZero());
66+
// assert(stats.isZero());
6767
}
6868
}
6969

src/mbgl/renderer/image_atlas.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77

88
namespace mbgl {
99

10-
ImagePosition::ImagePosition(const mapbox::Bin& bin, const style::Image::Impl& image, uint32_t version_, std::optional<gfx::TextureHandle> handle_)
10+
ImagePosition::ImagePosition(const mapbox::Bin& bin,
11+
const style::Image::Impl& image,
12+
uint32_t version_,
13+
std::optional<gfx::TextureHandle> handle_)
1114
: handle(handle_),
1215
pixelRatio(image.pixelRatio),
1316
paddedRect(bin.x, bin.y, bin.w, bin.h),
@@ -56,7 +59,7 @@ ImagePositions uploadIcons(const ImageMap& icons, const ImageVersionMap& version
5659
iconPositions.emplace(image.id, ImagePosition{*iconHandle->getBin(), image, version, iconHandle});
5760
}
5861
}
59-
62+
6063
return iconPositions;
6164
}
6265

@@ -75,7 +78,7 @@ ImagePositions uploadPatterns(const ImageMap& patterns, const ImageVersionMap& v
7578
patternPositions.emplace(image.id, ImagePosition{*patternHandle->getBin(), image, version, patternHandle});
7679
}
7780
}
78-
81+
7982
return patternPositions;
8083
}
8184

src/mbgl/renderer/image_atlas.hpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ class ImageManager;
2020

2121
class ImagePosition {
2222
public:
23-
ImagePosition(const mapbox::Bin&, const style::Image::Impl&, uint32_t version = 0, std::optional<gfx::TextureHandle> handle = std::nullopt);
23+
ImagePosition(const mapbox::Bin&,
24+
const style::Image::Impl&,
25+
uint32_t version = 0,
26+
std::optional<gfx::TextureHandle> handle = std::nullopt);
2427

2528
static constexpr const uint16_t padding = 1u;
2629
std::optional<gfx::TextureHandle> handle;

src/mbgl/tile/geometry_tile.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,10 @@ void GeometryTileRenderData::upload(gfx::UploadPass& uploadPass) {
9898
if (!imagePatches.empty()) {
9999
for (const auto& imagePatch : imagePatches) { // patch updated images.
100100
#if MLN_DRAWABLE_RENDERER
101-
gfx::Context::getDynamicTextureRGBA()->getTextureAtlas()->uploadSubRegion(imagePatch.image->image,
102-
imagePatch.paddedRect.x + ImagePosition::padding,
103-
imagePatch.paddedRect.y + ImagePosition::padding);
101+
gfx::Context::getDynamicTextureRGBA()->getTextureAtlas()->uploadSubRegion(
102+
imagePatch.image->image,
103+
imagePatch.paddedRect.x + ImagePosition::padding,
104+
imagePatch.paddedRect.y + ImagePosition::padding);
104105
#else
105106
uploadPass.updateTextureSub(*atlasTextures->icon,
106107
imagePatch.image->image,

src/mbgl/tile/geometry_tile_worker.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,8 @@ void GeometryTileWorker::finalizeLayout() {
515515
}
516516

517517
// layout adds the bucket to buckets
518-
layout->createBucket(patternPositions, featureIndex, renderData, firstLoad, showCollisionBoxes, id.canonical);
518+
layout->createBucket(
519+
patternPositions, featureIndex, renderData, firstLoad, showCollisionBoxes, id.canonical);
519520
}
520521
}
521522

@@ -530,8 +531,11 @@ void GeometryTileWorker::finalizeLayout() {
530531
<< id.canonical.y << " Time");
531532

532533
parent.invoke(&GeometryTile::onLayout,
533-
std::make_shared<GeometryTile::LayoutResult>(
534-
std::move(renderData), std::move(featureIndex), std::move(glyphPositions), std::move(iconPositions), std::move(patternPositions)),
534+
std::make_shared<GeometryTile::LayoutResult>(std::move(renderData),
535+
std::move(featureIndex),
536+
std::move(glyphPositions),
537+
std::move(iconPositions),
538+
std::move(patternPositions)),
535539
correlationID);
536540
}
537541

0 commit comments

Comments
 (0)