diff options
author | Lauren Budorick <lauren@mapbox.com> | 2014-08-04 17:24:22 -0700 |
---|---|---|
committer | Lauren Budorick <lauren@mapbox.com> | 2014-08-11 12:12:43 -0700 |
commit | df925fe0e5429085f0f443f4be1326c0616f6acc (patch) | |
tree | a502590190ef6898ddbbd468cf2afb03ea55a4d3 /include/mbgl | |
parent | 7a98ad4cf949dd1279719bf926bd08da0133210f (diff) | |
download | qtlocation-mapboxgl-df925fe0e5429085f0f443f4be1326c0616f6acc.tar.gz |
nonworking prerendering attempts
Diffstat (limited to 'include/mbgl')
-rw-r--r-- | include/mbgl/map/map.hpp | 4 | ||||
-rw-r--r-- | include/mbgl/renderer/painter.hpp | 3 | ||||
-rw-r--r-- | include/mbgl/style/rasterize_properties.hpp | 8 | ||||
-rw-r--r-- | include/mbgl/style/style_bucket.hpp | 3 |
4 files changed, 13 insertions, 5 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index be01b456cc..c54b40d752 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -45,6 +45,8 @@ public: // Triggers a lazy rerender: only performs a render when the map is not clean. void rerender(); + void renderLayers(std::shared_ptr<StyleLayerGroup> group); + // Forces a map update: always triggers a rerender. void update(); @@ -139,6 +141,7 @@ private: void updateTiles(); void updateRenderState(); + void updateRenderState(const mat4 vtxMatrix); size_t countLayers(const std::vector<LayerDescription>& layers); @@ -150,7 +153,6 @@ private: // Unconditionally performs a render with the current map state. void render(); - void renderLayers(std::shared_ptr<StyleLayerGroup> group); void renderLayer(std::shared_ptr<StyleLayer> layer_desc, RenderPass pass); private: diff --git a/include/mbgl/renderer/painter.hpp b/include/mbgl/renderer/painter.hpp index b4023de167..82b71b6cb0 100644 --- a/include/mbgl/renderer/painter.hpp +++ b/include/mbgl/renderer/painter.hpp @@ -84,12 +84,15 @@ public: void renderLine(LineBucket& bucket, std::shared_ptr<StyleLayer> layer_desc, const Tile::ID& id); void renderSymbol(SymbolBucket& bucket, std::shared_ptr<StyleLayer> layer_desc, const Tile::ID& id); void renderRaster(RasterBucket& bucket, std::shared_ptr<StyleLayer> layer_desc, const Tile::ID& id); + void renderRaster(GLuint texture, const RasterizeProperties &properties); // do I want to save that? void preparePrerender(PrerenderedTexture &texture); void finishPrerender(PrerenderedTexture &texture); template <typename Properties> void renderPrerenderedTexture(PrerenderedTexture &texture, const Properties &properties); + + void createPrerendered(RasterBucket& bucket, std::shared_ptr<StyleLayer> layer_desc, const Tile::ID& id, const RasterizeProperties& properties); void resize(); diff --git a/include/mbgl/style/rasterize_properties.hpp b/include/mbgl/style/rasterize_properties.hpp index aea90dfbdd..e1e56d6ec9 100644 --- a/include/mbgl/style/rasterize_properties.hpp +++ b/include/mbgl/style/rasterize_properties.hpp @@ -15,14 +15,14 @@ public: class RasterizeProperties { public: - Function<bool> enabled = ConstantFunction<bool>(false); +// Function<bool> enabled = ConstantFunction<bool>(false); // going to need to delete this? or keep ? Function<float> buffer = ConstantFunction<float>(1.0f / 32.0f); Function<float> size = ConstantFunction<float>(256); Function<float> blur = ConstantFunction<float>(0); - inline bool isEnabled(const int8_t z) const { - return util::apply_visitor(FunctionEvaluator<bool>(z), enabled); - } +// inline bool isEnabled(const int8_t z) const { +// return util::apply_visitor(FunctionEvaluator<bool>(z), enabled); +// } inline RasterizedProperties get(const int8_t z) const { RasterizedProperties properties; diff --git a/include/mbgl/style/style_bucket.hpp b/include/mbgl/style/style_bucket.hpp index 530e0c1259..25786720b1 100644 --- a/include/mbgl/style/style_bucket.hpp +++ b/include/mbgl/style/style_bucket.hpp @@ -82,6 +82,9 @@ public: class StyleBucketRaster { public: + uint16_t raster_size = 256; + float blur = 0.0f; + float buffer = 0.03125f; }; typedef util::variant<StyleBucketFill, StyleBucketLine, StyleBucketSymbol, |