From 4ea281c750c5afcc68f2832bb42d98a1cbce6735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Wed, 16 Jul 2014 18:53:56 -0700 Subject: rename llmr => mbgl --- include/llmr/geometry/anchor.hpp | 25 - include/llmr/geometry/binpack.hpp | 100 ---- include/llmr/geometry/buffer.hpp | 114 ---- include/llmr/geometry/debug_font_buffer.hpp | 17 - include/llmr/geometry/elements_buffer.hpp | 54 -- include/llmr/geometry/fill_buffer.hpp | 21 - include/llmr/geometry/geometry.hpp | 77 --- include/llmr/geometry/glyph_atlas.hpp | 51 -- include/llmr/geometry/icon_buffer.hpp | 20 - include/llmr/geometry/interpolate.hpp | 13 - include/llmr/geometry/line_buffer.hpp | 39 -- include/llmr/geometry/sprite_atlas.hpp | 74 --- include/llmr/geometry/text_buffer.hpp | 25 - include/llmr/geometry/vao.hpp | 101 ---- include/llmr/geometry/vertex_buffer.hpp | 35 -- include/llmr/llmr.hpp | 7 - include/llmr/map/map.hpp | 194 ------ include/llmr/map/raster_tile_data.hpp | 28 - include/llmr/map/source.hpp | 72 --- include/llmr/map/sprite.hpp | 65 -- include/llmr/map/tile.hpp | 73 --- include/llmr/map/tile_data.hpp | 77 --- include/llmr/map/tile_parser.hpp | 68 --- include/llmr/map/transform.hpp | 106 ---- include/llmr/map/transform_state.hpp | 69 --- include/llmr/map/vector_tile.hpp | 119 ---- include/llmr/map/vector_tile_data.hpp | 55 -- include/llmr/map/view.hpp | 54 -- include/llmr/platform/event.hpp | 79 --- include/llmr/platform/gl.hpp | 83 --- include/llmr/platform/log.hpp | 71 --- include/llmr/platform/platform.hpp | 46 -- include/llmr/platform/request.hpp | 48 -- include/llmr/renderer/bucket.hpp | 26 - include/llmr/renderer/debug_bucket.hpp | 36 -- include/llmr/renderer/fill_bucket.hpp | 88 --- include/llmr/renderer/frame_history.hpp | 32 - include/llmr/renderer/icon_bucket.hpp | 53 -- include/llmr/renderer/line_bucket.hpp | 61 -- include/llmr/renderer/painter.hpp | 219 ------- include/llmr/renderer/prerendered_texture.hpp | 36 -- include/llmr/renderer/raster_bucket.hpp | 30 - include/llmr/renderer/text_bucket.hpp | 61 -- include/llmr/shader/composite_shader.hpp | 29 - include/llmr/shader/dot_shader.hpp | 33 - include/llmr/shader/gaussian_shader.hpp | 29 - include/llmr/shader/icon_shader.hpp | 42 -- include/llmr/shader/line_shader.hpp | 45 -- include/llmr/shader/linejoin_shader.hpp | 37 -- include/llmr/shader/outline_shader.hpp | 29 - include/llmr/shader/pattern_shader.hpp | 45 -- include/llmr/shader/plain_shader.hpp | 26 - include/llmr/shader/raster_shader.hpp | 33 - include/llmr/shader/shader.hpp | 29 - include/llmr/shader/text_shader.hpp | 72 --- include/llmr/style/applied_class_properties.hpp | 39 -- include/llmr/style/class_dictionary.hpp | 32 - include/llmr/style/class_properties.hpp | 43 -- include/llmr/style/filter_comparison.hpp | 65 -- include/llmr/style/filter_comparison_private.hpp | 23 - include/llmr/style/filter_expression.hpp | 54 -- include/llmr/style/filter_expression_private.hpp | 75 --- include/llmr/style/function_properties.hpp | 79 --- include/llmr/style/property_fallback.hpp | 29 - include/llmr/style/property_key.hpp | 57 -- include/llmr/style/property_transition.hpp | 15 - include/llmr/style/property_value.hpp | 21 - include/llmr/style/rasterize_properties.hpp | 38 -- include/llmr/style/style.hpp | 68 --- include/llmr/style/style_bucket.hpp | 88 --- include/llmr/style/style_layer.hpp | 94 --- include/llmr/style/style_layer_group.hpp | 23 - include/llmr/style/style_parser.hpp | 119 ---- include/llmr/style/style_properties.hpp | 116 ---- include/llmr/style/style_source.hpp | 29 - include/llmr/style/types.hpp | 160 ----- include/llmr/style/value.hpp | 43 -- include/llmr/style/value_comparison.hpp | 109 ---- include/llmr/text/collision.hpp | 32 - include/llmr/text/glyph.hpp | 61 -- include/llmr/text/glyph_store.hpp | 95 --- include/llmr/text/placement.hpp | 37 -- include/llmr/text/rotation_range.hpp | 54 -- include/llmr/text/types.hpp | 109 ---- include/llmr/util/clip_ids.hpp | 19 - include/llmr/util/constants.hpp | 33 - include/llmr/util/enum.hpp | 55 -- include/llmr/util/error.hpp | 20 - include/llmr/util/image.hpp | 36 -- include/llmr/util/io.hpp | 15 - include/llmr/util/mat4.hpp | 45 -- include/llmr/util/math.hpp | 115 ---- include/llmr/util/noncopyable.hpp | 23 - include/llmr/util/pbf.hpp | 184 ------ include/llmr/util/raster.hpp | 70 --- include/llmr/util/rect.hpp | 21 - include/llmr/util/recursive_wrapper.hpp | 127 ---- include/llmr/util/std.hpp | 38 -- include/llmr/util/string.hpp | 24 - include/llmr/util/texturepool.hpp | 25 - include/llmr/util/threadpool.hpp | 45 -- include/llmr/util/time.hpp | 42 -- include/llmr/util/timer.hpp | 40 -- include/llmr/util/token.hpp | 52 -- include/llmr/util/transition.hpp | 84 --- include/llmr/util/unitbezier.hpp | 121 ---- include/llmr/util/utf.hpp | 50 -- include/llmr/util/uv.hpp | 141 ----- include/llmr/util/variant.hpp | 731 ----------------------- include/llmr/util/vec.hpp | 117 ---- include/mbgl/geometry/anchor.hpp | 25 + include/mbgl/geometry/binpack.hpp | 100 ++++ include/mbgl/geometry/buffer.hpp | 114 ++++ include/mbgl/geometry/debug_font_buffer.hpp | 17 + include/mbgl/geometry/elements_buffer.hpp | 54 ++ include/mbgl/geometry/fill_buffer.hpp | 21 + include/mbgl/geometry/geometry.hpp | 77 +++ include/mbgl/geometry/glyph_atlas.hpp | 51 ++ include/mbgl/geometry/icon_buffer.hpp | 20 + include/mbgl/geometry/interpolate.hpp | 13 + include/mbgl/geometry/line_buffer.hpp | 39 ++ include/mbgl/geometry/sprite_atlas.hpp | 74 +++ include/mbgl/geometry/text_buffer.hpp | 25 + include/mbgl/geometry/vao.hpp | 101 ++++ include/mbgl/geometry/vertex_buffer.hpp | 35 ++ include/mbgl/map/map.hpp | 194 ++++++ include/mbgl/map/raster_tile_data.hpp | 28 + include/mbgl/map/source.hpp | 72 +++ include/mbgl/map/sprite.hpp | 65 ++ include/mbgl/map/tile.hpp | 73 +++ include/mbgl/map/tile_data.hpp | 77 +++ include/mbgl/map/tile_parser.hpp | 68 +++ include/mbgl/map/transform.hpp | 106 ++++ include/mbgl/map/transform_state.hpp | 69 +++ include/mbgl/map/vector_tile.hpp | 119 ++++ include/mbgl/map/vector_tile_data.hpp | 55 ++ include/mbgl/map/view.hpp | 54 ++ include/mbgl/mbgl.hpp | 7 + include/mbgl/platform/event.hpp | 79 +++ include/mbgl/platform/gl.hpp | 83 +++ include/mbgl/platform/log.hpp | 71 +++ include/mbgl/platform/platform.hpp | 46 ++ include/mbgl/platform/request.hpp | 48 ++ include/mbgl/renderer/bucket.hpp | 26 + include/mbgl/renderer/debug_bucket.hpp | 36 ++ include/mbgl/renderer/fill_bucket.hpp | 88 +++ include/mbgl/renderer/frame_history.hpp | 32 + include/mbgl/renderer/icon_bucket.hpp | 53 ++ include/mbgl/renderer/line_bucket.hpp | 61 ++ include/mbgl/renderer/painter.hpp | 219 +++++++ include/mbgl/renderer/prerendered_texture.hpp | 36 ++ include/mbgl/renderer/raster_bucket.hpp | 30 + include/mbgl/renderer/text_bucket.hpp | 61 ++ include/mbgl/shader/composite_shader.hpp | 29 + include/mbgl/shader/dot_shader.hpp | 33 + include/mbgl/shader/gaussian_shader.hpp | 29 + include/mbgl/shader/icon_shader.hpp | 42 ++ include/mbgl/shader/line_shader.hpp | 45 ++ include/mbgl/shader/linejoin_shader.hpp | 37 ++ include/mbgl/shader/outline_shader.hpp | 29 + include/mbgl/shader/pattern_shader.hpp | 45 ++ include/mbgl/shader/plain_shader.hpp | 26 + include/mbgl/shader/raster_shader.hpp | 33 + include/mbgl/shader/shader.hpp | 29 + include/mbgl/shader/text_shader.hpp | 72 +++ include/mbgl/style/applied_class_properties.hpp | 39 ++ include/mbgl/style/class_dictionary.hpp | 32 + include/mbgl/style/class_properties.hpp | 43 ++ include/mbgl/style/filter_comparison.hpp | 65 ++ include/mbgl/style/filter_comparison_private.hpp | 23 + include/mbgl/style/filter_expression.hpp | 54 ++ include/mbgl/style/filter_expression_private.hpp | 75 +++ include/mbgl/style/function_properties.hpp | 79 +++ include/mbgl/style/property_fallback.hpp | 29 + include/mbgl/style/property_key.hpp | 57 ++ include/mbgl/style/property_transition.hpp | 15 + include/mbgl/style/property_value.hpp | 21 + include/mbgl/style/rasterize_properties.hpp | 38 ++ include/mbgl/style/style.hpp | 68 +++ include/mbgl/style/style_bucket.hpp | 88 +++ include/mbgl/style/style_layer.hpp | 94 +++ include/mbgl/style/style_layer_group.hpp | 23 + include/mbgl/style/style_parser.hpp | 119 ++++ include/mbgl/style/style_properties.hpp | 116 ++++ include/mbgl/style/style_source.hpp | 29 + include/mbgl/style/types.hpp | 160 +++++ include/mbgl/style/value.hpp | 43 ++ include/mbgl/style/value_comparison.hpp | 109 ++++ include/mbgl/text/collision.hpp | 32 + include/mbgl/text/glyph.hpp | 61 ++ include/mbgl/text/glyph_store.hpp | 95 +++ include/mbgl/text/placement.hpp | 37 ++ include/mbgl/text/rotation_range.hpp | 54 ++ include/mbgl/text/types.hpp | 109 ++++ include/mbgl/util/clip_ids.hpp | 19 + include/mbgl/util/constants.hpp | 33 + include/mbgl/util/enum.hpp | 55 ++ include/mbgl/util/error.hpp | 20 + include/mbgl/util/image.hpp | 36 ++ include/mbgl/util/io.hpp | 15 + include/mbgl/util/mat4.hpp | 45 ++ include/mbgl/util/math.hpp | 115 ++++ include/mbgl/util/noncopyable.hpp | 23 + include/mbgl/util/pbf.hpp | 184 ++++++ include/mbgl/util/raster.hpp | 70 +++ include/mbgl/util/rect.hpp | 21 + include/mbgl/util/recursive_wrapper.hpp | 127 ++++ include/mbgl/util/std.hpp | 38 ++ include/mbgl/util/string.hpp | 24 + include/mbgl/util/texturepool.hpp | 25 + include/mbgl/util/threadpool.hpp | 45 ++ include/mbgl/util/time.hpp | 42 ++ include/mbgl/util/timer.hpp | 40 ++ include/mbgl/util/token.hpp | 52 ++ include/mbgl/util/transition.hpp | 84 +++ include/mbgl/util/unitbezier.hpp | 121 ++++ include/mbgl/util/utf.hpp | 50 ++ include/mbgl/util/uv.hpp | 141 +++++ include/mbgl/util/variant.hpp | 731 +++++++++++++++++++++++ include/mbgl/util/vec.hpp | 117 ++++ 220 files changed, 7251 insertions(+), 7251 deletions(-) delete mode 100644 include/llmr/geometry/anchor.hpp delete mode 100644 include/llmr/geometry/binpack.hpp delete mode 100644 include/llmr/geometry/buffer.hpp delete mode 100644 include/llmr/geometry/debug_font_buffer.hpp delete mode 100644 include/llmr/geometry/elements_buffer.hpp delete mode 100644 include/llmr/geometry/fill_buffer.hpp delete mode 100644 include/llmr/geometry/geometry.hpp delete mode 100644 include/llmr/geometry/glyph_atlas.hpp delete mode 100644 include/llmr/geometry/icon_buffer.hpp delete mode 100644 include/llmr/geometry/interpolate.hpp delete mode 100644 include/llmr/geometry/line_buffer.hpp delete mode 100644 include/llmr/geometry/sprite_atlas.hpp delete mode 100644 include/llmr/geometry/text_buffer.hpp delete mode 100644 include/llmr/geometry/vao.hpp delete mode 100644 include/llmr/geometry/vertex_buffer.hpp delete mode 100644 include/llmr/llmr.hpp delete mode 100644 include/llmr/map/map.hpp delete mode 100644 include/llmr/map/raster_tile_data.hpp delete mode 100644 include/llmr/map/source.hpp delete mode 100644 include/llmr/map/sprite.hpp delete mode 100644 include/llmr/map/tile.hpp delete mode 100644 include/llmr/map/tile_data.hpp delete mode 100644 include/llmr/map/tile_parser.hpp delete mode 100644 include/llmr/map/transform.hpp delete mode 100644 include/llmr/map/transform_state.hpp delete mode 100644 include/llmr/map/vector_tile.hpp delete mode 100644 include/llmr/map/vector_tile_data.hpp delete mode 100644 include/llmr/map/view.hpp delete mode 100644 include/llmr/platform/event.hpp delete mode 100644 include/llmr/platform/gl.hpp delete mode 100644 include/llmr/platform/log.hpp delete mode 100644 include/llmr/platform/platform.hpp delete mode 100644 include/llmr/platform/request.hpp delete mode 100644 include/llmr/renderer/bucket.hpp delete mode 100644 include/llmr/renderer/debug_bucket.hpp delete mode 100644 include/llmr/renderer/fill_bucket.hpp delete mode 100644 include/llmr/renderer/frame_history.hpp delete mode 100644 include/llmr/renderer/icon_bucket.hpp delete mode 100644 include/llmr/renderer/line_bucket.hpp delete mode 100644 include/llmr/renderer/painter.hpp delete mode 100644 include/llmr/renderer/prerendered_texture.hpp delete mode 100644 include/llmr/renderer/raster_bucket.hpp delete mode 100644 include/llmr/renderer/text_bucket.hpp delete mode 100644 include/llmr/shader/composite_shader.hpp delete mode 100644 include/llmr/shader/dot_shader.hpp delete mode 100644 include/llmr/shader/gaussian_shader.hpp delete mode 100644 include/llmr/shader/icon_shader.hpp delete mode 100644 include/llmr/shader/line_shader.hpp delete mode 100644 include/llmr/shader/linejoin_shader.hpp delete mode 100644 include/llmr/shader/outline_shader.hpp delete mode 100644 include/llmr/shader/pattern_shader.hpp delete mode 100644 include/llmr/shader/plain_shader.hpp delete mode 100644 include/llmr/shader/raster_shader.hpp delete mode 100644 include/llmr/shader/shader.hpp delete mode 100644 include/llmr/shader/text_shader.hpp delete mode 100644 include/llmr/style/applied_class_properties.hpp delete mode 100644 include/llmr/style/class_dictionary.hpp delete mode 100644 include/llmr/style/class_properties.hpp delete mode 100644 include/llmr/style/filter_comparison.hpp delete mode 100644 include/llmr/style/filter_comparison_private.hpp delete mode 100644 include/llmr/style/filter_expression.hpp delete mode 100644 include/llmr/style/filter_expression_private.hpp delete mode 100644 include/llmr/style/function_properties.hpp delete mode 100644 include/llmr/style/property_fallback.hpp delete mode 100644 include/llmr/style/property_key.hpp delete mode 100644 include/llmr/style/property_transition.hpp delete mode 100644 include/llmr/style/property_value.hpp delete mode 100644 include/llmr/style/rasterize_properties.hpp delete mode 100644 include/llmr/style/style.hpp delete mode 100644 include/llmr/style/style_bucket.hpp delete mode 100644 include/llmr/style/style_layer.hpp delete mode 100644 include/llmr/style/style_layer_group.hpp delete mode 100644 include/llmr/style/style_parser.hpp delete mode 100644 include/llmr/style/style_properties.hpp delete mode 100644 include/llmr/style/style_source.hpp delete mode 100644 include/llmr/style/types.hpp delete mode 100644 include/llmr/style/value.hpp delete mode 100644 include/llmr/style/value_comparison.hpp delete mode 100644 include/llmr/text/collision.hpp delete mode 100644 include/llmr/text/glyph.hpp delete mode 100644 include/llmr/text/glyph_store.hpp delete mode 100644 include/llmr/text/placement.hpp delete mode 100644 include/llmr/text/rotation_range.hpp delete mode 100644 include/llmr/text/types.hpp delete mode 100644 include/llmr/util/clip_ids.hpp delete mode 100644 include/llmr/util/constants.hpp delete mode 100644 include/llmr/util/enum.hpp delete mode 100644 include/llmr/util/error.hpp delete mode 100644 include/llmr/util/image.hpp delete mode 100644 include/llmr/util/io.hpp delete mode 100644 include/llmr/util/mat4.hpp delete mode 100644 include/llmr/util/math.hpp delete mode 100644 include/llmr/util/noncopyable.hpp delete mode 100644 include/llmr/util/pbf.hpp delete mode 100644 include/llmr/util/raster.hpp delete mode 100644 include/llmr/util/rect.hpp delete mode 100644 include/llmr/util/recursive_wrapper.hpp delete mode 100644 include/llmr/util/std.hpp delete mode 100644 include/llmr/util/string.hpp delete mode 100644 include/llmr/util/texturepool.hpp delete mode 100644 include/llmr/util/threadpool.hpp delete mode 100644 include/llmr/util/time.hpp delete mode 100644 include/llmr/util/timer.hpp delete mode 100644 include/llmr/util/token.hpp delete mode 100644 include/llmr/util/transition.hpp delete mode 100644 include/llmr/util/unitbezier.hpp delete mode 100644 include/llmr/util/utf.hpp delete mode 100644 include/llmr/util/uv.hpp delete mode 100644 include/llmr/util/variant.hpp delete mode 100644 include/llmr/util/vec.hpp create mode 100644 include/mbgl/geometry/anchor.hpp create mode 100644 include/mbgl/geometry/binpack.hpp create mode 100644 include/mbgl/geometry/buffer.hpp create mode 100644 include/mbgl/geometry/debug_font_buffer.hpp create mode 100644 include/mbgl/geometry/elements_buffer.hpp create mode 100644 include/mbgl/geometry/fill_buffer.hpp create mode 100644 include/mbgl/geometry/geometry.hpp create mode 100644 include/mbgl/geometry/glyph_atlas.hpp create mode 100644 include/mbgl/geometry/icon_buffer.hpp create mode 100644 include/mbgl/geometry/interpolate.hpp create mode 100644 include/mbgl/geometry/line_buffer.hpp create mode 100644 include/mbgl/geometry/sprite_atlas.hpp create mode 100644 include/mbgl/geometry/text_buffer.hpp create mode 100644 include/mbgl/geometry/vao.hpp create mode 100644 include/mbgl/geometry/vertex_buffer.hpp create mode 100644 include/mbgl/map/map.hpp create mode 100644 include/mbgl/map/raster_tile_data.hpp create mode 100644 include/mbgl/map/source.hpp create mode 100644 include/mbgl/map/sprite.hpp create mode 100644 include/mbgl/map/tile.hpp create mode 100644 include/mbgl/map/tile_data.hpp create mode 100644 include/mbgl/map/tile_parser.hpp create mode 100644 include/mbgl/map/transform.hpp create mode 100644 include/mbgl/map/transform_state.hpp create mode 100644 include/mbgl/map/vector_tile.hpp create mode 100644 include/mbgl/map/vector_tile_data.hpp create mode 100644 include/mbgl/map/view.hpp create mode 100644 include/mbgl/mbgl.hpp create mode 100644 include/mbgl/platform/event.hpp create mode 100644 include/mbgl/platform/gl.hpp create mode 100644 include/mbgl/platform/log.hpp create mode 100644 include/mbgl/platform/platform.hpp create mode 100644 include/mbgl/platform/request.hpp create mode 100644 include/mbgl/renderer/bucket.hpp create mode 100644 include/mbgl/renderer/debug_bucket.hpp create mode 100644 include/mbgl/renderer/fill_bucket.hpp create mode 100644 include/mbgl/renderer/frame_history.hpp create mode 100644 include/mbgl/renderer/icon_bucket.hpp create mode 100644 include/mbgl/renderer/line_bucket.hpp create mode 100644 include/mbgl/renderer/painter.hpp create mode 100644 include/mbgl/renderer/prerendered_texture.hpp create mode 100644 include/mbgl/renderer/raster_bucket.hpp create mode 100644 include/mbgl/renderer/text_bucket.hpp create mode 100644 include/mbgl/shader/composite_shader.hpp create mode 100644 include/mbgl/shader/dot_shader.hpp create mode 100644 include/mbgl/shader/gaussian_shader.hpp create mode 100644 include/mbgl/shader/icon_shader.hpp create mode 100644 include/mbgl/shader/line_shader.hpp create mode 100644 include/mbgl/shader/linejoin_shader.hpp create mode 100644 include/mbgl/shader/outline_shader.hpp create mode 100644 include/mbgl/shader/pattern_shader.hpp create mode 100644 include/mbgl/shader/plain_shader.hpp create mode 100644 include/mbgl/shader/raster_shader.hpp create mode 100644 include/mbgl/shader/shader.hpp create mode 100644 include/mbgl/shader/text_shader.hpp create mode 100644 include/mbgl/style/applied_class_properties.hpp create mode 100644 include/mbgl/style/class_dictionary.hpp create mode 100644 include/mbgl/style/class_properties.hpp create mode 100644 include/mbgl/style/filter_comparison.hpp create mode 100644 include/mbgl/style/filter_comparison_private.hpp create mode 100644 include/mbgl/style/filter_expression.hpp create mode 100644 include/mbgl/style/filter_expression_private.hpp create mode 100644 include/mbgl/style/function_properties.hpp create mode 100644 include/mbgl/style/property_fallback.hpp create mode 100644 include/mbgl/style/property_key.hpp create mode 100644 include/mbgl/style/property_transition.hpp create mode 100644 include/mbgl/style/property_value.hpp create mode 100644 include/mbgl/style/rasterize_properties.hpp create mode 100644 include/mbgl/style/style.hpp create mode 100644 include/mbgl/style/style_bucket.hpp create mode 100644 include/mbgl/style/style_layer.hpp create mode 100644 include/mbgl/style/style_layer_group.hpp create mode 100644 include/mbgl/style/style_parser.hpp create mode 100644 include/mbgl/style/style_properties.hpp create mode 100644 include/mbgl/style/style_source.hpp create mode 100644 include/mbgl/style/types.hpp create mode 100644 include/mbgl/style/value.hpp create mode 100644 include/mbgl/style/value_comparison.hpp create mode 100644 include/mbgl/text/collision.hpp create mode 100644 include/mbgl/text/glyph.hpp create mode 100644 include/mbgl/text/glyph_store.hpp create mode 100644 include/mbgl/text/placement.hpp create mode 100644 include/mbgl/text/rotation_range.hpp create mode 100644 include/mbgl/text/types.hpp create mode 100644 include/mbgl/util/clip_ids.hpp create mode 100644 include/mbgl/util/constants.hpp create mode 100644 include/mbgl/util/enum.hpp create mode 100644 include/mbgl/util/error.hpp create mode 100644 include/mbgl/util/image.hpp create mode 100644 include/mbgl/util/io.hpp create mode 100644 include/mbgl/util/mat4.hpp create mode 100644 include/mbgl/util/math.hpp create mode 100644 include/mbgl/util/noncopyable.hpp create mode 100644 include/mbgl/util/pbf.hpp create mode 100644 include/mbgl/util/raster.hpp create mode 100644 include/mbgl/util/rect.hpp create mode 100644 include/mbgl/util/recursive_wrapper.hpp create mode 100644 include/mbgl/util/std.hpp create mode 100644 include/mbgl/util/string.hpp create mode 100644 include/mbgl/util/texturepool.hpp create mode 100644 include/mbgl/util/threadpool.hpp create mode 100644 include/mbgl/util/time.hpp create mode 100644 include/mbgl/util/timer.hpp create mode 100644 include/mbgl/util/token.hpp create mode 100644 include/mbgl/util/transition.hpp create mode 100644 include/mbgl/util/unitbezier.hpp create mode 100644 include/mbgl/util/utf.hpp create mode 100644 include/mbgl/util/uv.hpp create mode 100644 include/mbgl/util/variant.hpp create mode 100644 include/mbgl/util/vec.hpp (limited to 'include') diff --git a/include/llmr/geometry/anchor.hpp b/include/llmr/geometry/anchor.hpp deleted file mode 100644 index dd97c507f2..0000000000 --- a/include/llmr/geometry/anchor.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef LLMR_GEOMETRY_ANCHOR -#define LLMR_GEOMETRY_ANCHOR - -#include - -namespace llmr { - -struct Anchor { - float x = 0.0f; - float y = 0.0f; - float angle = 0.0f; - float scale = 0.0f; - int segment = -1; - - explicit Anchor(float x, float y, float angle, float scale) - : x(x), y(y), angle(angle), scale(scale) {} - explicit Anchor(float x, float y, float angle, float scale, int segment) - : x(x), y(y), angle(angle), scale(scale), segment(segment) {} -}; - -typedef std::vector Anchors; - -} - -#endif \ No newline at end of file diff --git a/include/llmr/geometry/binpack.hpp b/include/llmr/geometry/binpack.hpp deleted file mode 100644 index 11536ee8b3..0000000000 --- a/include/llmr/geometry/binpack.hpp +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef LLMR_GEOMETRY_BINPACK -#define LLMR_GEOMETRY_BINPACK - -#include -#include -#include -#include - -namespace llmr { - -template -class BinPack : private util::noncopyable { -public: - BinPack(T width, T height) - : free(1, Rect{ 0, 0, width, height }) {} -public: - Rect allocate(T width, T height) { - // Find the smallest free rect angle - auto smallest = free.end(); - for (auto it = free.begin(); it != free.end(); ++it) { - const Rect& ref = *it; - const Rect& rect = *smallest; - if (width <= ref.w && height <= ref.h) { - if (smallest == free.end() || (ref.y <= rect.y && ref.x <= rect.x)) { - smallest = it; - } - } - } - - if (smallest == free.end()) { - // There's no space left for this char. - return Rect{ 0, 0, 0, 0 }; - } else { - Rect rect = *smallest; - free.erase(smallest); - - // Shorter/Longer Axis Split Rule (SAS) - // http://clb.demon.fi/files/RectangleBinPack.pdf p. 15 - // Ignore the dimension of R and just split long the shorter dimension - // See Also: http://www.cs.princeton.edu/~chazelle/pubs/blbinpacking.pdf - if (rect.w < rect.h) { - // split horizontally - // +--+---+ - // |__|___| <-- b1 - // +------+ <-- b2 - if (rect.w > width) free.emplace_back(rect.x + width, rect.y, rect.w - width, height); - if (rect.h > height) free.emplace_back(rect.x, rect.y + height, rect.w, rect.h - height); - } else { - // split vertically - // +--+---+ - // |__| | <-- b1 - // +--|---+ <-- b2 - if (rect.w > width) free.emplace_back(rect.x + width, rect.y, rect.w - width, rect.h); - if (rect.h > height) free.emplace_back(rect.x, rect.y + height, width, rect.h - height); - } - - return Rect{ rect.x, rect.y, width, height }; - } - } - - - void release(Rect rect) { - // Simple algorithm to recursively merge the newly released cell with its - // neighbor. This doesn't merge more than two cells at a time, and fails - // for complicated merges. - for (auto it = free.begin(); it != free.end(); ++it) { - Rect ref = *it; - if (ref.y == rect.y && ref.h == rect.h && ref.x + ref.w == rect.x) { - ref.w += rect.w; - } - else if (ref.x == rect.x && ref.w == rect.w && ref.y + ref.h == rect.y) { - ref.h += rect.h; - } - else if (rect.y == ref.y && rect.h == ref.h && rect.x + rect.w == ref.x) { - ref.x = rect.x; - ref.w += rect.w; - } - else if (rect.x == ref.x && rect.w == ref.w && rect.y + rect.h == ref.y) { - ref.y = rect.y; - ref.h += rect.h; - } else { - continue; - } - - free.erase(it); - release(ref); - return; - - } - - free.emplace_back(rect); - }; - -private: - std::list> free; -}; - -} - -#endif diff --git a/include/llmr/geometry/buffer.hpp b/include/llmr/geometry/buffer.hpp deleted file mode 100644 index 607f902bf1..0000000000 --- a/include/llmr/geometry/buffer.hpp +++ /dev/null @@ -1,114 +0,0 @@ -#ifndef LLMR_GEOMETRY_BUFFER -#define LLMR_GEOMETRY_BUFFER - -#include -#include - -#include -#include -#include - -namespace llmr { - -template < - size_t item_size, - int bufferType = GL_ARRAY_BUFFER, - size_t defaultLength = 8192, - bool retainAfterUpload = false -> -class Buffer : private util::noncopyable { -public: - ~Buffer() { - cleanup(); - if (buffer != 0) { - glDeleteBuffers(1, &buffer); - buffer = 0; - } - } - - // Returns the number of elements in this buffer. This is not the number of - // bytes, but rather the number of coordinates with associated information. - inline size_t index() const { - return pos / itemSize; - } - - inline bool empty() const { - return pos == 0; - } - - // Transfers this buffer to the GPU and binds the buffer to the GL context. - void bind(bool force = false) { - if (buffer == 0) { - glGenBuffers(1, &buffer); - force = true; - } - glBindBuffer(bufferType, buffer); - if (force) { - if (array == nullptr) { - throw std::runtime_error("Buffer was already deleted or doesn't contain elements"); - } - - glBufferData(bufferType, pos, array, GL_STATIC_DRAW); - if (!retainAfterUpload) { - cleanup(); - } - } - } - - void cleanup() { - if (array) { - free(array); - array = nullptr; - } - } - -protected: - // increase the buffer size by at least /required/ bytes. - inline void *addElement() { - if (buffer != 0) { - throw std::runtime_error("Can't add elements after buffer was bound to GPU"); - } - if (length < pos + itemSize) { - while (length < pos + itemSize) length += defaultLength; - array = realloc(array, length); - if (array == nullptr) { - throw std::runtime_error("Buffer reallocation failed¯"); - } - } - pos += itemSize; - return static_cast(array) + (pos - itemSize); - } - - // Get a pointer to the item at a given index. - inline void *getElement(size_t index) { - if (array == nullptr) { - throw std::runtime_error("Buffer was already deleted or doesn't contain elements"); - } - - if (index * itemSize >= pos) { - throw new std::runtime_error("Can't get element after array bounds"); - } else { - return static_cast(array) + (index * itemSize); - } - } - -public: - static const size_t itemSize = item_size; - -private: - // CPU buffer - void *array = nullptr; - - // Byte position where we are writing. - size_t pos = 0; - - // Number of bytes that are valid in this buffer. - size_t length = 0; - - // GL buffer ID - uint32_t buffer = 0; -}; - -} - -#endif diff --git a/include/llmr/geometry/debug_font_buffer.hpp b/include/llmr/geometry/debug_font_buffer.hpp deleted file mode 100644 index 15f6daf07f..0000000000 --- a/include/llmr/geometry/debug_font_buffer.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef LLMR_GEOMETRY_DEBUG_FONT_BUFFER -#define LLMR_GEOMETRY_DEBUG_FONT_BUFFER - -#include "buffer.hpp" - -namespace llmr { - -class DebugFontBuffer : public Buffer< - 4 // 2 bytes per coordinate, 2 coordinates -> { -public: - void addText(const char *text, double left, double baseline, double scale = 1); -}; - -} - -#endif diff --git a/include/llmr/geometry/elements_buffer.hpp b/include/llmr/geometry/elements_buffer.hpp deleted file mode 100644 index a058312bda..0000000000 --- a/include/llmr/geometry/elements_buffer.hpp +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef LLMR_GEOMETRY_TRIANGLE_ELEMENTS_BUFFER -#define LLMR_GEOMETRY_TRIANGLE_ELEMENTS_BUFFER - -#include -#include - -namespace llmr { - -struct ElementGroup { - VertexArrayObject array; - uint32_t vertex_length; - uint32_t elements_length; - - ElementGroup() : vertex_length(0), elements_length(0) {} - ElementGroup(uint32_t vertex_length, uint32_t elements_length) - : vertex_length(vertex_length), - elements_length(elements_length) { - } -}; - -class TriangleElementsBuffer : public Buffer< - 6, // bytes per triangle (3 * unsigned short == 6 bytes) - GL_ELEMENT_ARRAY_BUFFER -> { -public: - typedef uint16_t element_type; - - void add(element_type a, element_type b, element_type c); -}; - - -class LineElementsBuffer : public Buffer< - 4, // bytes per triangle (2 * unsigned short == 6 bytes) - GL_ELEMENT_ARRAY_BUFFER -> { -public: - typedef uint16_t element_type; - - void add(element_type a, element_type b); -}; - -class PointElementsBuffer : public Buffer< - 2, // bytes per point (1 unsigned short) - GL_ELEMENT_ARRAY_BUFFER -> { -public: - typedef uint16_t element_type; - - void add(element_type a); -}; - -} - -#endif diff --git a/include/llmr/geometry/fill_buffer.hpp b/include/llmr/geometry/fill_buffer.hpp deleted file mode 100644 index 9aebe35abf..0000000000 --- a/include/llmr/geometry/fill_buffer.hpp +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef LLMR_GEOMETRY_FILL_BUFFER -#define LLMR_GEOMETRY_FILL_BUFFER - -#include "buffer.hpp" -#include -#include - -namespace llmr { - -class FillVertexBuffer : public Buffer< - 4 // bytes per coordinates (2 * unsigned short == 4 bytes) -> { -public: - typedef int16_t vertex_type; - - void add(vertex_type x, vertex_type y); -}; - -} - -#endif diff --git a/include/llmr/geometry/geometry.hpp b/include/llmr/geometry/geometry.hpp deleted file mode 100644 index 2f321934a7..0000000000 --- a/include/llmr/geometry/geometry.hpp +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef LLMR_GEOMETRY_GEOMETRY -#define LLMR_GEOMETRY_GEOMETRY - -#include -#include - -#include - -namespace llmr { - -class Geometry : private util::noncopyable { - -public: - inline explicit Geometry(pbf& data); - - enum command : uint8_t { - end = 0, - move_to = 1, - line_to = 2, - close = 7 - }; - - inline command next(int32_t &rx, int32_t &ry); - -private: - pbf& data; - uint8_t cmd; - uint32_t length; - int32_t x, y; - int32_t ox, oy; -}; - -Geometry::Geometry(pbf& data) - : data(data), - cmd(1), - length(0), - x(0), y(0), - ox(0), oy(0) {} - -Geometry::command Geometry::next(int32_t &rx, int32_t &ry) { - if (data.data < data.end) { - if (length == 0) { - uint32_t cmd_length = static_cast(data.varint()); - cmd = cmd_length & 0x7; - length = cmd_length >> 3; - } - - --length; - - if (cmd == move_to || cmd == line_to) { - rx = (x += data.svarint()); - ry = (y += data.svarint()); - - if (cmd == move_to) { - ox = x; - oy = y; - return move_to; - } else { - return line_to; - } - } else if (cmd == close) { - rx = ox; - ry = oy; - return close; - } else { - fprintf(stderr, "unknown command: %d\n", cmd); - // TODO: gracefully handle geometry parse failures - return end; - } - } else { - return end; - } -} - -} - -#endif diff --git a/include/llmr/geometry/glyph_atlas.hpp b/include/llmr/geometry/glyph_atlas.hpp deleted file mode 100644 index 0aada6a733..0000000000 --- a/include/llmr/geometry/glyph_atlas.hpp +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef LLMR_GEOMETRY_GLYPH_ATLAS -#define LLMR_GEOMETRY_GLYPH_ATLAS - -#include -#include - -#include -#include -#include -#include -#include - -namespace llmr { - -class GlyphAtlas { -public: - -private: - struct GlyphValue { - GlyphValue(const Rect& rect, uint64_t id) - : rect(rect), ids({ id }) {} - Rect rect; - std::set ids; - }; - -public: - GlyphAtlas(uint16_t width, uint16_t height); - ~GlyphAtlas(); - - - Rect addGlyph(uint64_t tile_id, const std::string& face_name, - const SDFGlyph& glyph); - void removeGlyphs(uint64_t tile_id); - void bind(); - -public: - const uint16_t width = 0; - const uint16_t height = 0; - -private: - std::mutex mtx; - BinPack bin; - std::map> index; - char *const data = nullptr; - std::atomic dirty; - uint32_t texture = 0; -}; - -}; - -#endif diff --git a/include/llmr/geometry/icon_buffer.hpp b/include/llmr/geometry/icon_buffer.hpp deleted file mode 100644 index 6bb0ec30c1..0000000000 --- a/include/llmr/geometry/icon_buffer.hpp +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef LLMR_GEOMETRY_ICON_BUFFER -#define LLMR_GEOMETRY_ICON_BUFFER - -#include "buffer.hpp" - -namespace llmr { - - class IconVertexBuffer : public Buffer< - 4 + // int16 x/y coordinates per vertex (== 4 bytes) - 4 // uint16 x/y coordinates of icon in sprite (== 4 bytes) - > { - public: - typedef int16_t vertex_type; - - void add(vertex_type x, vertex_type y, uint16_t tx, uint16_t ty); - }; - -} - -#endif diff --git a/include/llmr/geometry/interpolate.hpp b/include/llmr/geometry/interpolate.hpp deleted file mode 100644 index 0014d56aad..0000000000 --- a/include/llmr/geometry/interpolate.hpp +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef LLMR_GEOMETRY_INTERPOLATE -#define LLMR_GEOMETRY_INTERPOLATE - -#include -#include - -namespace llmr { - -Anchors interpolate(const std::vector &vertices, float spacing, - float minScale = 0.0f, int start = 0); -} - -#endif diff --git a/include/llmr/geometry/line_buffer.hpp b/include/llmr/geometry/line_buffer.hpp deleted file mode 100644 index 289f1bc6eb..0000000000 --- a/include/llmr/geometry/line_buffer.hpp +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef LLMR_GEOMETRY_LINE_BUFFER -#define LLMR_GEOMETRY_LINE_BUFFER - -#include "buffer.hpp" - -namespace llmr { - -class LineVertexBuffer : public Buffer< - 8 // 2 coordinates per vertex + 1 linesofar + 1 extrude coord pair == 4 (== 8 bytes) -> { -public: - typedef int16_t vertex_type; - - /* - * Scale the extrusion vector so that the normal length is this value. - * Contains the "texture" normals (-1..1). This is distinct from the extrude - * normals for line joins, because the x-value remains 0 for the texture - * normal array, while the extrude normal actually moves the vertex to create - * the acute/bevelled line join. - */ - static const int8_t extrudeScale = 63; - - /* - * Add a vertex to this buffer - * - * @param {number} x vertex position - * @param {number} y vertex position - * @param {number} ex extrude normal - * @param {number} ey extrude normal - * @param {number} tx texture normal - * @param {number} ty texture normal - */ - size_t add(vertex_type x, vertex_type y, float ex, float ey, int8_t tx, int8_t ty, int32_t linesofar = 0); -}; - - -} - -#endif diff --git a/include/llmr/geometry/sprite_atlas.hpp b/include/llmr/geometry/sprite_atlas.hpp deleted file mode 100644 index 13b85e5480..0000000000 --- a/include/llmr/geometry/sprite_atlas.hpp +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef LLMR_GEOMETRY_SPRITE_ATLAS -#define LLMR_GEOMETRY_SPRITE_ATLAS - -#include - -#include -#include -#include -#include -#include - -namespace llmr { - -class Sprite; -class SpritePosition; - -class SpriteAtlas { -public: - typedef uint16_t dimension; - -public: - // Add way to construct this from another SpriteAtlas (e.g. with another pixelRatio) - SpriteAtlas(dimension width, dimension height); - ~SpriteAtlas(); - - // Changes the pixel ratio. - bool resize(float newRatio); - - // Update uninitialized sprites in this atlas from the given sprite. - void update(const Sprite &sprite); - - // Returns the coordinates of a square icon. The getter also *creates* new square icons in the - // atlas if they don't exist, but they'll be default-initialized with a a black circle. - Rect getIcon(int size, const std::string &name); - - // Returns the coordinates of an image that is sourced from the sprite image. - // This getter does not create images, as the dimension of the texture us unknown if the - // sprite is not yet loaded. Instead, it returns a 0/0/0/0 rect. - Rect getImage(const std::string &name, const Sprite &sprite); - - // Binds the image buffer of this sprite atlas to the GPU, and uploads data if it is out - // of date. - void bind(bool linear = false); - - inline float getWidth() const { return width; } - inline float getHeight() const { return height; } - inline float getTextureWidth() const { return width * pixelRatio; } - inline float getTextureHeight() const { return height * pixelRatio; } - -private: - void allocate(); - Rect allocateImage(size_t width, size_t height); - void copy(const Rect &dst, const SpritePosition &src, const Sprite &sprite); - -public: - const dimension width = 0; - const dimension height = 0; - -private: - std::mutex mtx; - float pixelRatio = 1.0f; - BinPack bin; - std::map> images; - std::set uninitialized; - uint32_t *data = nullptr; - std::atomic dirty; - uint32_t texture = 0; - uint32_t filter = 0; - static const int buffer = 1; -}; - -}; - -#endif diff --git a/include/llmr/geometry/text_buffer.hpp b/include/llmr/geometry/text_buffer.hpp deleted file mode 100644 index 8d4cba2856..0000000000 --- a/include/llmr/geometry/text_buffer.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef LLMR_GEOMETRY_TEXT_BUFFER -#define LLMR_GEOMETRY_TEXT_BUFFER - -#include "buffer.hpp" -#include - -namespace llmr { - -class TextVertexBuffer : public Buffer < - 16, - GL_ARRAY_BUFFER, - 32768 -> { -public: - typedef int16_t vertex_type; - - static const double angleFactor; - - size_t add(int16_t x, int16_t y, float ox, float oy, uint16_t tx, uint16_t ty, float angle, float minzoom, std::array range, float maxzoom, float labelminzoom); -}; - - -} - -#endif diff --git a/include/llmr/geometry/vao.hpp b/include/llmr/geometry/vao.hpp deleted file mode 100644 index 64b324372c..0000000000 --- a/include/llmr/geometry/vao.hpp +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef LLMR_GEOMETRY_VAO -#define LLMR_GEOMETRY_VAO - -#include - -#include - -namespace llmr { - -class VertexArrayObject { -public: - template - void bind(Shader& shader, VertexBuffer& vertex_buffer, char *offset) { -#ifdef GL_ARB_vertex_array_object - if (!vao) { - glGenVertexArrays(1, &vao); - glBindVertexArray(vao); - } else { - // We have been given the correct information. - glBindVertexArray(vao); - } - - if (shader_ptr != &shader) { - if (shader_ptr != nullptr) { - fprintf(stderr, "shader rebind!"); - } -#endif - vertex_buffer.bind(); - shader.bind(offset); - -#ifdef GL_ARB_vertex_array_object - shader_ptr = &shader; - vertex_buffer_ptr = &vertex_buffer; - elements_buffer_ptr = nullptr; - offset_ptr = offset; - } else if (vertex_buffer_ptr != &vertex_buffer) { - throw std::runtime_error("trying to bind VAO to another vertex buffer"); - } else if (elements_buffer_ptr != nullptr) { - throw std::runtime_error("trying to bind VAO to another elements buffer"); - } else if (offset_ptr != offset) { - throw std::runtime_error("trying to bind VAO to another offset"); - } -#endif - } - - template - void bind(Shader& shader, VertexBuffer& vertex_buffer, ElementsBuffer& elements_buffer, char *offset) { -#ifdef GL_ARB_vertex_array_object - if (!vao) { - glGenVertexArrays(1, &vao); - glBindVertexArray(vao); - } else { - // We have been given the correct information. - glBindVertexArray(vao); - } - - if (shader_ptr != &shader) { -#endif - vertex_buffer.bind(); - elements_buffer.bind(); - shader.bind(offset); - -#ifdef GL_ARB_vertex_array_object - shader_ptr = &shader; - vertex_buffer_ptr = &vertex_buffer; - elements_buffer_ptr = &elements_buffer; - offset_ptr = offset; - } else if (vertex_buffer_ptr != &vertex_buffer) { - throw std::runtime_error("trying to bind VAO to another vertex buffer"); - } else if (elements_buffer_ptr != &elements_buffer) { - throw std::runtime_error("trying to bind VAO to another elements buffer"); - } else if (offset_ptr != offset) { - throw std::runtime_error("trying to bind VAO to another offset"); - } -#endif - } - - ~VertexArrayObject() { -#ifdef GL_ARB_vertex_array_object - if (vao) { - glDeleteVertexArrays(1, &vao); - } -#endif - } - -private: -#ifdef GL_ARB_vertex_array_object - GLuint vao = 0; - - // For debug reasons, we're storing the bind information so that we can - // detect errors and report - void *shader_ptr = nullptr; - void *vertex_buffer_ptr = nullptr; - void *elements_buffer_ptr = nullptr; - char *offset_ptr = 0; -#endif -}; - -} - -#endif diff --git a/include/llmr/geometry/vertex_buffer.hpp b/include/llmr/geometry/vertex_buffer.hpp deleted file mode 100644 index 9478d7b15f..0000000000 --- a/include/llmr/geometry/vertex_buffer.hpp +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef LLMR_GEOMETRY_VERTEX_BUFFER -#define LLMR_GEOMETRY_VERTEX_BUFFER - -#include -#include -#include -#include - -namespace llmr { - -class VertexBuffer { -public: - typedef int16_t vertex_type; - VertexBuffer(std::initializer_list init); - ~VertexBuffer(); - - /* - * Returns the number of elements in this buffer. This is not the number of - * bytes, but rather the number of coordinates with associated information. - */ - size_t index() const; - - /* - * Transfers this buffer to the GPU and binds the buffer to the GL context. - */ - void bind(); - -private: - const std::vector array; - uint32_t buffer = 0; -}; - -} - -#endif diff --git a/include/llmr/llmr.hpp b/include/llmr/llmr.hpp deleted file mode 100644 index 349b15d8c9..0000000000 --- a/include/llmr/llmr.hpp +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef LLMR_MAIN -#define LLMR_MAIN - -#include "map/map.hpp" -#include "map/view.hpp" - -#endif diff --git a/include/llmr/map/map.hpp b/include/llmr/map/map.hpp deleted file mode 100644 index af4250c357..0000000000 --- a/include/llmr/map/map.hpp +++ /dev/null @@ -1,194 +0,0 @@ - -#ifndef LLMR_MAP_MAP -#define LLMR_MAP_MAP - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -namespace llmr { - -class Source; -class SpriteAtlas; - -class Map : private util::noncopyable { -public: - explicit Map(View &view); - ~Map(); - - // Start/stop the map render thread - void start(); - void stop(); - - // Runs the map event loop. - void run(); - - // Triggers a lazy rerender: only performs a render when the map is not clean. - void rerender(); - - // Forces a map update: always triggers a rerender. - void update(); - - // Triggers a cleanup that releases resources. - void cleanup(); - - // Controls buffer swapping. - bool needsSwap(); - void swapped(); - - // Size - void resize(uint16_t width, uint16_t height, float ratio = 1); - void resize(uint16_t width, uint16_t height, float ratio, uint16_t fb_width, uint16_t fb_height); - - // Styling - const std::set> getActiveSources() const; - void setAppliedClasses(const std::vector &classes); - void toggleClass(const std::string &name); - const std::vector &getAppliedClasses() const; - void setDefaultTransitionDuration(uint64_t duration_milliseconds = 0); - void setStyleJSON(std::string newStyleJSON); - std::string getStyleJSON() const; - void setAccessToken(std::string access_token); - std::string getAccessToken() const; - - // Transition - void cancelTransitions(); - - // Position - void moveBy(double dx, double dy, double duration = 0); - void setLonLat(double lon, double lat, double duration = 0); - void getLonLat(double &lon, double &lat) const; - void startPanning(); - void stopPanning(); - void resetPosition(); - - // Scale - void scaleBy(double ds, double cx = -1, double cy = -1, double duration = 0); - void setScale(double scale, double cx = -1, double cy = -1, double duration = 0); - double getScale() const; - void setZoom(double zoom, double duration = 0); - double getZoom() const; - void setLonLatZoom(double lon, double lat, double zoom, double duration = 0); - void getLonLatZoom(double &lon, double &lat, double &zoom) const; - void resetZoom(); - void startScaling(); - void stopScaling(); - double getMinZoom() const; - double getMaxZoom() const; - - // Rotation - void rotateBy(double sx, double sy, double ex, double ey, double duration = 0); - void setAngle(double angle, double duration = 0); - void setAngle(double angle, double cx, double cy); - double getAngle() const; - void resetNorth(); - void startRotating(); - void stopRotating(); - bool canRotate(); - - // Debug - void setDebug(bool value); - void toggleDebug(); - bool getDebug() const; - -public: - inline const TransformState &getState() const { return state; } - inline std::shared_ptr getStyle() const { return style; } - inline std::shared_ptr getGlyphAtlas() { return glyphAtlas; } - inline std::shared_ptr getGlyphStore() { return glyphStore; } - inline std::shared_ptr getSpriteAtlas() { return spriteAtlas; } - inline std::shared_ptr getTexturepool() { return texturepool; } - inline std::shared_ptr getLoop() { return loop; } - inline timestamp getAnimationTime() const { return animationTime; } - inline timestamp getTime() const { return animationTime; } - -private: - // uv async callbacks - static void render(uv_async_t *async); - static void terminate(uv_async_t *async); - static void cleanup(uv_async_t *async); - static void delete_async(uv_handle_t *handle); - - // Setup - void setup(); - - void updateSources(); - void updateSources(const std::shared_ptr &group); - - void updateTiles(); - void updateRenderState(); - - size_t countLayers(const std::vector& layers); - - // Prepares a map render by updating the tiles we need for the current view, as well as updating - // the stylesheet. - void prepare(); - - enum RenderPass { Opaque, Translucent }; - - // 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: - // If cleared, the next time the render thread attempts to render the map, it will *actually* - // render the map. - std::atomic_flag is_clean = ATOMIC_FLAG_INIT; - - // If this flag is cleared, the current back buffer is ready for being swapped with the front - // buffer (i.e. it has rendered data). - std::atomic_flag is_swapped = ATOMIC_FLAG_INIT; - - // This is cleared once the current front buffer has been presented and the back buffer is - // ready for rendering. - std::atomic_flag is_rendered = ATOMIC_FLAG_INIT; - -public: - View &view; - -private: - Transform transform; - TransformState state; - - std::shared_ptr