pass through name when rendering

This commit is contained in:
Konstantin Käfer
2014-01-23 15:52:59 +01:00
parent e3f98b0f13
commit 9ba8d5b7a6
4 changed files with 12 additions and 11 deletions

View File

@@ -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);

View File

@@ -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();

View File

@@ -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);
}

View File

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