This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
97 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include <mbgl/renderer/circle_bucket.hpp> | ||
|
||
using namespace mbgl; | ||
|
||
CircleBucket::CircleBucket(CircleVertexBuffer& vertexBuffer, | ||
TriangleElementsBuffer& elementsBuffer) | ||
: vertexBuffer_(vertexBuffer) | ||
, elementsBuffer_(elementsBuffer) { | ||
} | ||
|
||
CircleBucket::~CircleBucket() { | ||
// Do not remove. header file only contains forward definitions to unique pointers. | ||
} | ||
|
||
void CircleBucket::upload() { | ||
vertexBuffer_.upload(); | ||
elementsBuffer_.upload(); | ||
uploaded = true; | ||
} | ||
|
||
void CircleBucket::render(Painter& /* painter */, | ||
const StyleLayer& /* layer_desc */, | ||
const TileID& /* id */, | ||
const mat4& /* matrix */) { | ||
// XXX Just a stub for now. | ||
//painter.renderCircle(*this, layer_desc, id, matrix); | ||
} | ||
|
||
bool CircleBucket::hasData() const { | ||
return !triangleGroups_.empty(); | ||
} | ||
|
||
void CircleBucket::addGeometry(const GeometryCollection& /* geometryCollection */) { | ||
// XXX Just a stub for now. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#ifndef MBGL_RENDERER_CIRCLE_BUCKET | ||
#define MBGL_RENDERER_CIRCLE_BUCKET | ||
|
||
#include <mbgl/renderer/bucket.hpp> | ||
|
||
#include <mbgl/map/geometry_tile.hpp> | ||
|
||
#include <mbgl/geometry/elements_buffer.hpp> | ||
#include <mbgl/geometry/circle_buffer.hpp> | ||
|
||
#include <mbgl/style/style_bucket.hpp> | ||
#include <mbgl/style/style_layout.hpp> | ||
|
||
namespace mbgl { | ||
|
||
class CircleVertexBuffer; | ||
class CircleElementsBuffer; | ||
|
||
class CircleBucket : public Bucket { | ||
using TriangleGroup = ElementGroup<3>; | ||
|
||
public: | ||
CircleBucket(CircleVertexBuffer &vertexBuffer, TriangleElementsBuffer &elementsBuffer); | ||
~CircleBucket() override; | ||
|
||
void upload() override; | ||
void render(Painter&, const StyleLayer&, const TileID&, const mat4&) override; | ||
|
||
bool hasData() const; | ||
void addGeometry(const GeometryCollection&); | ||
|
||
private: | ||
CircleVertexBuffer& vertexBuffer_; | ||
TriangleElementsBuffer& elementsBuffer_; | ||
|
||
std::vector<std::unique_ptr<TriangleGroup>> triangleGroups_; | ||
}; | ||
|
||
} // namespace mbgl | ||
|
||
#endif // MBGL_RENDERER_CIRCLE_BUCKET |