Merge branch 'master' of github.com:mapbox/mapbox-gl-native into android-mason
This commit is contained in:
@@ -100,6 +100,7 @@ std::unique_ptr<Bucket> TileParser::createBucket(util::ptr<StyleBucket> bucket_d
|
||||
// Skip this bucket if we are to not render this
|
||||
if (tile.id.z < std::floor(bucket_desc->min_zoom) && std::floor(bucket_desc->min_zoom) < tile.source.max_zoom) return nullptr;
|
||||
if (tile.id.z >= std::ceil(bucket_desc->max_zoom)) return nullptr;
|
||||
if (bucket_desc->visibility == mbgl::VisibilityType::None) return nullptr;
|
||||
|
||||
auto layer_it = vector_data.layers.find(bucket_desc->source_layer);
|
||||
if (layer_it != vector_data.layers.end()) {
|
||||
|
||||
@@ -292,6 +292,7 @@ void Painter::renderLayers(util::ptr<StyleLayerGroup> group) {
|
||||
}
|
||||
|
||||
void Painter::renderLayer(util::ptr<StyleLayer> layer_desc, const Tile::ID* id, const mat4* matrix) {
|
||||
if (layer_desc->bucket->visibility == VisibilityType::None) return;
|
||||
if (layer_desc->type == StyleLayerType::Background) {
|
||||
// This layer defines a background color/image.
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ void Painter::renderLine(LineBucket& bucket, util::ptr<StyleLayer> layer_desc, c
|
||||
linesdfShader->u_patternscale = {{ scaleX, scaleY }};
|
||||
linesdfShader->u_tex_y = pos.y;
|
||||
linesdfShader->u_image = 0;
|
||||
linesdfShader->u_sdfgamma = lineAtlas.width / (properties.dash_line_width * pos.width * 256.0 * state.getPixelRatio());
|
||||
linesdfShader->u_sdfgamma = lineAtlas.width / (properties.dash_line_width * pos.width * 256.0 * state.getPixelRatio()) / 2;
|
||||
|
||||
bucket.drawLineSDF(*linesdfShader);
|
||||
|
||||
|
||||
@@ -99,6 +99,7 @@ public:
|
||||
StyleBucketRender render = std::false_type();
|
||||
float min_zoom = -std::numeric_limits<float>::infinity();
|
||||
float max_zoom = std::numeric_limits<float>::infinity();
|
||||
VisibilityType visibility = VisibilityType::Visible;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -733,6 +733,7 @@ void StyleParser::parseLayout(JSVal value, util::ptr<StyleLayer> &layer) {
|
||||
}
|
||||
|
||||
StyleBucket &bucket = *layer->bucket;
|
||||
parseRenderProperty<VisibilityTypeClass>(value, bucket.visibility, "visibility");
|
||||
|
||||
switch (layer->type) {
|
||||
case StyleLayerType::Fill: {
|
||||
|
||||
@@ -50,6 +50,18 @@ MBGL_DEFINE_ENUM_CLASS(SourceTypeClass, SourceType, {
|
||||
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
|
||||
enum class VisibilityType : bool {
|
||||
Visible,
|
||||
None,
|
||||
};
|
||||
|
||||
MBGL_DEFINE_ENUM_CLASS(VisibilityTypeClass, VisibilityType, {
|
||||
{ VisibilityType::Visible, "visible" },
|
||||
{ VisibilityType::None, "none" },
|
||||
});
|
||||
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
|
||||
enum class WindingType : bool {
|
||||
EvenOdd,
|
||||
NonZero,
|
||||
|
||||
Reference in New Issue
Block a user