Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip pattern layer when pattern is missing #4687

Merged
merged 1 commit into from
May 9, 2017
Merged

Conversation

ansis
Copy link
Contributor

@ansis ansis commented May 8, 2017

This fixes a regression where pattern layers were rendered even if the needed pattern wasn't loaded and bound. The missing texture would render as a black area.

No error or warning will be emitted for missing patterns. Is this the correct behavior? This seems consistent with missing symbol icons.

fix #4660

benchmarks

map-load
master 44641e9: 225 ms
4660-fix-pattern-flicker 2befc33: 192 ms
style-load
master 44641e9: 112 ms
4660-fix-pattern-flicker 2befc33: 106 ms
buffer
master 44641e9: 1,146 ms
4660-fix-pattern-flicker 2befc33: 1,123 ms
fps
master 44641e9: 60 fps
4660-fix-pattern-flicker 2befc33: 59 fps
frame-duration
master 44641e9: 4.4 ms, 0% > 16ms
4660-fix-pattern-flicker 2befc33: 4.4 ms, 0% > 16ms
query-point
master 44641e9: 1.50 ms
4660-fix-pattern-flicker 2befc33: 1.57 ms
query-box
master 44641e9: 79.46 ms
4660-fix-pattern-flicker 2befc33: 79.54 ms
geojson-setdata-small
master 44641e9: 8 ms
4660-fix-pattern-flicker 2befc33: 4 ms
geojson-setdata-large
master 44641e9: 167 ms
4660-fix-pattern-flicker 2befc33: 191 ms

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • [N/A] document any changes to public APIs
  • post benchmark scores
  • manually test the debug page

@@ -151,6 +151,7 @@ function drawExtrusion(painter, source, layer, coord) {
programConfiguration.setUniforms(gl, program, layer, {zoom: painter.transform.zoom});

if (image) {
if (pattern.isPatternMissing(layer.paint['fill-extrusion-pattern'], painter)) return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: layer.paint['fill-extrusion-pattern']image

No error or warning is printed for missing patterns.

fix #4660
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using background pattern causes flicker of black screen
2 participants