pass through name when rendering
This commit is contained in:
@@ -15,7 +15,7 @@ class FillBucket : public Bucket {
|
||||
public:
|
||||
FillBucket(FillBuffer& buffer);
|
||||
|
||||
virtual void render(Painter& painter);
|
||||
virtual void render(Painter& painter, const std::string& layer_name);
|
||||
|
||||
void addGeometry(pbf& data);
|
||||
void drawElements(int32_t attrib);
|
||||
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
void renderDebug(const std::shared_ptr<Tile>& tile);
|
||||
|
||||
void renderBackground();
|
||||
void renderFill(FillBucket& bucket, const FillProperties& style);
|
||||
void renderFill(FillBucket& bucket, const std::string& layer_name);
|
||||
|
||||
|
||||
void drawClippingMask();
|
||||
|
||||
@@ -112,11 +112,6 @@ void FillBucket::drawVertices(int32_t attrib) {
|
||||
glDrawArrays(GL_LINE_STRIP, 0, length);
|
||||
}
|
||||
|
||||
void FillBucket::render(Painter& painter) {
|
||||
// TODO: obtain the correct style information for this layer
|
||||
FillProperties properties;
|
||||
properties.fill_color = {{ 0, 0, 1, 0.5 }};
|
||||
properties.stroke_color = properties.fill_color;
|
||||
|
||||
painter.renderFill(*this, properties);
|
||||
void FillBucket::render(Painter& painter, const std::string& layer_name) {
|
||||
painter.renderFill(*this, layer_name);
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ void Painter::render(const Tile::Ptr& tile) {
|
||||
// glDrawArrays(GL_LINE_STRIP, 0, tile->lineVertex.length());
|
||||
|
||||
for (Layer& layer : tile->layers) {
|
||||
layer.bucket->render(*this);
|
||||
layer.bucket->render(*this, layer.name);
|
||||
}
|
||||
|
||||
if (settings.debug) {
|
||||
@@ -179,7 +179,13 @@ void Painter::render(const Tile::Ptr& tile) {
|
||||
renderBackground();
|
||||
}
|
||||
|
||||
void Painter::renderFill(FillBucket& bucket, const FillProperties& properties) {
|
||||
void Painter::renderFill(FillBucket& bucket, const std::string& layer_name) {
|
||||
// TODO: obtain the correct style information for this layer
|
||||
FillProperties properties;
|
||||
properties.fill_color = {{ 0, 0, 1, 0.5 }};
|
||||
properties.stroke_color = properties.fill_color;
|
||||
|
||||
|
||||
// Draw the stencil mask.
|
||||
{
|
||||
// We're only drawing to the first seven bits (== support a maximum of
|
||||
|
||||
Reference in New Issue
Block a user