diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-05-28 15:30:14 +0300 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-05-28 16:16:42 +0300 |
commit | 2f97a2660ada44cd18f2e02b4de4eb42cfcb07b1 (patch) | |
tree | d59193e56225fed08050add86b618d21da2e87ed /src/mbgl/renderer/render_tile.cpp | |
parent | 43966f1611c52fef9b7fc344410c3a5235e07765 (diff) | |
download | qtlocation-mapboxgl-2f97a2660ada44cd18f2e02b4de4eb42cfcb07b1.tar.gz |
[core] RenderTile returns textures by const reference
Diffstat (limited to 'src/mbgl/renderer/render_tile.cpp')
-rw-r--r-- | src/mbgl/renderer/render_tile.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mbgl/renderer/render_tile.cpp b/src/mbgl/renderer/render_tile.cpp index a640a96776..b8fb4b2a11 100644 --- a/src/mbgl/renderer/render_tile.cpp +++ b/src/mbgl/renderer/render_tile.cpp @@ -77,14 +77,16 @@ optional<ImagePosition> RenderTile::getPattern(const std::string& pattern) const return static_cast<const GeometryTile&>(tile).getPattern(pattern); } -const optional<gfx::Texture>& RenderTile::getGlyphAtlasTexture() const { +const gfx::Texture& RenderTile::getGlyphAtlasTexture() const { assert(tile.kind == Tile::Kind::Geometry); - return static_cast<const GeometryTile&>(tile).glyphAtlasTexture; + assert(static_cast<const GeometryTile&>(tile).glyphAtlasTexture); + return *(static_cast<const GeometryTile&>(tile).glyphAtlasTexture); } -const optional<gfx::Texture>& RenderTile::getIconAtlasTexture() const { +const gfx::Texture& RenderTile::getIconAtlasTexture() const { assert(tile.kind == Tile::Kind::Geometry); - return static_cast<const GeometryTile&>(tile).iconAtlasTexture; + assert(static_cast<const GeometryTile&>(tile).iconAtlasTexture); + return *(static_cast<const GeometryTile&>(tile).iconAtlasTexture); } std::shared_ptr<FeatureIndex> RenderTile::getFeatureIndex() const { |