diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2014-10-21 15:00:44 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2014-10-29 09:58:56 -0400 |
commit | da8aa391d0a1079bbc697207803a48fce8ab916f (patch) | |
tree | 4fbf6a2dcc594860aa43517e6d78c542c7eff115 /src/renderer/painter_fill.cpp | |
parent | 4f7bc80664c29d7f15598392946ff0ac73dd520c (diff) | |
download | qtlocation-mapboxgl-da8aa391d0a1079bbc697207803a48fce8ab916f.tar.gz |
Render map with a copy of TransformState
Diffstat (limited to 'src/renderer/painter_fill.cpp')
-rw-r--r-- | src/renderer/painter_fill.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/renderer/painter_fill.cpp b/src/renderer/painter_fill.cpp index 0f7eadce63..f2759ffd61 100644 --- a/src/renderer/painter_fill.cpp +++ b/src/renderer/painter_fill.cpp @@ -49,8 +49,8 @@ void Painter::renderFill(FillBucket& bucket, util::ptr<StyleLayer> layer_desc, c // Draw the entire line outlineShader->u_world = {{ - static_cast<float>(map.getState().getFramebufferWidth()), - static_cast<float>(map.getState().getFramebufferHeight()) + static_cast<float>(state.getFramebufferWidth()), + static_cast<float>(state.getFramebufferHeight()) }}; depthRange(strata, 1.0f); bucket.drawVertices(*outlineShader); @@ -58,12 +58,10 @@ void Painter::renderFill(FillBucket& bucket, util::ptr<StyleLayer> layer_desc, c if (pattern) { // Image fill. - Sprite &sprite = *map.getSprite(); - if (pass == RenderPass::Translucent && sprite) { - SpriteAtlas &spriteAtlas = *map.getSpriteAtlas(); + if (pass == RenderPass::Translucent) { const SpriteAtlasPosition pos = spriteAtlas.getPosition(properties.image, true); - const float mix = std::fmod(float(map.getState().getZoom()), 1.0f); - const float factor = 8.0 / std::pow(2, map.getState().getIntegerZoom() - id.z); + const float mix = std::fmod(float(state.getZoom()), 1.0f); + const float factor = 8.0 / std::pow(2, state.getIntegerZoom() - id.z); mat3 patternMatrix; matrix::identity(patternMatrix); @@ -114,8 +112,8 @@ void Painter::renderFill(FillBucket& bucket, util::ptr<StyleLayer> layer_desc, c // Draw the entire line outlineShader->u_world = {{ - static_cast<float>(map.getState().getFramebufferWidth()), - static_cast<float>(map.getState().getFramebufferHeight()) + static_cast<float>(state.getFramebufferWidth()), + static_cast<float>(state.getFramebufferHeight()) }}; depthRange(strata + strata_epsilon, 1.0f); |