From df925fe0e5429085f0f443f4be1326c0616f6acc Mon Sep 17 00:00:00 2001 From: Lauren Budorick Date: Mon, 4 Aug 2014 17:24:22 -0700 Subject: nonworking prerendering attempts --- include/mbgl/map/map.hpp | 4 +++- include/mbgl/renderer/painter.hpp | 3 +++ include/mbgl/style/rasterize_properties.hpp | 8 ++++---- include/mbgl/style/style_bucket.hpp | 3 +++ 4 files changed, 13 insertions(+), 5 deletions(-) (limited to 'include') 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 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& layers); @@ -150,7 +153,6 @@ private: // Unconditionally performs a render with the current map state. void render(); - void renderLayers(std::shared_ptr group); void renderLayer(std::shared_ptr 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 layer_desc, const Tile::ID& id); void renderSymbol(SymbolBucket& bucket, std::shared_ptr layer_desc, const Tile::ID& id); void renderRaster(RasterBucket& bucket, std::shared_ptr 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 void renderPrerenderedTexture(PrerenderedTexture &texture, const Properties &properties); + + void createPrerendered(RasterBucket& bucket, std::shared_ptr 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 enabled = ConstantFunction(false); +// Function enabled = ConstantFunction(false); // going to need to delete this? or keep ? Function buffer = ConstantFunction(1.0f / 32.0f); Function size = ConstantFunction(256); Function blur = ConstantFunction(0); - inline bool isEnabled(const int8_t z) const { - return util::apply_visitor(FunctionEvaluator(z), enabled); - } +// inline bool isEnabled(const int8_t z) const { +// return util::apply_visitor(FunctionEvaluator(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