[core] RenderTile returns textures by const reference

This commit is contained in:
Mikhail Pozdnyakov
2019-05-28 15:30:14 +03:00
parent 43966f1611
commit 2f97a2660a
6 changed files with 19 additions and 17 deletions

View File

@@ -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 {