diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-17 08:58:36 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-17 09:36:43 -0700 |
commit | 63558e06ad4fbc33ad3bdec57dc0ead2b369a7b0 (patch) | |
tree | 1a8e625557908259fd4a8fff1629d26d6e74b854 /src/mbgl/text | |
parent | 4c26759b69bf1c5ef12b244562784f97d773315f (diff) | |
download | qtlocation-mapboxgl-63558e06ad4fbc33ad3bdec57dc0ead2b369a7b0.tar.gz |
[core] Remove obsolete modular arithmetic on atlas coordinates
We switched to 16-bit coordinates in attributes in b0cb8715ed74678b4d0f05829fa71a590e41b2f6, so there's no longer any reason to require that they are divisible by four.
Diffstat (limited to 'src/mbgl/text')
-rw-r--r-- | src/mbgl/text/glyph_atlas.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/mbgl/text/glyph_atlas.cpp b/src/mbgl/text/glyph_atlas.cpp index b43971f704..c6083fe0cc 100644 --- a/src/mbgl/text/glyph_atlas.cpp +++ b/src/mbgl/text/glyph_atlas.cpp @@ -184,14 +184,8 @@ Rect<uint16_t> GlyphAtlas::addGlyph(GlyphValue& value) { // Add a 1px border around every image. const uint32_t padding = 1; - uint16_t width = value.bitmap.size.width + 2 * padding; - uint16_t height = value.bitmap.size.height + 2 * padding; - - // Increase to next number divisible by 4, but at least 1. - // This is so we can scale down the texture coordinates and pack them - // into 2 bytes rather than 4 bytes. - width += (4 - width % 4); - height += (4 - height % 4); + const uint16_t width = value.bitmap.size.width + 2 * padding; + const uint16_t height = value.bitmap.size.height + 2 * padding; Rect<uint16_t> rect = bin.allocate(width, height); if (rect.w == 0) { |