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 --- .gitignore | 2 +- Makefile | 40 +- bin/build-shaders.js | 17 +- bin/package.json | 2 +- common/curl_request.cpp | 20 +- common/foundation_request.mm | 16 +- common/glfw_view.cpp | 8 +- common/glfw_view.hpp | 14 +- common/headless_view.cpp | 26 +- common/headless_view.hpp | 20 +- common/nslog_log.hpp | 8 +- common/nslog_log.mm | 2 +- common/settings_json.cpp | 6 +- common/settings_json.hpp | 6 +- common/settings_nsuserdefaults.hpp | 6 +- common/settings_nsuserdefaults.mm | 2 +- common/stderr_log.cpp | 2 +- common/stderr_log.hpp | 8 +- config/constants.cpp | 44 +- configure | 4 +- 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 ++++ ios/mapbox-gl-cocoa | 2 +- linux/llmr-app.gyp | 61 -- linux/main.cpp | 12 +- linux/mbgl-app.gyp | 61 ++ llmr.gyp | 224 ------- macosx/Info.plist | 2 +- macosx/llmr-app.gyp | 47 -- macosx/main.mm | 8 +- macosx/mbgl-app.gyp | 47 ++ mbgl.gyp | 224 +++++++ proto/glyphs.proto | 2 +- proto/vector_tile.proto | 2 +- src/geometry/debug_font_buffer.cpp | 6 +- src/geometry/elements_buffer.cpp | 4 +- src/geometry/fill_buffer.cpp | 6 +- src/geometry/glyph_atlas.cpp | 10 +- src/geometry/icon_buffer.cpp | 6 +- src/geometry/interpolate.cpp | 4 +- src/geometry/line_buffer.cpp | 6 +- src/geometry/sprite_atlas.cpp | 16 +- src/geometry/text_buffer.cpp | 8 +- src/geometry/vertex_buffer.cpp | 6 +- src/map/map.cpp | 32 +- src/map/raster_tile_data.cpp | 8 +- src/map/source.cpp | 46 +- src/map/sprite.cpp | 16 +- src/map/tile.cpp | 4 +- src/map/tile_data.cpp | 8 +- src/map/tile_parser.cpp | 42 +- src/map/transform.cpp | 16 +- src/map/transform_state.cpp | 6 +- src/map/vector_tile.cpp | 12 +- src/map/vector_tile_data.cpp | 12 +- src/platform/gl.cpp | 2 +- src/platform/log.cpp | 4 +- src/platform/request.cpp | 10 +- src/renderer/debug_bucket.cpp | 8 +- src/renderer/fill_bucket.cpp | 18 +- src/renderer/frame_history.cpp | 4 +- src/renderer/icon_bucket.cpp | 26 +- src/renderer/line_bucket.cpp | 18 +- src/renderer/painter.cpp | 20 +- src/renderer/painter_clipping.cpp | 12 +- src/renderer/painter_composite.cpp | 6 +- src/renderer/painter_debug.cpp | 10 +- src/renderer/painter_fill.cpp | 18 +- src/renderer/painter_framebuffers.cpp | 10 +- src/renderer/painter_icon.cpp | 18 +- src/renderer/painter_line.cpp | 10 +- src/renderer/painter_prerender.cpp | 6 +- src/renderer/painter_raster.cpp | 10 +- src/renderer/painter_text.cpp | 12 +- src/renderer/prerendered_texture.cpp | 6 +- src/renderer/raster_bucket.cpp | 6 +- src/renderer/text_bucket.cpp | 26 +- src/shader/composite_shader.cpp | 8 +- src/shader/dot_shader.cpp | 8 +- src/shader/gaussian_shader.cpp | 8 +- src/shader/icon_shader.cpp | 8 +- src/shader/line_shader.cpp | 8 +- src/shader/linejoin_shader.cpp | 8 +- src/shader/outline_shader.cpp | 8 +- src/shader/pattern_shader.cpp | 8 +- src/shader/plain_shader.cpp | 8 +- src/shader/raster_shader.cpp | 8 +- src/shader/shader.cpp | 10 +- src/shader/text_shader.cpp | 8 +- src/style/applied_class_properties.cpp | 4 +- src/style/class_dictionary.cpp | 4 +- src/style/class_properties.cpp | 4 +- src/style/filter_comparison.cpp | 8 +- src/style/filter_expression.cpp | 8 +- src/style/function_properties.cpp | 6 +- src/style/property_fallback.cpp | 4 +- src/style/style.cpp | 16 +- src/style/style_bucket.cpp | 4 +- src/style/style_layer.cpp | 10 +- src/style/style_layer_group.cpp | 4 +- src/style/style_parser.cpp | 10 +- src/style/style_properties.cpp | 4 +- src/style/value.cpp | 6 +- src/text/collision.cpp | 10 +- src/text/glyph.cpp | 4 +- src/text/glyph_store.cpp | 20 +- src/text/placement.cpp | 14 +- src/text/rotation_range.cpp | 4 +- src/util/clip_ids.cpp | 8 +- src/util/image.cpp | 6 +- src/util/io.cpp | 4 +- src/util/mat4.cpp | 4 +- src/util/raster.cpp | 14 +- src/util/texturepool.cpp | 4 +- src/util/threadpool.cpp | 8 +- src/util/timer.cpp | 8 +- src/util/transition.cpp | 12 +- test/clip_ids.cpp | 6 +- test/comparisons.cpp | 40 +- test/enums.cpp | 4 +- test/fixtures/fixture_log.cpp | 2 +- test/fixtures/fixture_log.hpp | 10 +- test/fixtures/fixture_request.cpp | 12 +- test/functions.cpp | 32 +- test/headless.cpp | 10 +- test/rotation_range.cpp | 4 +- test/test.gyp | 18 +- test/tile.cpp | 4 +- test/variant.cpp | 22 +- 347 files changed, 8228 insertions(+), 8227 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 delete mode 100644 linux/llmr-app.gyp create mode 100644 linux/mbgl-app.gyp delete mode 100644 llmr.gyp delete mode 100644 macosx/llmr-app.gyp create mode 100644 macosx/mbgl-app.gyp create mode 100644 mbgl.gyp diff --git a/.gitignore b/.gitignore index 5cf9666f55..c69b0331ef 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,7 @@ /config/constants_local.cpp /build /bin/node_modules -/include/llmr/shader/shaders.hpp +/include/mbgl/shader/shaders.hpp /src/shader/shaders_gl.cpp /src/shader/shaders_gles2.cpp /bin/style.bin.js diff --git a/Makefile b/Makefile index cbc00c8ea9..15566dd9a9 100644 --- a/Makefile +++ b/Makefile @@ -12,9 +12,9 @@ config.gypi: ./setup-libraries.sh # Builds the regular library -llmr: config.gypi llmr.gyp node - deps/run_gyp llmr.gyp --depth=. -Goutput_dir=.. --generator-output=./build/llmr -f make - $(MAKE) -C build/llmr BUILDTYPE=$(BUILDTYPE) V=$(V) llmr-x86 +mbgl: config.gypi mbgl.gyp node + deps/run_gyp mbgl.gyp --depth=. -Goutput_dir=.. --generator-output=./build/mbgl -f make + $(MAKE) -C build/mbgl BUILDTYPE=$(BUILDTYPE) V=$(V) mbgl-x86 node: @if [ ! `which node` ]; then echo 'error: depends on node.js. please make sure node is on your PATH'; exit 1; fi; @@ -40,8 +40,8 @@ xtest: config.gypi clear_xcode_cache node # Builds the linux app with make. This is also used by Travis CI -linux: config.gypi linux/llmr-app.gyp node - deps/run_gyp linux/llmr-app.gyp --depth=. -Goutput_dir=.. --generator-output=./build/linux -f make +linux: config.gypi linux/mbgl-app.gyp node + deps/run_gyp linux/mbgl-app.gyp --depth=. -Goutput_dir=.. --generator-output=./build/linux -f make $(MAKE) -C build/linux BUILDTYPE=$(BUILDTYPE) V=$(V) linuxapp # Executes the Linux binary @@ -51,8 +51,8 @@ run-linux: linux # Builds the OS X app with make. -osx: config.gypi macosx/llmr-app.gyp node - deps/run_gyp macosx/llmr-app.gyp --depth=. -Goutput_dir=.. --generator-output=./build/macosx -f make +osx: config.gypi macosx/mbgl-app.gyp node + deps/run_gyp macosx/mbgl-app.gyp --depth=. -Goutput_dir=.. --generator-output=./build/macosx -f make $(MAKE) -C build/macosx BUILDTYPE=$(BUILDTYPE) V=$(V) osxapp # Executes the OS X binary @@ -65,27 +65,27 @@ clear_xcode_cache: @CUSTOM_DD=`defaults read com.apple.dt.Xcode IDECustomDerivedDataLocation 2>/dev/null`; \ if [[ $$CUSTOM_DD ]]; then \ echo clearing files in $$CUSTOM_DD older than one day; \ - find $$CUSTOM_DD/llmr-app-* -mtime +1 | xargs rm -rf; \ + find $$CUSTOM_DD/mbgl-app-* -mtime +1 | xargs rm -rf; \ fi; \ if [[ -d ~/Library/Developer/Xcode/DerivedData/ ]] && [[ ! $$CUSTOM_DD ]]; then \ - echo 'clearing files in ~/Library/Developer/Xcode/DerivedData/llmr-app-* older than one day'; \ - find ~/Library/Developer/Xcode/DerivedData/llmr-app-* -mtime +1 | xargs rm -rf; \ + echo 'clearing files in ~/Library/Developer/Xcode/DerivedData/mbgl-app-* older than one day'; \ + find ~/Library/Developer/Xcode/DerivedData/mbgl-app-* -mtime +1 | xargs rm -rf; \ fi # build Mac OS X project for Xcode -xproj: config.gypi macosx/llmr-app.gyp clear_xcode_cache node - deps/run_gyp macosx/llmr-app.gyp --depth=. --generator-output=./build -f xcode - open ./build/macosx/llmr-app.xcodeproj +xproj: config.gypi macosx/mbgl-app.gyp clear_xcode_cache node + deps/run_gyp macosx/mbgl-app.gyp --depth=. --generator-output=./build -f xcode + open ./build/macosx/mbgl-app.xcodeproj # build iOS project for Xcode -iproj: config.gypi ios/mapbox-gl-cocoa/app/llmr-app.gyp clear_xcode_cache node - deps/run_gyp ios/mapbox-gl-cocoa/app/llmr-app.gyp --depth=. --generator-output=./build -f xcode - open ./build/ios/mapbox-gl-cocoa/app/llmr-app.xcodeproj +iproj: config.gypi ios/mapbox-gl-cocoa/app/mbgl-app.gyp clear_xcode_cache node + deps/run_gyp ios/mapbox-gl-cocoa/app/mbgl-app.gyp --depth=. --generator-output=./build -f xcode + open ./build/ios/mapbox-gl-cocoa/app/mbgl-app.xcodeproj # build Linux project for Xcode (Runs on Mac OS X too, but without platform-specific code) -lproj: config.gypi linux/llmr-app.gyp clear_xcode_cache node - deps/run_gyp linux/llmr-app.gyp --depth=. --generator-output=./build -f xcode - open ./build/linux/llmr-app.xcodeproj +lproj: config.gypi linux/mbgl-app.gyp clear_xcode_cache node + deps/run_gyp linux/mbgl-app.gyp --depth=. --generator-output=./build -f xcode + open ./build/linux/mbgl-app.xcodeproj ##### Maintenace operations #################################################### @@ -101,4 +101,4 @@ distclean: clean -rm -rf ./config.gypi -rm -rf ./mapnik-packaging/osx/out/ -.PHONY: llmr test linux +.PHONY: mbgl test linux diff --git a/bin/build-shaders.js b/bin/build-shaders.js index 9679521e6b..9105be32b3 100755 --- a/bin/build-shaders.js +++ b/bin/build-shaders.js @@ -83,10 +83,10 @@ module.exports = function(shader_type, prefix, suffix) { } var header = '// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.\n\n'; - header += '#ifndef LLMR_SHADER_SHADERS\n'; - header += '#define LLMR_SHADER_SHADERS\n'; + header += '#ifndef MBGL_SHADER_SHADERS\n'; + header += '#define MBGL_SHADER_SHADERS\n'; header += '\n'; - header += 'namespace llmr {\n'; + header += 'namespace mbgl {\n'; header += '\n'; header += 'struct shader_source {\n'; header += ' const char *vertex;\n'; @@ -106,18 +106,19 @@ module.exports = function(shader_type, prefix, suffix) { var code = '// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.\n'; - code += '#include \n'; + code += '#include \n'; code += prefix + '\n'; - code += '#include \n'; + code += '#include \n'; code += '\n'; - code += 'using namespace llmr;\n'; + code += 'namespace mbgl {\n'; code += '\n'; - code += 'const shader_source llmr::shaders[SHADER_COUNT] = {\n'; + code += 'const shader_source shaders[SHADER_COUNT] = {\n'; code += lines.join(',\n'); code += '\n};\n'; + code += '\n}\n'; code += suffix + '\n'; - var header_path = path.join(process.argv[2], 'include/llmr/shader/shaders.hpp'); + var header_path = path.join(process.argv[2], 'include/mbgl/shader/shaders.hpp'); mkdirp.sync(path.dirname(header_path)); fs.writeFileSync(header_path, header); console.warn('wrote file ' + header_path); diff --git a/bin/package.json b/bin/package.json index 4431471e99..483e0535b8 100644 --- a/bin/package.json +++ b/bin/package.json @@ -1,5 +1,5 @@ { - "name": "llmr-native", + "name": "mbgl-native", "version": "0.0.1", "dependencies": { "glsl-optimizer": "git://github.com/kkaefer/glsl-optimizer.git#amalgamation" diff --git a/common/curl_request.cpp b/common/curl_request.cpp index 66750e459e..b7e5e8b5cc 100644 --- a/common/curl_request.cpp +++ b/common/curl_request.cpp @@ -1,8 +1,8 @@ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -47,7 +47,7 @@ See http://nikhilm.github.com/uvbook/ for more information on libuv. */ -namespace llmr { +namespace mbgl { namespace platform { namespace request { @@ -66,8 +66,8 @@ static uv_async_t async_cancel; // Stores pointers (!) to shared_ptrs. We use shared_ptrs so that request objects don't get // auto-destructed while they're in progress. The TileData object retains a weak_ptr to this // request, so we have to use a shared_ptr here to ensure that this object stays alive. -static boost::lockfree::queue *> add_queue(8); -static boost::lockfree::queue *> cancel_queue(8); +static boost::lockfree::queue *> add_queue(8); +static boost::lockfree::queue *> cancel_queue(8); // Used as the CURL timer function to periodically check for socket updates. static uv_timer_t timeout; @@ -85,10 +85,10 @@ static CURLSH *curl_share = nullptr; static std::queue curl_handle_cache; -class CURLRequest : public llmr::platform::Request { +class CURLRequest : public mbgl::platform::Request { public: CURLRequest(const std::string &url, - std::function callback, + std::function callback, std::shared_ptr loop) : Request(url, callback, loop) {} @@ -380,4 +380,4 @@ void platform::cancel_request_http(const std::shared_ptr &req) { uv_async_send(&async_cancel); } } -} // end namespace llmr +} // end namespace mbgl diff --git a/common/foundation_request.mm b/common/foundation_request.mm index 4d6ca9c5fe..4684ff55fb 100644 --- a/common/foundation_request.mm +++ b/common/foundation_request.mm @@ -9,9 +9,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include uv_once_t request_initialize = UV_ONCE_INIT; @@ -37,10 +37,10 @@ void request_initialize_cb() { // We're using a child class to make sure ARC is working correctly, as well as to add activity // indicators on iOS. -class FoundationRequest : public llmr::platform::Request { +class FoundationRequest : public mbgl::platform::Request { public: FoundationRequest(const std::string &url, - std::function callback, + std::function callback, std::shared_ptr loop) : Request(url, callback, loop) { #if TARGET_OS_IPHONE @@ -65,8 +65,8 @@ public: NSURLSessionDataTask *task = nullptr; }; -std::shared_ptr -llmr::platform::request_http(const std::string &url, +std::shared_ptr +mbgl::platform::request_http(const std::string &url, std::function callback, std::shared_ptr loop) { uv_once(&request_initialize, request_initialize_cb); @@ -109,7 +109,7 @@ llmr::platform::request_http(const std::string &url, return req; } -void llmr::platform::cancel_request_http(const std::shared_ptr &req) { +void mbgl::platform::cancel_request_http(const std::shared_ptr &req) { if (req) { [((FoundationRequest *)(req.get()))->task cancel]; } diff --git a/common/glfw_view.cpp b/common/glfw_view.cpp index ae992d9268..60d95c8b81 100644 --- a/common/glfw_view.cpp +++ b/common/glfw_view.cpp @@ -8,7 +8,7 @@ GLFWView::GLFWView(bool fullscreen) : fullscreen(fullscreen) { GLFWView::~GLFWView() { glfwTerminate(); } -void GLFWView::initialize(llmr::Map *map) { +void GLFWView::initialize(mbgl::Map *map) { View::initialize(map); if (!glfwInit()) { @@ -34,7 +34,7 @@ void GLFWView::initialize(llmr::Map *map) { glfwWindowHint(GLFW_STENCIL_BITS, 8); glfwWindowHint(GLFW_DEPTH_BITS, 16); - window = glfwCreateWindow(1024, 768, "llmr", monitor, NULL); + window = glfwCreateWindow(1024, 768, "Mapbox GL", monitor, NULL); if (!window) { glfwTerminate(); fprintf(stderr, "Failed to initialize window\n"); @@ -194,7 +194,7 @@ void GLFWView::swap() { glfwPostEmptyEvent(); } -void GLFWView::notify_map_change(llmr::MapChange change, llmr::timestamp delay) { +void GLFWView::notify_map_change(mbgl::MapChange change, mbgl::timestamp delay) { // no-op } @@ -212,7 +212,7 @@ void GLFWView::fps() { } } -namespace llmr { +namespace mbgl { namespace platform { double elapsed() { return glfwGetTime(); } diff --git a/common/glfw_view.hpp b/common/glfw_view.hpp index 05a4063289..efef3431a9 100644 --- a/common/glfw_view.hpp +++ b/common/glfw_view.hpp @@ -1,8 +1,8 @@ -#ifndef LLMR_COMMON_GLFW_VIEW -#define LLMR_COMMON_GLFW_VIEW +#ifndef MBGL_COMMON_GLFW_VIEW +#define MBGL_COMMON_GLFW_VIEW -#include -#include +#include +#include #ifdef NVIDIA #define GLFW_INCLUDE_ES2 @@ -11,15 +11,15 @@ #include -class GLFWView : public llmr::View { +class GLFWView : public mbgl::View { public: GLFWView(bool fullscreen = false); ~GLFWView(); - void initialize(llmr::Map *map); + void initialize(mbgl::Map *map); void swap(); void make_active(); - void notify_map_change(llmr::MapChange change, llmr::timestamp delay = 0); + void notify_map_change(mbgl::MapChange change, mbgl::timestamp delay = 0); static void key(GLFWwindow *window, int key, int scancode, int action, int mods); static void scroll(GLFWwindow *window, double xoffset, double yoffset); diff --git a/common/headless_view.cpp b/common/headless_view.cpp index ee1ecf83df..f5d36d3ef6 100644 --- a/common/headless_view.cpp +++ b/common/headless_view.cpp @@ -1,10 +1,10 @@ #include "headless_view.hpp" -#include +#include -namespace llmr { +namespace mbgl { HeadlessView::HeadlessView() { -#if LLMR_USE_CGL +#if MBGL_USE_CGL // TODO: test if OpenGL 4.1 with GL_ARB_ES2_compatibility is supported // If it is, use kCGLOGLPVersion_3_2_Core and enable that extension. CGLPixelFormatAttribute attributes[] = { @@ -30,7 +30,7 @@ HeadlessView::HeadlessView() { } #endif -#if LLMR_USE_GLX +#if MBGL_USE_GLX x_display = XOpenDisplay(0); if (x_display == nullptr) { @@ -66,7 +66,7 @@ HeadlessView::HeadlessView() { void HeadlessView::resize(int width, int height) { clear_buffers(); -#if LLMR_USE_CGL +#if MBGL_USE_CGL make_active(); // Create depth/stencil buffer @@ -101,7 +101,7 @@ void HeadlessView::resize(int width, int height) { } #endif -#if LLMR_USE_GLX +#if MBGL_USE_GLX x_pixmap = XCreatePixmap(x_display, DefaultRootWindow(x_display), width, height, 32); glx_pixmap = glXCreateGLXPixmap(x_display, x_info, x_pixmap); @@ -111,7 +111,7 @@ void HeadlessView::resize(int width, int height) { } void HeadlessView::clear_buffers() { -#if LLMR_USE_CGL +#if MBGL_USE_CGL glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); if (fbo) { @@ -130,7 +130,7 @@ void HeadlessView::clear_buffers() { } #endif -#if LLMR_USE_GLX +#if MBGL_USE_GLX if (glx_pixmap) { glXDestroyGLXPixmap(x_display, glx_pixmap); glx_pixmap = 0; @@ -146,24 +146,24 @@ void HeadlessView::clear_buffers() { HeadlessView::~HeadlessView() { clear_buffers(); -#if LLMR_USE_CGL +#if MBGL_USE_CGL CGLDestroyContext(gl_context); #endif } -void HeadlessView::notify_map_change(llmr::MapChange change, llmr::timestamp delay) { +void HeadlessView::notify_map_change(mbgl::MapChange change, mbgl::timestamp delay) { // no-op } void HeadlessView::make_active() { -#if LLMR_USE_CGL +#if MBGL_USE_CGL CGLError error = CGLSetCurrentContext(gl_context); if (error) { fprintf(stderr, "Switching OpenGL context failed\n"); } #endif -#if LLMR_USE_GLX +#if MBGL_USE_GLX if (!glXMakeCurrent(x_display, glx_pixmap, gl_context)) { fprintf(stderr, "Switching OpenGL context failed\n"); } @@ -173,7 +173,7 @@ void HeadlessView::make_active() { void HeadlessView::swap() {} unsigned int HeadlessView::root_fbo() { -#if LLMR_USE_CGL +#if MBGL_USE_CGL return fbo; #endif diff --git a/common/headless_view.hpp b/common/headless_view.hpp index efbc08df1b..0b255b4a38 100644 --- a/common/headless_view.hpp +++ b/common/headless_view.hpp @@ -1,18 +1,18 @@ -#ifndef LLMR_COMMON_HEADLESS_CGL -#define LLMR_COMMON_HEADLESS_CGL +#ifndef MBGL_COMMON_HEADLESS_CGL +#define MBGL_COMMON_HEADLESS_CGL #ifdef __APPLE__ -#define LLMR_USE_CGL 1 +#define MBGL_USE_CGL 1 #else #include -#define LLMR_USE_GLX 1 +#define MBGL_USE_GLX 1 #endif -#include -#include -#include +#include +#include +#include -namespace llmr { +namespace mbgl { class HeadlessView : public View { public: @@ -31,14 +31,14 @@ private: private: -#if LLMR_USE_CGL +#if MBGL_USE_CGL CGLContextObj gl_context; GLuint fbo = 0; GLuint fbo_depth_stencil = 0; GLuint fbo_color = 0; #endif -#if LLMR_USE_GLX +#if MBGL_USE_GLX GLXContext gl_context = nullptr; XVisualInfo *x_info = nullptr; Display *x_display = nullptr; diff --git a/common/nslog_log.hpp b/common/nslog_log.hpp index 9f2f3aee7b..d40f963036 100644 --- a/common/nslog_log.hpp +++ b/common/nslog_log.hpp @@ -1,9 +1,9 @@ -#ifndef LLMR_COMMON_NSLOG_LOG -#define LLMR_COMMON_NSLOG_LOG +#ifndef MBGL_COMMON_NSLOG_LOG +#define MBGL_COMMON_NSLOG_LOG -#include +#include -namespace llmr { +namespace mbgl { class NSLogBackend : public LogBackend { public: diff --git a/common/nslog_log.mm b/common/nslog_log.mm index c6ca65d0b7..12230143ac 100644 --- a/common/nslog_log.mm +++ b/common/nslog_log.mm @@ -4,7 +4,7 @@ #include -namespace llmr { +namespace mbgl { void NSLogBackend::record(EventSeverity severity, Event event, const std::string &msg) { NSLog(@"[%s] %s: %@", EventSeverityClass(severity).c_str(), EventClass(event).c_str(), diff --git a/common/settings_json.cpp b/common/settings_json.cpp index 771d89e1a2..bceab50da6 100644 --- a/common/settings_json.cpp +++ b/common/settings_json.cpp @@ -4,12 +4,12 @@ #include #include -using namespace llmr; +using namespace mbgl; Settings_JSON::Settings_JSON() { load(); } void Settings_JSON::load() { - FILE *settingsFile = fopen("/tmp/llmr-native.json", "r"); + FILE *settingsFile = fopen("/tmp/mbgl-native.json", "r"); if (settingsFile != NULL) { rapidjson::FileStream is(settingsFile); rapidjson::Document document; @@ -26,7 +26,7 @@ void Settings_JSON::load() { void Settings_JSON::save() { - rapidjson::FileStream s(fopen("/tmp/llmr-native.json", "w")); + rapidjson::FileStream s(fopen("/tmp/mbgl-native.json", "w")); rapidjson::PrettyWriter writer(s); writer.StartArray(); writer.Double(longitude); diff --git a/common/settings_json.hpp b/common/settings_json.hpp index fa95254656..09f7841c91 100644 --- a/common/settings_json.hpp +++ b/common/settings_json.hpp @@ -1,7 +1,7 @@ -#ifndef LLMR_JSON_SETTINGS -#define LLMR_JSON_SETTINGS +#ifndef MBGL_JSON_SETTINGS +#define MBGL_JSON_SETTINGS -namespace llmr { +namespace mbgl { class Settings_JSON { public: diff --git a/common/settings_nsuserdefaults.hpp b/common/settings_nsuserdefaults.hpp index 575cc4a75f..dcc6ab46b9 100644 --- a/common/settings_nsuserdefaults.hpp +++ b/common/settings_nsuserdefaults.hpp @@ -1,7 +1,7 @@ -#ifndef LLMR_COMMON_SETTINGS_NSUSERDEFAULTS -#define LLMR_COMMON_SETTINGS_NSUSERDEFAULTS +#ifndef MBGL_COMMON_SETTINGS_NSUSERDEFAULTS +#define MBGL_COMMON_SETTINGS_NSUSERDEFAULTS -namespace llmr { +namespace mbgl { class Settings_NSUserDefaults { public: diff --git a/common/settings_nsuserdefaults.mm b/common/settings_nsuserdefaults.mm index 783aa500d0..24571677f4 100644 --- a/common/settings_nsuserdefaults.mm +++ b/common/settings_nsuserdefaults.mm @@ -2,7 +2,7 @@ #include "settings_nsuserdefaults.hpp" -using namespace llmr; +using namespace mbgl; Settings_NSUserDefaults::Settings_NSUserDefaults() { diff --git a/common/stderr_log.cpp b/common/stderr_log.cpp index da5799d753..bcb84447bb 100644 --- a/common/stderr_log.cpp +++ b/common/stderr_log.cpp @@ -3,7 +3,7 @@ #include #include -namespace llmr { +namespace mbgl { void StderrLogBackend::record(EventSeverity severity, Event event, const std::string &msg) { std::cerr << "[" << severity << "] " << event << ": " << msg << std::endl; diff --git a/common/stderr_log.hpp b/common/stderr_log.hpp index e2492d3af5..45f76f0d1a 100644 --- a/common/stderr_log.hpp +++ b/common/stderr_log.hpp @@ -1,9 +1,9 @@ -#ifndef LLMR_COMMON_STDERR_LOG -#define LLMR_COMMON_STDERR_LOG +#ifndef MBGL_COMMON_STDERR_LOG +#define MBGL_COMMON_STDERR_LOG -#include +#include -namespace llmr { +namespace mbgl { class StderrLogBackend : public LogBackend { public: diff --git a/config/constants.cpp b/config/constants.cpp index 36f51559e2..3d1422e6c7 100644 --- a/config/constants.cpp +++ b/config/constants.cpp @@ -1,27 +1,27 @@ -#include +#include -const float llmr::util::tileSize = 512.0f; +const float mbgl::util::tileSize = 512.0f; #if defined(DEBUG) -const bool llmr::debug::tileParseWarnings = false; -const bool llmr::debug::styleParseWarnings = false; -const bool llmr::debug::spriteWarnings = false; -const bool llmr::debug::renderWarnings = false; -const bool llmr::debug::renderTree = false; -const bool llmr::debug::labelTextMissingWarning = true; -const bool llmr::debug::missingFontStackWarning = true; -const bool llmr::debug::missingFontFaceWarning = true; -const bool llmr::debug::glyphWarning = true; -const bool llmr::debug::shapingWarning = true; +const bool mbgl::debug::tileParseWarnings = false; +const bool mbgl::debug::styleParseWarnings = false; +const bool mbgl::debug::spriteWarnings = false; +const bool mbgl::debug::renderWarnings = false; +const bool mbgl::debug::renderTree = false; +const bool mbgl::debug::labelTextMissingWarning = true; +const bool mbgl::debug::missingFontStackWarning = true; +const bool mbgl::debug::missingFontFaceWarning = true; +const bool mbgl::debug::glyphWarning = true; +const bool mbgl::debug::shapingWarning = true; #else -const bool llmr::debug::tileParseWarnings = false; -const bool llmr::debug::styleParseWarnings = false; -const bool llmr::debug::spriteWarnings = false; -const bool llmr::debug::renderWarnings = false; -const bool llmr::debug::renderTree = false; -const bool llmr::debug::labelTextMissingWarning = false; -const bool llmr::debug::missingFontStackWarning = false; -const bool llmr::debug::missingFontFaceWarning = false; -const bool llmr::debug::glyphWarning = false; -const bool llmr::debug::shapingWarning = false; +const bool mbgl::debug::tileParseWarnings = false; +const bool mbgl::debug::styleParseWarnings = false; +const bool mbgl::debug::spriteWarnings = false; +const bool mbgl::debug::renderWarnings = false; +const bool mbgl::debug::renderTree = false; +const bool mbgl::debug::labelTextMissingWarning = false; +const bool mbgl::debug::missingFontStackWarning = false; +const bool mbgl::debug::missingFontFaceWarning = false; +const bool mbgl::debug::glyphWarning = false; +const bool mbgl::debug::shapingWarning = false; #endif diff --git a/configure b/configure index 3c9a421bf6..f1a39cbbcf 100755 --- a/configure +++ b/configure @@ -50,7 +50,7 @@ def pkg_config(pkg, pkgconfig_root): return (libs, cflags) -def configure_llmr(o): +def configure_mbgl(o): if options.boost_root: o['variables']['boost_root'] = options.boost_root else: @@ -115,7 +115,7 @@ output = { } if __name__ == '__main__': - configure_llmr(output) + configure_mbgl(output) configure_glfw3(output) configure_uv(output) configure_png(output) 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