fixes #70: raster tile rendering as toggleable mode from vector

This commit is contained in:
Justin R. Miller
2014-03-18 16:57:17 -07:00
parent bdfa761c39
commit 00a3245ce8
24 changed files with 604 additions and 196 deletions

View File

@@ -1,13 +1,13 @@
#ifndef LLMR_MAP_COVERAGE
#define LLMR_MAP_COVERAGE
#include <llmr/util/vec.hpp>
#include <llmr/map/tile.hpp>
#include <forward_list>
namespace llmr {
std::forward_list<Tile::ID> covering_tiles(int32_t zoom, const box& points);
std::forward_list<Tile::ID> covering_tiles(int32_t zoom, const box& points, const bool use_raster = false, const bool use_retina = false);
}

View File

@@ -7,6 +7,7 @@
#include <llmr/style/style.hpp>
#include <llmr/renderer/painter.hpp>
#include <llmr/util/noncopyable.hpp>
#include <llmr/util/texturepool.hpp>
#include <cstdint>
#include <string>
@@ -23,9 +24,9 @@ public:
/* setup */
void setup(float pixelRatio = 1);
void loadStyle(const uint8_t *const data, uint32_t bytes);
void loadSprite(const std::string& url);
void loadSettings();
void resize(uint32_t width, uint32_t height, uint32_t fb_width, uint32_t fb_height);
void toggleRaster();
/* callback */
bool render();
@@ -68,12 +69,12 @@ private:
TileData::State addTile(const Tile::ID& id);
TileData::State hasTile(const Tile::ID& id);
void update();
private:
Settings& settings;
Transform transform;
Texturepool texturepool;
Style style;
Painter painter;
@@ -82,6 +83,8 @@ private:
float pixel_ratio;
bool use_raster = false;
std::forward_list<Tile> tiles;
std::forward_list<std::weak_ptr<TileData>> tile_data;
};

View File

@@ -20,6 +20,7 @@
namespace llmr {
class Style;
class Raster;
class Bucket;
class LayerDescription;
class BucketDescription;
@@ -52,7 +53,7 @@ public:
};
public:
TileData(Tile::ID id, const Style& style);
TileData(Tile::ID id, const Style& style, const bool use_raster = false, const bool use_retina = false);
~TileData();
// Start loading the tile.
@@ -72,7 +73,10 @@ public:
public:
const Tile::ID id;
const bool use_raster;
const bool use_retina;
std::atomic<State> state;
std::shared_ptr<Raster> raster;
// Holds the actual geometries in this tile.
DebugFontBuffer debugFontBuffer;