diff options
author | Justin R. Miller <incanus@codesorcery.net> | 2015-03-04 13:37:03 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-03-09 11:57:31 -0700 |
commit | 41c3b82d3e2a160cfa52d5d7c3e2e02eb81f32c0 (patch) | |
tree | a2404a7e7819911dfcbb7c4a928f111811d5288d /src/mbgl/renderer/fill_bucket.cpp | |
parent | 831264d5305b5352b7e8d419d29750119a5a2cf9 (diff) | |
download | qtlocation-mapboxgl-41c3b82d3e2a160cfa52d5d7c3e2e02eb81f32c0.tar.gz |
refs #928: bookmarking working build of refactor
Diffstat (limited to 'src/mbgl/renderer/fill_bucket.cpp')
-rw-r--r-- | src/mbgl/renderer/fill_bucket.cpp | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/src/mbgl/renderer/fill_bucket.cpp b/src/mbgl/renderer/fill_bucket.cpp index c632244d77..86b9daeada 100644 --- a/src/mbgl/renderer/fill_bucket.cpp +++ b/src/mbgl/renderer/fill_bucket.cpp @@ -1,17 +1,12 @@ #include <mbgl/renderer/fill_bucket.hpp> #include <mbgl/geometry/fill_buffer.hpp> #include <mbgl/geometry/elements_buffer.hpp> -#include <mbgl/geometry/geometry.hpp> - #include <mbgl/renderer/painter.hpp> #include <mbgl/style/style.hpp> #include <mbgl/style/style_layout.hpp> -#include <mbgl/map/vector_tile.hpp> #include <mbgl/util/std.hpp> - #include <mbgl/platform/gl.hpp> - #include <cassert> struct geometry_too_long_exception : std::exception {}; @@ -69,24 +64,13 @@ FillBucket::~FillBucket() { } } -void FillBucket::addGeometry(pbf& geom) { - Geometry::command cmd; - - Coordinate coord; - Geometry geometry(geom); - int32_t x, y; - while ((cmd = geometry.next(x, y)) != Geometry::end) { - if (cmd == Geometry::move_to) { - if (line.size()) { - clipper.AddPath(line, ClipperLib::ptSubject, true); - line.clear(); - hasVertices = true; - } - } - line.emplace_back(x, y); - } +void FillBucket::addGeometry(const Geometry& fill) { + const GeometryPolygon& polygon = fill.get<GeometryPolygon>(); - if (line.size()) { + for (auto line_it = polygon.begin(); line_it != polygon.end(); line_it++) { + for (auto point_it = line_it->begin(); point_it != line_it->end(); point_it++) { + line.emplace_back(point_it->x, point_it->y); + } clipper.AddPath(line, ClipperLib::ptSubject, true); line.clear(); hasVertices = true; |