summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer/painter_raster.cpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-07-05 11:55:20 +0200
committerKonstantin Käfer <mail@kkaefer.com>2016-07-07 15:06:59 +0200
commit69c529e26463303dea81a0b5d4b8540a9384d482 (patch)
treea184ef8235a5ac86719be14241bdab42bcf14b0c /src/mbgl/renderer/painter_raster.cpp
parente29a15eb5213c9231019958bab82d38e7daf45b1 (diff)
downloadqtlocation-mapboxgl-69c529e26463303dea81a0b5d4b8540a9384d482.tar.gz
[core] move shaders to anon struct and alias them
Diffstat (limited to 'src/mbgl/renderer/painter_raster.cpp')
-rw-r--r--src/mbgl/renderer/painter_raster.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/mbgl/renderer/painter_raster.cpp b/src/mbgl/renderer/painter_raster.cpp
index 6f2352b0cd..10b960b37e 100644
--- a/src/mbgl/renderer/painter_raster.cpp
+++ b/src/mbgl/renderer/painter_raster.cpp
@@ -19,34 +19,34 @@ void Painter::renderRaster(RasterBucket& bucket,
if (bucket.hasData()) {
const bool overdraw = isOverdraw();
- const auto& shaderRaster = overdraw ? rasterOverdrawShader : rasterShader;
- auto& vaoRaster = overdraw ? coveringRasterOverdrawArray : coveringRasterArray;
+ auto& rasterShader = overdraw ? *overdrawShader.raster : *shader.raster;
+ auto& rasterVAO = overdraw ? coveringRasterOverdrawArray : coveringRasterArray;
- config.program = shaderRaster->getID();
- shaderRaster->u_matrix = matrix;
- shaderRaster->u_buffer_scale = 1.0f;
- shaderRaster->u_opacity0 = properties.rasterOpacity;
- shaderRaster->u_opacity1 = 1.0f - properties.rasterOpacity;
+ config.program = rasterShader.getID();
+ rasterShader.u_matrix = matrix;
+ rasterShader.u_buffer_scale = 1.0f;
+ rasterShader.u_opacity0 = properties.rasterOpacity;
+ rasterShader.u_opacity1 = 1.0f - properties.rasterOpacity;
- shaderRaster->u_brightness_low = properties.rasterBrightnessMin;
- shaderRaster->u_brightness_high = properties.rasterBrightnessMax;
- shaderRaster->u_saturation_factor = saturationFactor(properties.rasterSaturation);
- shaderRaster->u_contrast_factor = contrastFactor(properties.rasterContrast);
- shaderRaster->u_spin_weights = spinWeights(properties.rasterHueRotate);
+ rasterShader.u_brightness_low = properties.rasterBrightnessMin;
+ rasterShader.u_brightness_high = properties.rasterBrightnessMax;
+ rasterShader.u_saturation_factor = saturationFactor(properties.rasterSaturation);
+ rasterShader.u_contrast_factor = contrastFactor(properties.rasterContrast);
+ rasterShader.u_spin_weights = spinWeights(properties.rasterHueRotate);
config.stencilTest = GL_FALSE;
- shaderRaster->u_image0 = 0; // GL_TEXTURE0
- shaderRaster->u_image1 = 1; // GL_TEXTURE1
- shaderRaster->u_tl_parent = {{ 0.0f, 0.0f }};
- shaderRaster->u_scale_parent = 1.0f;
+ rasterShader.u_image0 = 0; // GL_TEXTURE0
+ rasterShader.u_image1 = 1; // GL_TEXTURE1
+ rasterShader.u_tl_parent = {{ 0.0f, 0.0f }};
+ rasterShader.u_scale_parent = 1.0f;
config.depthFunc.reset();
config.depthTest = GL_TRUE;
config.depthMask = GL_FALSE;
setDepthSublayer(0);
- bucket.drawRaster(*shaderRaster, rasterBoundsBuffer, vaoRaster, config, store);
+ bucket.drawRaster(rasterShader, rasterBoundsBuffer, rasterVAO, config, store);
}
}