From c568a8ad77320c869d8e7c23b86426c094aceb6c Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 24 May 2016 17:57:08 -0700 Subject: [core] Port "separate u_opacity from u_color" https://github.com/mapbox/mapbox-gl-shaders/commit/0d3412519618a3a1672db9fa21f96f90070cf84c https://github.com/mapbox/mapbox-gl-js/commit/1f5afa7db08a2bdcc492a46e500ff5d020e6f4a2 --- src/mbgl/renderer/painter_background.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'src/mbgl/renderer/painter_background.cpp') diff --git a/src/mbgl/renderer/painter_background.cpp b/src/mbgl/renderer/painter_background.cpp index 5054722e79..9f5e83d38c 100644 --- a/src/mbgl/renderer/painter_background.cpp +++ b/src/mbgl/renderer/painter_background.cpp @@ -43,13 +43,10 @@ void Painter::renderBackground(const BackgroundLayer& layer) { } else { if (wireframe) { plainShader->u_color = {{ 0.0f, 0.0f, 0.0f, 1.0f }}; + plainShader->u_opacity = 1.0f; } else { - Color color = properties.backgroundColor; - color[0] *= properties.backgroundOpacity; - color[1] *= properties.backgroundOpacity; - color[2] *= properties.backgroundOpacity; - color[3] *= properties.backgroundOpacity; - plainShader->u_color = color; + plainShader->u_color = properties.backgroundColor; + plainShader->u_opacity = properties.backgroundOpacity; } config.program = plainShader->getID(); @@ -102,18 +99,10 @@ void Painter::renderBackground(const BackgroundLayer& layer) { patternShader->u_offset_a = std::array{{offsetAx, offsetAy}}; patternShader->u_offset_b = std::array{{offsetBx, offsetBy}}; - - } else { plainShader->u_matrix = vtxMatrix; - if (wireframe) { - plainShader->u_color = {{ 0.0f, 0.0f, 0.0f, 1.0f }}; - } else { - plainShader->u_color = properties.backgroundColor; - } } MBGL_CHECK_ERROR(glDrawArrays(GL_TRIANGLE_STRIP, 0, (GLsizei)tileStencilBuffer.index())); } - } -- cgit v1.2.1