Selectable renderer implementation (#1247)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -87,24 +87,39 @@ void GeometryTileRenderData::upload(gfx::UploadPass& uploadPass) {
|
||||
assert(atlasTextures);
|
||||
|
||||
if (layoutResult->glyphAtlasImage && layoutResult->glyphAtlasImage->valid()) {
|
||||
#if MLN_DRAWABLE_RENDERER
|
||||
atlasTextures->glyph = uploadPass.getContext().createTexture2D();
|
||||
atlasTextures->glyph->setSamplerConfiguration(
|
||||
{gfx::TextureFilterType::Linear, gfx::TextureWrapType::Clamp, gfx::TextureWrapType::Clamp});
|
||||
atlasTextures->glyph->upload(*layoutResult->glyphAtlasImage);
|
||||
#else
|
||||
atlasTextures->glyph = uploadPass.createTexture(*layoutResult->glyphAtlasImage);
|
||||
#endif
|
||||
layoutResult->glyphAtlasImage = {};
|
||||
}
|
||||
|
||||
if (layoutResult->iconAtlas.image.valid()) {
|
||||
#if MLN_DRAWABLE_RENDERER
|
||||
atlasTextures->icon = uploadPass.getContext().createTexture2D();
|
||||
atlasTextures->icon->upload(layoutResult->iconAtlas.image);
|
||||
#else
|
||||
atlasTextures->icon = uploadPass.createTexture(layoutResult->iconAtlas.image);
|
||||
#endif
|
||||
layoutResult->iconAtlas.image = {};
|
||||
}
|
||||
|
||||
if (atlasTextures->icon && !imagePatches.empty()) {
|
||||
for (const auto& imagePatch : imagePatches) { // patch updated images.
|
||||
#if MLN_DRAWABLE_RENDERER
|
||||
atlasTextures->icon->uploadSubRegion(imagePatch.image->image,
|
||||
imagePatch.paddedRect.x + ImagePosition::padding,
|
||||
imagePatch.paddedRect.y + ImagePosition::padding);
|
||||
#else
|
||||
uploadPass.updateTextureSub(*atlasTextures->icon,
|
||||
imagePatch.image->image,
|
||||
imagePatch.paddedRect.x + ImagePosition::padding,
|
||||
imagePatch.paddedRect.y + ImagePosition::padding);
|
||||
#endif
|
||||
}
|
||||
imagePatches.clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user