summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer
diff options
context:
space:
mode:
authorMolly Lloyd <mollymerp@users.noreply.github.com>2018-06-21 14:37:17 -0700
committerGitHub <noreply@github.com>2018-06-21 14:37:17 -0700
commite1af62e87dfd77d1c38802f082c4981dab1beeab (patch)
tree8371dccdcf8545fd50b2edddbdd3a622bb00b27a /src/mbgl/renderer
parenteb70b8984901d8113f3a29d26cc355d5b3ed46fd (diff)
downloadqtlocation-mapboxgl-e1af62e87dfd77d1c38802f082c4981dab1beeab.tar.gz
[core] add raster-resampling property (#12176)upstream/rclee
* update style-code for raster-resampling * implement user-defined raster-resampling * invert filter condition * raster-resampling -> raster-resampling-mode for darwin language conventions
Diffstat (limited to 'src/mbgl/renderer')
-rw-r--r--src/mbgl/renderer/layers/render_raster_layer.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mbgl/renderer/layers/render_raster_layer.cpp b/src/mbgl/renderer/layers/render_raster_layer.cpp
index f202ed4ebb..f31f53481f 100644
--- a/src/mbgl/renderer/layers/render_raster_layer.cpp
+++ b/src/mbgl/renderer/layers/render_raster_layer.cpp
@@ -123,13 +123,15 @@ void RenderRasterLayer::render(PaintParameters& parameters, RenderSource* source
);
};
+ const gl::TextureFilter filter = evaluated.get<RasterResampling>() == RasterResamplingType::Nearest ? gl::TextureFilter::Nearest : gl::TextureFilter::Linear;
+
if (RenderImageSource* imageSource = source->as<RenderImageSource>()) {
if (imageSource->isEnabled() && imageSource->isLoaded() && !imageSource->bucket->needsUpload()) {
RasterBucket& bucket = *imageSource->bucket;
assert(bucket.texture);
- parameters.context.bindTexture(*bucket.texture, 0, gl::TextureFilter::Linear);
- parameters.context.bindTexture(*bucket.texture, 1, gl::TextureFilter::Linear);
+ parameters.context.bindTexture(*bucket.texture, 0, filter);
+ parameters.context.bindTexture(*bucket.texture, 1, filter);
for (auto matrix_ : imageSource->matrices) {
draw(matrix_,
@@ -147,8 +149,8 @@ void RenderRasterLayer::render(PaintParameters& parameters, RenderSource* source
continue;
assert(bucket.texture);
- parameters.context.bindTexture(*bucket.texture, 0, gl::TextureFilter::Linear);
- parameters.context.bindTexture(*bucket.texture, 1, gl::TextureFilter::Linear);
+ parameters.context.bindTexture(*bucket.texture, 0, filter);
+ parameters.context.bindTexture(*bucket.texture, 1, filter);
if (bucket.vertexBuffer && bucket.indexBuffer && !bucket.segments.empty()) {
// Draw only the parts of the tile that aren't drawn by another tile in the layer.