summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer/buckets
diff options
context:
space:
mode:
authorMolly Lloyd <mollymerp@users.noreply.github.com>2017-07-27 14:54:03 -0700
committerGitHub <noreply@github.com>2017-07-27 14:54:03 -0700
commitba7574ec51e2cfd4a55565d5a8337c47f1784bc2 (patch)
treec9f36f4b0a0ec24228b5ff39aac082252e9d8e21 /src/mbgl/renderer/buckets
parent175e7e26e2008d1e55664bd1064536c23b6de86a (diff)
downloadqtlocation-mapboxgl-ba7574ec51e2cfd4a55565d5a8337c47f1784bc2.tar.gz
[core] modify texture coordinate scaling (#9153)
ignore unsupported dds property tests fix tests remove unneeded texture extent variable bump gl-js to master
Diffstat (limited to 'src/mbgl/renderer/buckets')
-rw-r--r--src/mbgl/renderer/buckets/raster_bucket.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/mbgl/renderer/buckets/raster_bucket.cpp b/src/mbgl/renderer/buckets/raster_bucket.cpp
index 1a0409f456..a66dd42d74 100644
--- a/src/mbgl/renderer/buckets/raster_bucket.cpp
+++ b/src/mbgl/renderer/buckets/raster_bucket.cpp
@@ -69,16 +69,11 @@ void RasterBucket::setMask(TileMask&& mask_) {
for (const auto& id : mask) {
// Create a quad for every masked tile.
const int32_t vertexExtent = util::EXTENT >> id.z;
- const int32_t textureExtent = 32768 >> id.z;
const Point<int16_t> tlVertex = { static_cast<int16_t>(id.x * vertexExtent),
static_cast<int16_t>(id.y * vertexExtent) };
const Point<int16_t> brVertex = { static_cast<int16_t>(tlVertex.x + vertexExtent),
static_cast<int16_t>(tlVertex.y + vertexExtent) };
- const Point<uint16_t> tlTexture = { static_cast<uint16_t>(id.x * textureExtent),
- static_cast<uint16_t>(id.y * textureExtent) };
- const Point<uint16_t> brTexture = { static_cast<uint16_t>(tlTexture.x + textureExtent),
- static_cast<uint16_t>(tlTexture.y + textureExtent) };
if (segments.back().vertexLength + vertexLength > std::numeric_limits<uint16_t>::max()) {
// Move to a new segments because the old one can't hold the geometry.
@@ -86,13 +81,13 @@ void RasterBucket::setMask(TileMask&& mask_) {
}
vertices.emplace_back(
- RasterProgram::layoutVertex({ tlVertex.x, tlVertex.y }, { tlTexture.x, tlTexture.y }));
+ RasterProgram::layoutVertex({ tlVertex.x, tlVertex.y }, { static_cast<uint16_t>(tlVertex.x), static_cast<uint16_t>(tlVertex.y) }));
vertices.emplace_back(
- RasterProgram::layoutVertex({ brVertex.x, tlVertex.y }, { brTexture.x, tlTexture.y }));
+ RasterProgram::layoutVertex({ brVertex.x, tlVertex.y }, { static_cast<uint16_t>(brVertex.x), static_cast<uint16_t>(tlVertex.y) }));
vertices.emplace_back(
- RasterProgram::layoutVertex({ tlVertex.x, brVertex.y }, { tlTexture.x, brTexture.y }));
+ RasterProgram::layoutVertex({ tlVertex.x, brVertex.y }, { static_cast<uint16_t>(tlVertex.x), static_cast<uint16_t>(brVertex.y) }));
vertices.emplace_back(
- RasterProgram::layoutVertex({ brVertex.x, brVertex.y }, { brTexture.x, brTexture.y }));
+ RasterProgram::layoutVertex({ brVertex.x, brVertex.y }, { static_cast<uint16_t>(brVertex.x), static_cast<uint16_t>(brVertex.y) }));
auto& segment = segments.back();
assert(segment.vertexLength <= std::numeric_limits<uint16_t>::max());