Skip to content

Commit

Permalink
Disable subtile blending in case when RGBA tiles are used
Browse files Browse the repository at this point in the history
  • Loading branch information
mtehver committed Dec 28, 2016
1 parent 4c843d7 commit 38c4759
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion libs-carto/vt/src/vt/GLTileRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,18 @@ namespace carto { namespace vt {
break;
}
if (blend && blendNode->tileId.intersects(oldBlendNode->tileId)) {
if (_subTileBlending) {
bool subTileBlending = _subTileBlending;

// Disable subtile blending if alpha channel is used on the tile
for (const std::shared_ptr<TileLayer>& layer : blendNode->tile->getLayers()) {
for (const std::shared_ptr<TileBitmap>& bitmap : layer->getBitmaps()) {
if (bitmap->getFormat() == TileBitmap::Format::RGBA) {
subTileBlending = false;
}
}
}

if (subTileBlending) {
blendNode->childNodes.push_back(oldBlendNode);
oldBlendNode->blend = calculateBlendNodeOpacity(*oldBlendNode, 1.0f); // this is an optimization, to reduce extensive blending subtrees
oldBlendNode->childNodes.clear();
Expand Down

0 comments on commit 38c4759

Please sign in to comment.