remove hasData() from Bucket interface

This commit is contained in:
Konstantin Käfer
2015-04-22 18:07:27 +02:00
parent c891df0b5f
commit 839b19330e
11 changed files with 6 additions and 22 deletions

View File

@@ -24,9 +24,5 @@ void RasterTileData::parse() {
}
Bucket* RasterTileData::getBucket(StyleLayer const&) {
if (bucket.hasData()) {
return &bucket;
} else {
return nullptr;
}
return &bucket;
}

View File

@@ -60,9 +60,7 @@ Bucket* VectorTileData::getBucket(StyleLayer const& layer) {
const auto it = buckets.find(layer.bucket->name);
if (it != buckets.end()) {
assert(it->second);
if (it->second->hasData()) {
return it->second.get();
}
return it->second.get();
}
}
return nullptr;

View File

@@ -13,7 +13,6 @@ class TileID;
class Bucket : private util::noncopyable {
public:
virtual void render(Painter&, const StyleLayer&, const TileID&, const mat4&) = 0;
virtual bool hasData() const = 0;
virtual ~Bucket() {}
};

View File

@@ -21,10 +21,6 @@ void DebugBucket::render(Painter &painter, const StyleLayer & /*layer_desc*/,
painter.renderDebugText(*this, matrix);
}
bool DebugBucket::hasData() const {
return fontBuffer.index() > 0;
}
void DebugBucket::drawLines(PlainShader& shader) {
array.bind(shader, fontBuffer, BUFFER_OFFSET(0));
MBGL_CHECK_ERROR(glDrawArrays(GL_LINES, 0, (GLsizei)(fontBuffer.index())));

View File

@@ -17,7 +17,6 @@ public:
void render(Painter &painter, const StyleLayer &layer_desc, const TileID &id,
const mat4 &matrix) override;
bool hasData() const override;
void drawLines(PlainShader& shader);
void drawPoints(PlainShader& shader);

View File

@@ -35,7 +35,7 @@ public:
void render(Painter &painter, const StyleLayer &layer_desc, const TileID &id,
const mat4 &matrix) override;
bool hasData() const override;
bool hasData() const;
void addGeometry(const GeometryCollection&);
void tessellate();

View File

@@ -30,7 +30,7 @@ public:
void render(Painter &painter, const StyleLayer &layer_desc, const TileID &id,
const mat4 &matrix) override;
bool hasData() const override;
bool hasData() const;
void addGeometry(const GeometryCollection&);
void addGeometry(const std::vector<Coordinate>& line);

View File

@@ -15,9 +15,6 @@
using namespace mbgl;
void Painter::renderFill(FillBucket& bucket, const StyleLayer &layer_desc, const TileID& id, const mat4 &matrix) {
// Abort early.
if (!bucket.hasData()) return;
const FillProperties &properties = layer_desc.getProperties<FillProperties>();
mat4 vtxMatrix = translatedMatrix(matrix, properties.translate, id, properties.translateAnchor);

View File

@@ -16,7 +16,6 @@ using namespace mbgl;
void Painter::renderLine(LineBucket& bucket, const StyleLayer &layer_desc, const TileID& id, const mat4 &matrix) {
// Abort early.
if (pass == RenderPass::Opaque) return;
if (!bucket.hasData()) return;
depthMask(false);

View File

@@ -18,7 +18,7 @@ public:
void render(Painter &painter, const StyleLayer &layer_desc, const TileID &id,
const mat4 &matrix) override;
bool hasData() const override;
bool hasData() const;
bool setImage(const std::string &data);

View File

@@ -57,7 +57,7 @@ public:
void render(Painter &painter, const StyleLayer &layer_desc, const TileID &id,
const mat4 &matrix) override;
bool hasData() const override;
bool hasData() const;
bool hasTextData() const;
bool hasIconData() const;