From da8aa391d0a1079bbc697207803a48fce8ab916f Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 21 Oct 2014 15:00:44 -0700 Subject: Render map with a copy of TransformState --- include/mbgl/renderer/painter.hpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'include/mbgl/renderer') diff --git a/include/mbgl/renderer/painter.hpp b/include/mbgl/renderer/painter.hpp index a8229a0978..2b0ac070f7 100644 --- a/include/mbgl/renderer/painter.hpp +++ b/include/mbgl/renderer/painter.hpp @@ -35,9 +35,12 @@ enum class RenderPass : bool { Opaque, Translucent }; class Transform; class Style; class Tile; +class Sprite; +class SpriteAtlas; class GlyphAtlas; class Source; class StyleSource; +class StyleLayerGroup; class FillBucket; class LineBucket; @@ -53,10 +56,9 @@ class RasterTileData; class Painter : private util::noncopyable { public: - Painter(Map &map); + Painter(SpriteAtlas&, GlyphAtlas&); ~Painter(); - void setup(); // Perform cleanup tasks that prepare shutting down the app. This doesn't mean that the @@ -73,6 +75,14 @@ public: // Updates the default matrices to the current viewport dimensions. void changeMatrix(); + void render(const Style& style, + const std::set>& sources, + TransformState state, + timestamp time); + + void renderLayers(util::ptr group); + void renderLayer(util::ptr layer_desc, RenderPass pass, const Tile::ID* id = nullptr, const mat4* matrix = nullptr); + // Renders a particular layer from a tile. void renderTileLayer(const Tile& tile, util::ptr layer_desc, const mat4 &matrix); @@ -167,9 +177,10 @@ public: }(); private: - Map& map; + TransformState state; bool debug = false; + int indent = 0; uint32_t gl_program = 0; float gl_lineWidth = 0; @@ -183,6 +194,9 @@ private: public: FrameHistory frameHistory; + SpriteAtlas& spriteAtlas; + GlyphAtlas& glyphAtlas; + std::unique_ptr plainShader; std::unique_ptr outlineShader; std::unique_ptr lineShader; -- cgit v1.2.1