[core] No need for optional in map of VertexArrays
This commit is contained in:
@@ -67,10 +67,10 @@ public:
|
||||
.concat(paintPropertyBinders.attributeBindings(currentProperties));
|
||||
|
||||
for (auto& segment : segments) {
|
||||
optional<gl::VertexArray>& vertexArray = segment.vertexArrays[layerID];
|
||||
auto vertexArrayIt = segment.vertexArrays.find(layerID);
|
||||
|
||||
if (!vertexArray) {
|
||||
vertexArray = context.createVertexArray();
|
||||
if (vertexArrayIt == segment.vertexArrays.end()) {
|
||||
vertexArrayIt = segment.vertexArrays.emplace(layerID, context.createVertexArray()).first;
|
||||
}
|
||||
|
||||
program.draw(
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
std::move(stencilMode),
|
||||
std::move(colorMode),
|
||||
allUniformValues,
|
||||
*vertexArray,
|
||||
vertexArrayIt->second,
|
||||
Attributes::offsetBindings(allAttributeBindings, segment.vertexOffset),
|
||||
indexBuffer,
|
||||
segment.indexOffset,
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#include <mbgl/gl/context.hpp>
|
||||
#include <mbgl/gl/vertex_array.hpp>
|
||||
#include <mbgl/util/optional.hpp>
|
||||
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
@@ -35,7 +34,7 @@ public:
|
||||
// data-driven paint properties
|
||||
// * when two fill layers have the same layout properties, but one
|
||||
// uses fill-color and the other uses fill-pattern
|
||||
mutable std::map<std::string, optional<gl::VertexArray>> vertexArrays;
|
||||
mutable std::map<std::string, gl::VertexArray> vertexArrays;
|
||||
};
|
||||
|
||||
template <class Attributes>
|
||||
|
||||
@@ -371,10 +371,10 @@ public:
|
||||
.concat(paintPropertyBinders.attributeBindings(currentProperties));
|
||||
|
||||
for (auto& segment : segments) {
|
||||
optional<gl::VertexArray>& vertexArray = segment.vertexArrays[layerID];
|
||||
auto vertexArrayIt = segment.vertexArrays.find(layerID);
|
||||
|
||||
if (!vertexArray) {
|
||||
vertexArray = context.createVertexArray();
|
||||
if (vertexArrayIt == segment.vertexArrays.end()) {
|
||||
vertexArrayIt = segment.vertexArrays.emplace(layerID, context.createVertexArray()).first;
|
||||
}
|
||||
|
||||
program.draw(
|
||||
@@ -384,7 +384,7 @@ public:
|
||||
std::move(stencilMode),
|
||||
std::move(colorMode),
|
||||
allUniformValues,
|
||||
*vertexArray,
|
||||
vertexArrayIt->second,
|
||||
Attributes::offsetBindings(allAttributeBindings, segment.vertexOffset),
|
||||
indexBuffer,
|
||||
segment.indexOffset,
|
||||
|
||||
Reference in New Issue
Block a user