diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | gyp/mbgl-core.gypi | 2 | ||||
-rw-r--r-- | gyp/mbgl-headless.gypi | 1 | ||||
-rw-r--r-- | gyp/mbgl-ios.gypi | 1 | ||||
-rw-r--r-- | gyp/mbgl-linux.gypi | 1 | ||||
-rw-r--r-- | gyp/mbgl-osx.gypi | 1 | ||||
-rw-r--r-- | include/libtess2/LICENSE.txt | 25 | ||||
-rw-r--r-- | include/mbgl/map/map.hpp | 26 | ||||
-rw-r--r-- | include/mbgl/map/tile.hpp | 5 | ||||
-rw-r--r-- | include/mbgl/map/transform_state.hpp | 1 | ||||
-rw-r--r-- | include/mbgl/platform/default/headless_display.hpp | 2 | ||||
-rw-r--r-- | include/mbgl/platform/gl.hpp | 4 | ||||
-rw-r--r-- | include/mbgl/platform/log.hpp | 2 | ||||
-rw-r--r-- | include/mbgl/storage/caching_http_file_source.hpp (renamed from include/mbgl/platform/default/caching_http_file_source.hpp) | 17 | ||||
-rw-r--r-- | include/mbgl/storage/file_source.hpp | 8 | ||||
-rw-r--r-- | include/mbgl/storage/request.hpp | 1 | ||||
-rw-r--r-- | include/mbgl/util/math.hpp | 2 | ||||
-rw-r--r-- | include/mbgl/util/string.hpp | 18 | ||||
-rw-r--r-- | include/mbgl/util/variant.hpp | 2 | ||||
-rw-r--r-- | include/mbgl/util/vec.hpp | 5 | ||||
m--------- | ios/mapbox-gl-cocoa | 0 | ||||
-rw-r--r-- | linux/main.cpp | 4 | ||||
-rw-r--r-- | macosx/main.mm | 12 | ||||
-rw-r--r-- | platform/default/caching_http_file_source.cpp | 119 | ||||
-rw-r--r-- | platform/default/glfw_view.cpp | 5 | ||||
-rw-r--r-- | platform/default/settings_json.cpp | 42 | ||||
-rwxr-xr-x | src/clipper/clipper.cpp | 2 | ||||
-rwxr-xr-x | src/clipper/clipper.hpp (renamed from include/clipper/clipper.hpp) | 0 | ||||
-rw-r--r-- | src/csscolorparser/csscolorparser.cpp | 2 | ||||
-rw-r--r-- | src/csscolorparser/csscolorparser.hpp (renamed from include/csscolorparser/csscolorparser.hpp) | 0 | ||||
-rwxr-xr-x | src/libtess2/bucketalloc.c | 2 | ||||
-rwxr-xr-x | src/libtess2/bucketalloc.h | 2 | ||||
-rwxr-xr-x | src/libtess2/dict.c | 2 | ||||
-rwxr-xr-x | src/libtess2/mesh.h | 2 | ||||
-rwxr-xr-x | src/libtess2/priorityq.c | 2 | ||||
-rwxr-xr-x | src/libtess2/tess.h | 2 | ||||
-rwxr-xr-x | src/libtess2/tesselator.h (renamed from include/libtess2/tesselator.h) | 0 | ||||
-rw-r--r-- | src/mbgl/geometry/anchor.hpp (renamed from include/mbgl/geometry/anchor.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/geometry/binpack.hpp (renamed from include/mbgl/geometry/binpack.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/geometry/buffer.hpp (renamed from include/mbgl/geometry/buffer.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/geometry/debug_font_buffer.cpp (renamed from src/geometry/debug_font_buffer.cpp) | 4 | ||||
-rw-r--r-- | src/mbgl/geometry/debug_font_buffer.hpp (renamed from include/mbgl/geometry/debug_font_buffer.hpp) | 2 | ||||
-rw-r--r-- | src/mbgl/geometry/debug_font_data.hpp (renamed from src/geometry/debug_font_data.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/geometry/elements_buffer.cpp (renamed from src/geometry/elements_buffer.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/geometry/elements_buffer.hpp (renamed from include/mbgl/geometry/elements_buffer.hpp) | 1 | ||||
-rw-r--r-- | src/mbgl/geometry/fill_buffer.cpp (renamed from src/geometry/fill_buffer.cpp) | 1 | ||||
-rw-r--r-- | src/mbgl/geometry/fill_buffer.hpp (renamed from include/mbgl/geometry/fill_buffer.hpp) | 2 | ||||
-rw-r--r-- | src/mbgl/geometry/geometry.hpp (renamed from include/mbgl/geometry/geometry.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/geometry/glyph_atlas.cpp (renamed from src/geometry/glyph_atlas.cpp) | 1 | ||||
-rw-r--r-- | src/mbgl/geometry/glyph_atlas.hpp (renamed from include/mbgl/geometry/glyph_atlas.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/geometry/icon_buffer.cpp (renamed from src/geometry/icon_buffer.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/geometry/icon_buffer.hpp (renamed from include/mbgl/geometry/icon_buffer.hpp) | 2 | ||||
-rw-r--r-- | src/mbgl/geometry/line_buffer.cpp (renamed from src/geometry/line_buffer.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/geometry/line_buffer.hpp (renamed from include/mbgl/geometry/line_buffer.hpp) | 2 | ||||
-rw-r--r-- | src/mbgl/geometry/resample.cpp (renamed from src/geometry/resample.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/geometry/resample.hpp (renamed from include/mbgl/geometry/resample.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/geometry/sprite_atlas.cpp (renamed from src/geometry/sprite_atlas.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/geometry/sprite_atlas.hpp (renamed from include/mbgl/geometry/sprite_atlas.hpp) | 1 | ||||
-rw-r--r-- | src/mbgl/geometry/static_vertex_buffer.cpp (renamed from src/geometry/static_vertex_buffer.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/geometry/static_vertex_buffer.hpp (renamed from include/mbgl/geometry/static_vertex_buffer.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/geometry/text_buffer.cpp (renamed from src/geometry/text_buffer.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/geometry/text_buffer.hpp (renamed from include/mbgl/geometry/text_buffer.hpp) | 2 | ||||
-rw-r--r-- | src/mbgl/geometry/vao.cpp (renamed from src/geometry/vao.cpp) | 5 | ||||
-rw-r--r-- | src/mbgl/geometry/vao.hpp (renamed from include/mbgl/geometry/vao.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/map/map.cpp (renamed from src/map/map.cpp) | 69 | ||||
-rw-r--r-- | src/mbgl/map/raster_tile_data.cpp (renamed from src/map/raster_tile_data.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/map/raster_tile_data.hpp (renamed from include/mbgl/map/raster_tile_data.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/map/source.cpp (renamed from src/map/source.cpp) | 8 | ||||
-rw-r--r-- | src/mbgl/map/source.hpp (renamed from include/mbgl/map/source.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/map/sprite.cpp (renamed from src/map/sprite.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/map/sprite.hpp (renamed from include/mbgl/map/sprite.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/map/tile.cpp (renamed from src/map/tile.cpp) | 8 | ||||
-rw-r--r-- | src/mbgl/map/tile_data.cpp (renamed from src/map/tile_data.cpp) | 12 | ||||
-rw-r--r-- | src/mbgl/map/tile_data.hpp (renamed from include/mbgl/map/tile_data.hpp) | 1 | ||||
-rw-r--r-- | src/mbgl/map/tile_parser.cpp (renamed from src/map/tile_parser.cpp) | 1 | ||||
-rw-r--r-- | src/mbgl/map/tile_parser.hpp (renamed from include/mbgl/map/tile_parser.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/map/transform.cpp (renamed from src/map/transform.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/map/transform_state.cpp (renamed from src/map/transform_state.cpp) | 1 | ||||
-rw-r--r-- | src/mbgl/map/vector_tile.cpp (renamed from src/map/vector_tile.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/map/vector_tile.hpp (renamed from include/mbgl/map/vector_tile.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/map/vector_tile_data.cpp (renamed from src/map/vector_tile_data.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/map/vector_tile_data.hpp (renamed from include/mbgl/map/vector_tile_data.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/platform/gl.cpp (renamed from src/platform/gl.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/platform/log.cpp (renamed from src/platform/log.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/renderer/bucket.hpp (renamed from include/mbgl/renderer/bucket.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/renderer/debug_bucket.cpp (renamed from src/renderer/debug_bucket.cpp) | 1 | ||||
-rw-r--r-- | src/mbgl/renderer/debug_bucket.hpp (renamed from include/mbgl/renderer/debug_bucket.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/renderer/fill_bucket.cpp (renamed from src/renderer/fill_bucket.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/renderer/fill_bucket.hpp (renamed from include/mbgl/renderer/fill_bucket.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/renderer/frame_history.cpp (renamed from src/renderer/frame_history.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/renderer/frame_history.hpp (renamed from include/mbgl/renderer/frame_history.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/renderer/line_bucket.cpp (renamed from src/renderer/line_bucket.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/renderer/line_bucket.hpp (renamed from include/mbgl/renderer/line_bucket.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/renderer/painter.cpp (renamed from src/renderer/painter.cpp) | 2 | ||||
-rw-r--r-- | src/mbgl/renderer/painter.hpp (renamed from include/mbgl/renderer/painter.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/renderer/painter_clipping.cpp (renamed from src/renderer/painter_clipping.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/renderer/painter_debug.cpp (renamed from src/renderer/painter_debug.cpp) | 2 | ||||
-rw-r--r-- | src/mbgl/renderer/painter_fill.cpp (renamed from src/renderer/painter_fill.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/renderer/painter_line.cpp (renamed from src/renderer/painter_line.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/renderer/painter_prerender.cpp (renamed from src/renderer/painter_prerender.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/renderer/painter_raster.cpp (renamed from src/renderer/painter_raster.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/renderer/painter_symbol.cpp (renamed from src/renderer/painter_symbol.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/renderer/prerendered_texture.cpp (renamed from src/renderer/prerendered_texture.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/renderer/prerendered_texture.hpp (renamed from include/mbgl/renderer/prerendered_texture.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/renderer/raster_bucket.cpp (renamed from src/renderer/raster_bucket.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/renderer/raster_bucket.hpp (renamed from include/mbgl/renderer/raster_bucket.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/renderer/symbol_bucket.cpp (renamed from src/renderer/symbol_bucket.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/renderer/symbol_bucket.hpp (renamed from include/mbgl/renderer/symbol_bucket.hpp) | 2 | ||||
-rw-r--r-- | src/mbgl/shader/dot.fragment.glsl (renamed from src/shader/dot.fragment.glsl) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/dot.vertex.glsl (renamed from src/shader/dot.vertex.glsl) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/dot_shader.cpp (renamed from src/shader/dot_shader.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/dot_shader.hpp (renamed from include/mbgl/shader/dot_shader.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/gaussian.fragment.glsl (renamed from src/shader/gaussian.fragment.glsl) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/gaussian.vertex.glsl (renamed from src/shader/gaussian.vertex.glsl) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/gaussian_shader.cpp (renamed from src/shader/gaussian_shader.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/gaussian_shader.hpp (renamed from include/mbgl/shader/gaussian_shader.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/icon.fragment.glsl (renamed from src/shader/icon.fragment.glsl) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/icon.vertex.glsl (renamed from src/shader/icon.vertex.glsl) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/icon_shader.cpp (renamed from src/shader/icon_shader.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/icon_shader.hpp (renamed from include/mbgl/shader/icon_shader.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/line.fragment.glsl (renamed from src/shader/line.fragment.glsl) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/line.vertex.glsl (renamed from src/shader/line.vertex.glsl) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/line_shader.cpp (renamed from src/shader/line_shader.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/line_shader.hpp (renamed from include/mbgl/shader/line_shader.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/linejoin.fragment.glsl (renamed from src/shader/linejoin.fragment.glsl) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/linejoin.vertex.glsl (renamed from src/shader/linejoin.vertex.glsl) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/linejoin_shader.cpp (renamed from src/shader/linejoin_shader.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/linejoin_shader.hpp (renamed from include/mbgl/shader/linejoin_shader.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/linepattern.fragment.glsl (renamed from src/shader/linepattern.fragment.glsl) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/linepattern.vertex.glsl (renamed from src/shader/linepattern.vertex.glsl) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/linepattern_shader.cpp (renamed from src/shader/linepattern_shader.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/linepattern_shader.hpp (renamed from include/mbgl/shader/linepattern_shader.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/outline.fragment.glsl (renamed from src/shader/outline.fragment.glsl) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/outline.vertex.glsl (renamed from src/shader/outline.vertex.glsl) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/outline_shader.cpp (renamed from src/shader/outline_shader.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/outline_shader.hpp (renamed from include/mbgl/shader/outline_shader.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/pattern.fragment.glsl (renamed from src/shader/pattern.fragment.glsl) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/pattern.vertex.glsl (renamed from src/shader/pattern.vertex.glsl) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/pattern_shader.cpp (renamed from src/shader/pattern_shader.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/pattern_shader.hpp (renamed from include/mbgl/shader/pattern_shader.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/plain.fragment.glsl (renamed from src/shader/plain.fragment.glsl) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/plain.vertex.glsl (renamed from src/shader/plain.vertex.glsl) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/plain_shader.cpp (renamed from src/shader/plain_shader.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/plain_shader.hpp (renamed from include/mbgl/shader/plain_shader.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/raster.fragment.glsl (renamed from src/shader/raster.fragment.glsl) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/raster.vertex.glsl (renamed from src/shader/raster.vertex.glsl) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/raster_shader.cpp (renamed from src/shader/raster_shader.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/raster_shader.hpp (renamed from include/mbgl/shader/raster_shader.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/sdf.fragment.glsl (renamed from src/shader/sdf.fragment.glsl) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/sdf.vertex.glsl (renamed from src/shader/sdf.vertex.glsl) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/sdf_shader.cpp (renamed from src/shader/sdf_shader.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/sdf_shader.hpp (renamed from include/mbgl/shader/sdf_shader.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/shader.cpp (renamed from src/shader/shader.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/shader.hpp (renamed from include/mbgl/shader/shader.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/uniform.cpp (renamed from src/shader/uniform.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/shader/uniform.hpp (renamed from include/mbgl/shader/uniform.hpp) | 2 | ||||
-rw-r--r-- | src/mbgl/storage/base_request.cpp (renamed from src/storage/base_request.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/storage/base_request.hpp (renamed from include/mbgl/storage/base_request.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/storage/caching_http_file_source.cpp | 130 | ||||
-rw-r--r-- | src/mbgl/storage/file_request.cpp (renamed from src/storage/file_request.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/storage/file_request.hpp (renamed from include/mbgl/storage/file_request.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/storage/file_request_baton.cpp (renamed from src/storage/file_request_baton.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/storage/file_request_baton.hpp (renamed from include/mbgl/storage/file_request_baton.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/storage/http_request.cpp (renamed from src/storage/http_request.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/storage/http_request.hpp (renamed from include/mbgl/storage/http_request.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/storage/http_request_baton.cpp (renamed from src/storage/http_request_baton.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/storage/request.cpp (renamed from src/storage/request.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/storage/response.cpp (renamed from src/storage/response.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/storage/sqlite_store.cpp (renamed from src/storage/sqlite_store.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/storage/sqlite_store.hpp (renamed from include/mbgl/storage/sqlite_store.hpp) | 3 | ||||
-rw-r--r-- | src/mbgl/style/applied_class_properties.cpp (renamed from src/style/applied_class_properties.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/applied_class_properties.hpp (renamed from include/mbgl/style/applied_class_properties.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/class_dictionary.cpp (renamed from src/style/class_dictionary.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/class_dictionary.hpp (renamed from include/mbgl/style/class_dictionary.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/class_properties.cpp (renamed from src/style/class_properties.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/class_properties.hpp (renamed from include/mbgl/style/class_properties.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/filter_expression.cpp (renamed from src/style/filter_expression.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/filter_expression.hpp (renamed from include/mbgl/style/filter_expression.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/filter_expression_private.hpp (renamed from include/mbgl/style/filter_expression_private.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/function_properties.cpp (renamed from src/style/function_properties.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/function_properties.hpp (renamed from include/mbgl/style/function_properties.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/property_fallback.cpp (renamed from src/style/property_fallback.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/property_fallback.hpp (renamed from include/mbgl/style/property_fallback.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/property_key.hpp (renamed from include/mbgl/style/property_key.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/property_transition.hpp (renamed from include/mbgl/style/property_transition.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/property_value.hpp (renamed from include/mbgl/style/property_value.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/style.cpp (renamed from src/style/style.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/style.hpp (renamed from include/mbgl/style/style.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/style_bucket.cpp (renamed from src/style/style_bucket.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/style_bucket.hpp (renamed from include/mbgl/style/style_bucket.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/style_layer.cpp (renamed from src/style/style_layer.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/style_layer.hpp (renamed from include/mbgl/style/style_layer.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/style_layer_group.cpp (renamed from src/style/style_layer_group.cpp) | 1 | ||||
-rw-r--r-- | src/mbgl/style/style_layer_group.hpp (renamed from include/mbgl/style/style_layer_group.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/style_parser.cpp (renamed from src/style/style_parser.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/style_parser.hpp (renamed from include/mbgl/style/style_parser.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/style_properties.cpp (renamed from src/style/style_properties.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/style_properties.hpp (renamed from include/mbgl/style/style_properties.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/style_source.cpp (renamed from src/style/style_source.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/style_source.hpp (renamed from include/mbgl/style/style_source.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/types.cpp (renamed from src/style/types.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/types.hpp (renamed from include/mbgl/style/types.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/value.cpp (renamed from src/style/value.cpp) | 14 | ||||
-rw-r--r-- | src/mbgl/style/value.hpp (renamed from include/mbgl/style/value.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/style/value_comparison.hpp (renamed from include/mbgl/style/value_comparison.hpp) | 2 | ||||
-rw-r--r-- | src/mbgl/text/collision.cpp (renamed from src/text/collision.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/text/collision.hpp (renamed from include/mbgl/text/collision.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/text/glyph.cpp (renamed from src/text/glyph.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/text/glyph.hpp (renamed from include/mbgl/text/glyph.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/text/glyph_store.cpp (renamed from src/text/glyph_store.cpp) | 4 | ||||
-rw-r--r-- | src/mbgl/text/glyph_store.hpp (renamed from include/mbgl/text/glyph_store.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/text/placement.cpp (renamed from src/text/placement.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/text/placement.hpp (renamed from include/mbgl/text/placement.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/text/rotation_range.cpp (renamed from src/text/rotation_range.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/text/rotation_range.hpp (renamed from include/mbgl/text/rotation_range.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/text/types.hpp (renamed from include/mbgl/text/types.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/box.hpp | 15 | ||||
-rw-r--r-- | src/mbgl/util/clip_ids.cpp (renamed from src/util/clip_ids.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/clip_ids.hpp (renamed from include/mbgl/util/clip_ids.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/compression.cpp (renamed from src/util/compression.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/compression.hpp (renamed from include/mbgl/util/compression.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/constants.cpp (renamed from config/constants.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/constants.hpp (renamed from include/mbgl/util/constants.hpp) | 2 | ||||
-rw-r--r-- | src/mbgl/util/error.hpp (renamed from include/mbgl/util/error.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/interpolate.hpp (renamed from include/mbgl/util/interpolate.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/io.cpp (renamed from src/util/io.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/io.hpp (renamed from include/mbgl/util/io.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/mapbox.cpp (renamed from src/util/mapbox.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/mapbox.hpp (renamed from include/mbgl/util/mapbox.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/mat3.cpp (renamed from src/util/mat3.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/mat3.hpp (renamed from include/mbgl/util/mat3.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/mat4.cpp (renamed from src/util/mat4.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/math.cpp (renamed from src/util/math.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/optional.hpp (renamed from include/mbgl/util/optional.hpp) | 2 | ||||
-rw-r--r-- | src/mbgl/util/parsedate.c (renamed from src/util/parsedate.c) | 0 | ||||
-rw-r--r-- | src/mbgl/util/pbf.hpp (renamed from include/mbgl/util/pbf.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/queue.h (renamed from include/mbgl/util/queue.h) | 0 | ||||
-rw-r--r-- | src/mbgl/util/raster.cpp (renamed from src/util/raster.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/raster.hpp (renamed from include/mbgl/util/raster.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/rect.hpp (renamed from include/mbgl/util/rect.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/sqlite3.cpp (renamed from src/util/sqlite3.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/sqlite3.hpp (renamed from include/mbgl/util/sqlite3.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/stopwatch.cpp (renamed from src/util/stopwatch.cpp) | 3 | ||||
-rw-r--r-- | src/mbgl/util/stopwatch.hpp (renamed from include/mbgl/util/stopwatch.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/texture_pool.cpp (renamed from src/util/texture_pool.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/texture_pool.hpp (renamed from include/mbgl/util/texture_pool.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/time.cpp (renamed from src/util/time.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/token.hpp (renamed from include/mbgl/util/token.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/transition.cpp (renamed from src/util/transition.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/transition.hpp (renamed from include/mbgl/util/transition.hpp) | 1 | ||||
-rw-r--r-- | src/mbgl/util/unitbezier.hpp (renamed from include/mbgl/util/unitbezier.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/url.cpp (renamed from src/util/url.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/url.hpp (renamed from include/mbgl/util/url.hpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/utf.hpp | 24 | ||||
-rw-r--r-- | src/mbgl/util/uv-channel.c (renamed from src/util/uv-channel.c) | 0 | ||||
-rw-r--r-- | src/mbgl/util/uv-channel.h (renamed from include/mbgl/util/uv-channel.h) | 0 | ||||
-rw-r--r-- | src/mbgl/util/uv-messenger.c (renamed from src/util/uv-messenger.c) | 0 | ||||
-rw-r--r-- | src/mbgl/util/uv-worker.c (renamed from src/util/uv-worker.c) | 0 | ||||
-rw-r--r-- | src/mbgl/util/uv-worker.h (renamed from include/mbgl/util/uv-worker.h) | 0 | ||||
-rw-r--r-- | src/mbgl/util/uv.cpp (renamed from src/util/uv.cpp) | 0 | ||||
-rw-r--r-- | src/mbgl/util/uv_detail.hpp (renamed from include/mbgl/util/uv_detail.hpp) | 0 | ||||
-rwxr-xr-x | src/rapidjson/document.h (renamed from include/rapidjson/document.h) | 0 | ||||
-rwxr-xr-x | src/rapidjson/filestream.h (renamed from include/rapidjson/filestream.h) | 0 | ||||
-rwxr-xr-x | src/rapidjson/internal/pow10.h (renamed from include/rapidjson/internal/pow10.h) | 0 | ||||
-rwxr-xr-x | src/rapidjson/internal/stack.h (renamed from include/rapidjson/internal/stack.h) | 0 | ||||
-rwxr-xr-x | src/rapidjson/internal/strfunc.h (renamed from include/rapidjson/internal/strfunc.h) | 0 | ||||
-rwxr-xr-x | src/rapidjson/prettywriter.h (renamed from include/rapidjson/prettywriter.h) | 0 | ||||
-rwxr-xr-x | src/rapidjson/rapidjson.h (renamed from include/rapidjson/rapidjson.h) | 0 | ||||
-rwxr-xr-x | src/rapidjson/reader.h (renamed from include/rapidjson/reader.h) | 0 | ||||
-rwxr-xr-x | src/rapidjson/stringbuffer.h (renamed from include/rapidjson/stringbuffer.h) | 0 | ||||
-rwxr-xr-x | src/rapidjson/writer.h (renamed from include/rapidjson/writer.h) | 0 | ||||
-rw-r--r-- | test/headless.cpp | 4 | ||||
-rw-r--r-- | test/test.gyp | 12 |
273 files changed, 346 insertions, 326 deletions
diff --git a/.gitignore b/.gitignore index 589b166759..98d9e28281 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,6 @@ /config.gypi /config-ios.gypi /config-android.gypi -/config/constants_local.cpp /build /include/mbgl/shader/shaders.hpp /src/shader/shaders_gl.cpp diff --git a/gyp/mbgl-core.gypi b/gyp/mbgl-core.gypi index 022480350a..279051968c 100644 --- a/gyp/mbgl-core.gypi +++ b/gyp/mbgl-core.gypi @@ -21,7 +21,6 @@ }, 'sources': [ '<!@(find src -name "*.cpp")', - '<!@(test -f "config/constants_local.cpp" && echo "config/constants_local.cpp" || echo "config/constants.cpp")', '<!@(find src -name "*.c")', '<!@(find src -name "*.h")', '<!@(find include -name "*.hpp")', @@ -31,6 +30,7 @@ ], 'include_dirs': [ '../include', + '../src', ], 'conditions': [ ['OS == "mac"', { diff --git a/gyp/mbgl-headless.gypi b/gyp/mbgl-headless.gypi index da11c8781c..a96ec24c9e 100644 --- a/gyp/mbgl-headless.gypi +++ b/gyp/mbgl-headless.gypi @@ -29,7 +29,6 @@ 'sources': [ '../platform/default/headless_view.cpp', '../platform/default/headless_display.cpp', - '../platform/default/caching_http_file_source.cpp', ], }, ], diff --git a/gyp/mbgl-ios.gypi b/gyp/mbgl-ios.gypi index a2e6f65ba1..c2cb2eed5f 100644 --- a/gyp/mbgl-ios.gypi +++ b/gyp/mbgl-ios.gypi @@ -36,7 +36,6 @@ '../platform/darwin/string_nsstring.mm', '../platform/darwin/http_request_baton_cocoa.mm', '../platform/darwin/image.mm', - '../platform/default/caching_http_file_source.cpp', '../platform/default/asset_request_baton_noop.cpp', ], 'include_dirs': [ diff --git a/gyp/mbgl-linux.gypi b/gyp/mbgl-linux.gypi index 2f402075a7..5bfa8f757d 100644 --- a/gyp/mbgl-linux.gypi +++ b/gyp/mbgl-linux.gypi @@ -35,7 +35,6 @@ '../platform/default/image_reader.cpp', '../platform/default/png_reader.cpp', '../platform/default/jpeg_reader.cpp', - '../platform/default/caching_http_file_source.cpp', '../platform/default/asset_request_baton_noop.cpp', ], 'include_dirs': [ diff --git a/gyp/mbgl-osx.gypi b/gyp/mbgl-osx.gypi index d0eae56733..0ca00a81e9 100644 --- a/gyp/mbgl-osx.gypi +++ b/gyp/mbgl-osx.gypi @@ -11,7 +11,6 @@ '../platform/darwin/string_nsstring.mm', '../platform/darwin/http_request_baton_cocoa.mm', '../platform/darwin/image.mm', - '../platform/default/caching_http_file_source.cpp', '../platform/default/asset_request_baton_noop.cpp', ], 'include_dirs': [ diff --git a/include/libtess2/LICENSE.txt b/include/libtess2/LICENSE.txt deleted file mode 100644 index 30133655cf..0000000000 --- a/include/libtess2/LICENSE.txt +++ /dev/null @@ -1,25 +0,0 @@ -** SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) -** Copyright (C) [dates of first publication] Silicon Graphics, Inc. -** All Rights Reserved. -** -** Permission is hereby granted, free of charge, to any person obtaining a copy -** of this software and associated documentation files (the "Software"), to deal -** in the Software without restriction, including without limitation the rights -** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -** of the Software, and to permit persons to whom the Software is furnished to do so, -** subject to the following conditions: -** -** The above copyright notice including the dates of first publication and either this -** permission notice or a reference to http://oss.sgi.com/projects/FreeB/ shall be -** included in all copies or substantial portions of the Software. -** -** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -** INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -** PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL SILICON GRAPHICS, INC. -** BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE -** OR OTHER DEALINGS IN THE SOFTWARE. -** -** Except as contained in this notice, the name of Silicon Graphics, Inc. shall not -** be used in advertising or otherwise to promote the sale, use or other dealings in -** this Software without prior written authorization from Silicon Graphics, Inc. diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index 91205f03c6..5cdd30f8a6 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -2,9 +2,6 @@ #define MBGL_MAP_MAP #include <mbgl/map/transform.hpp> -#include <mbgl/renderer/painter.hpp> -#include <mbgl/geometry/glyph_atlas.hpp> -#include <mbgl/geometry/sprite_atlas.hpp> #include <mbgl/util/noncopyable.hpp> #include <mbgl/util/time.hpp> #include <mbgl/util/uv.hpp> @@ -18,9 +15,11 @@ #include <vector> #include <mutex> #include <condition_variable> +#include <functional> namespace mbgl { +class Painter; class GlyphStore; class LayerDescription; class Sprite; @@ -31,10 +30,10 @@ class StyleSource; class TexturePool; class FileSource; class View; +class GlyphAtlas; +class SpriteAtlas; class Map : private util::noncopyable { - typedef void (*stop_callback)(void *); - public: explicit Map(View&, FileSource&); ~Map(); @@ -45,9 +44,8 @@ public: // Stop the map render thread. This call will block until the map rendering thread stopped. // The optional callback function will be invoked repeatedly until the map thread is stopped. // The callback function should wait until it is woken up again by view.notify(), otherwise - // this will be a busy waiting loop. The optional data parameter will be passed to the callback - // function. - void stop(stop_callback cb = nullptr, void *data = nullptr); + // this will be a busy waiting loop. + void stop(std::function<void ()> callback = std::function<void ()>()); // Pauses the render thread. The render thread will stop running but will not be terminated and will not lose state until resumed. void pause(bool waitForPause = false); @@ -89,8 +87,6 @@ public: void setStyleURL(const std::string &url); void setStyleJSON(std::string newStyleJSON, const std::string &base = ""); std::string getStyleJSON() const; - void setAccessToken(std::string accessToken); - std::string getAccessToken() const; // Transition void cancelTransitions(); @@ -131,9 +127,6 @@ public: void toggleDebug(); bool getDebug() const; - // Call this when the network reachability changed. - void setReachability(bool status); - inline const TransformState &getState() const { return state; } inline timestamp getTime() const { return animationTime; } @@ -202,17 +195,16 @@ private: FileSource& fileSource; util::ptr<Style> style; - GlyphAtlas glyphAtlas; + const std::unique_ptr<GlyphAtlas> glyphAtlas; util::ptr<GlyphStore> glyphStore; - SpriteAtlas spriteAtlas; + const std::unique_ptr<SpriteAtlas> spriteAtlas; util::ptr<Sprite> sprite; util::ptr<TexturePool> texturePool; - Painter painter; + const std::unique_ptr<Painter> painter; std::string styleURL; std::string styleJSON = ""; - std::string accessToken = ""; std::atomic_uint_fast64_t defaultTransitionDuration; diff --git a/include/mbgl/map/tile.hpp b/include/mbgl/map/tile.hpp index 1ae13dd79d..bdb127030b 100644 --- a/include/mbgl/map/tile.hpp +++ b/include/mbgl/map/tile.hpp @@ -44,10 +44,6 @@ public: return ((std::pow(2, z) * y + x) * 32) + z; } - inline operator std::string() const { - return std::to_string(z) + "/" + std::to_string(x) + "/" + std::to_string(y); - } - inline bool operator==(const ID& rhs) const { return w == rhs.w && z == rhs.z && x == rhs.x && y == rhs.y; } @@ -67,6 +63,7 @@ public: ID normalized() const; std::forward_list<ID> children(int32_t z) const; bool isChildOf(const Tile::ID &id) const; + operator std::string() const; }; static std::forward_list<Tile::ID> cover(int8_t z, const box& bounds); diff --git a/include/mbgl/map/transform_state.hpp b/include/mbgl/map/transform_state.hpp index bb330c1019..6dc34bd873 100644 --- a/include/mbgl/map/transform_state.hpp +++ b/include/mbgl/map/transform_state.hpp @@ -4,7 +4,6 @@ #include <mbgl/map/tile.hpp> #include <mbgl/util/mat4.hpp> -#include <mbgl/util/vec.hpp> #include <cstdint> #include <array> diff --git a/include/mbgl/platform/default/headless_display.hpp b/include/mbgl/platform/default/headless_display.hpp index 5b33fd6990..08c423c587 100644 --- a/include/mbgl/platform/default/headless_display.hpp +++ b/include/mbgl/platform/default/headless_display.hpp @@ -1,7 +1,7 @@ #ifndef MBGL_COMMON_HEADLESS_DISPLAY #define MBGL_COMMON_HEADLESS_DISPLAY -#include "headless_view.hpp" +#include <mbgl/platform/default/headless_view.hpp> namespace mbgl { diff --git a/include/mbgl/platform/gl.hpp b/include/mbgl/platform/gl.hpp index ee781018ce..53386626a0 100644 --- a/include/mbgl/platform/gl.hpp +++ b/include/mbgl/platform/gl.hpp @@ -140,9 +140,9 @@ extern bool isDepth24Supported; // static int indent = 0; inline void start_group(const std::string &str) { if (gl::PushDebugGroup != nullptr) { - gl::PushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, str.size(), str.c_str()); + gl::PushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, GLsizei(str.size()), str.c_str()); } else if (gl::PushGroupMarkerEXT != nullptr) { - gl::PushGroupMarkerEXT(str.size(), str.c_str()); + gl::PushGroupMarkerEXT(GLsizei(str.size()), str.c_str()); } // fprintf(stderr, "%s%s\n", std::string(indent * 4, ' ').c_str(), str.c_str()); // indent++; diff --git a/include/mbgl/platform/log.hpp b/include/mbgl/platform/log.hpp index 418160d3ee..b95895fd10 100644 --- a/include/mbgl/platform/log.hpp +++ b/include/mbgl/platform/log.hpp @@ -1,7 +1,7 @@ #ifndef MBGL_PLATFORM_LOG #define MBGL_PLATFORM_LOG -#include "event.hpp" +#include <mbgl/platform/event.hpp> #include <mbgl/util/std.hpp> diff --git a/include/mbgl/platform/default/caching_http_file_source.hpp b/include/mbgl/storage/caching_http_file_source.hpp index 1db95c699d..66e3335f23 100644 --- a/include/mbgl/platform/default/caching_http_file_source.hpp +++ b/include/mbgl/storage/caching_http_file_source.hpp @@ -16,25 +16,32 @@ class SQLiteStore; class CachingHTTPFileSource : public FileSource { public: CachingHTTPFileSource(const std::string &path_); - ~CachingHTTPFileSource(); + virtual ~CachingHTTPFileSource(); // Stores and checks the libuv loop for requests void setLoop(uv_loop_t*); bool hasLoop(); + void clearLoop(); - // Stores and retrieves the base path/URL for relative requests - void setBase(const std::string &value); - const std::string &getBase() const; + // Set the base path/URL for relative requests + void setBase(std::string); + + // Set the Mapbox API access token + void setAccessToken(std::string); std::unique_ptr<Request> request(ResourceType type, const std::string &url); void prepare(std::function<void()> fn); - void retryAllPending(); + // Call this when the network status reachability changed. + void setReachability(bool reachable); private: std::thread::id threadId; + // Mapbox API access token. + std::string accessToken; + // Path to the cache database. std::string path; diff --git a/include/mbgl/storage/file_source.hpp b/include/mbgl/storage/file_source.hpp index 9c5182397d..23a1462ae8 100644 --- a/include/mbgl/storage/file_source.hpp +++ b/include/mbgl/storage/file_source.hpp @@ -10,16 +10,20 @@ typedef struct uv_loop_s uv_loop_t; + namespace mbgl { class FileSource : public util::noncopyable { public: + virtual ~FileSource() = default; + virtual void setLoop(uv_loop_t*) = 0; virtual bool hasLoop() = 0; - virtual void setBase(const std::string &value) = 0; + virtual void clearLoop() = 0; + + virtual void setBase(std::string) = 0; virtual std::unique_ptr<Request> request(ResourceType type, const std::string &url) = 0; virtual void prepare(std::function<void()> fn) = 0; - virtual void retryAllPending() = 0; }; } diff --git a/include/mbgl/storage/request.hpp b/include/mbgl/storage/request.hpp index 11b5541d18..845c9a6dad 100644 --- a/include/mbgl/storage/request.hpp +++ b/include/mbgl/storage/request.hpp @@ -3,6 +3,7 @@ #include <mbgl/storage/request_callback.hpp> #include <mbgl/storage/response.hpp> + #include <mbgl/util/ptr.hpp> #include <thread> diff --git a/include/mbgl/util/math.hpp b/include/mbgl/util/math.hpp index 2bef5b18e2..e800fc7847 100644 --- a/include/mbgl/util/math.hpp +++ b/include/mbgl/util/math.hpp @@ -4,7 +4,7 @@ #include <cmath> #include <array> -#include "vec.hpp" +#include <mbgl/util/vec.hpp> namespace mbgl { namespace util { diff --git a/include/mbgl/util/string.hpp b/include/mbgl/util/string.hpp index f17d55cec3..690a67d471 100644 --- a/include/mbgl/util/string.hpp +++ b/include/mbgl/util/string.hpp @@ -3,9 +3,27 @@ #include <string> +#pragma GCC diagnostic push +#ifndef __clang__ +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#endif +#include <boost/lexical_cast.hpp> +#pragma GCC diagnostic pop + namespace mbgl { namespace util { +template <typename... Args> +inline std::string toString(Args&&... args) { + return boost::lexical_cast<std::string>(::std::forward<Args>(args)...); +} + +// boost::lexical_cast() treats this as a character, but we are using it as number types. +inline std::string toString(int8_t num) { + return boost::lexical_cast<std::string>(int(num)); +} + + template<size_t max, typename... Args> inline std::string sprintf(const char *msg, Args... args) { char res[max]; diff --git a/include/mbgl/util/variant.hpp b/include/mbgl/util/variant.hpp index 3b5659425a..2de195cd69 100644 --- a/include/mbgl/util/variant.hpp +++ b/include/mbgl/util/variant.hpp @@ -10,7 +10,7 @@ #include <iosfwd> #include <string> -#include "recursive_wrapper.hpp" +#include <mbgl/util/recursive_wrapper.hpp> #ifdef _MSC_VER // http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx diff --git a/include/mbgl/util/vec.hpp b/include/mbgl/util/vec.hpp index 0179254fda..32de852758 100644 --- a/include/mbgl/util/vec.hpp +++ b/include/mbgl/util/vec.hpp @@ -105,11 +105,6 @@ struct vec4 { }; -struct box { - vec2<double> tl, tr, bl, br; - vec2<double> center; -}; - typedef vec2<int16_t> Coordinate; } diff --git a/ios/mapbox-gl-cocoa b/ios/mapbox-gl-cocoa -Subproject af6a9c9fd211f931e4d34be3c7173c52341e5eb +Subproject 1533d3288f5678d13bc550b43fb7dbb6ecdfa29 diff --git a/linux/main.cpp b/linux/main.cpp index 9cf23df959..42a98d0198 100644 --- a/linux/main.cpp +++ b/linux/main.cpp @@ -4,7 +4,7 @@ #include <mbgl/platform/default/settings_json.hpp> #include <mbgl/platform/default/glfw_view.hpp> #include <mbgl/platform/default/log_stderr.hpp> -#include <mbgl/platform/default/caching_http_file_source.hpp> +#include <mbgl/storage/caching_http_file_source.hpp> #include <signal.h> #include <getopt.h> @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) { if (token == nullptr) { mbgl::Log::Warning(mbgl::Event::Setup, "no access token set. mapbox.com tiles won't work."); } else { - map.setAccessToken(std::string(token)); + fileSource.setAccessToken(std::string(token)); } // Load style diff --git a/macosx/main.mm b/macosx/main.mm index fe654e1f71..228b05f0b4 100644 --- a/macosx/main.mm +++ b/macosx/main.mm @@ -1,8 +1,9 @@ +#include <mbgl/platform/platform.hpp> #include <mbgl/platform/darwin/settings_nsuserdefaults.hpp> #include <mbgl/platform/darwin/log_nslog.hpp> #include <mbgl/platform/darwin/Reachability.h> #include <mbgl/platform/default/glfw_view.hpp> -#include <mbgl/platform/default/caching_http_file_source.hpp> +#include <mbgl/storage/caching_http_file_source.hpp> #import <Foundation/Foundation.h> @@ -75,7 +76,7 @@ int main() { GLFWView view; mbgl::CachingHTTPFileSource fileSource(mbgl::platform::defaultCacheDatabase()); mbgl::Map map(view, fileSource); - mbgl::Map *map_ptr = ↦ + mbgl::CachingHTTPFileSource *fileSourcePtr = &fileSource; URLHandler *handler = [[URLHandler alloc] init]; [handler setMap:&map]; @@ -85,7 +86,7 @@ int main() { // Notify map object when network reachability status changes. Reachability* reachability = [Reachability reachabilityForInternetConnection]; reachability.reachableBlock = ^(Reachability *) { - map_ptr->setReachability(true); + fileSourcePtr->setReachability(true); }; [reachability startNotifier]; @@ -95,11 +96,10 @@ int main() { map.setBearing(settings.bearing); map.setDebug(settings.debug); - // Set access token if present NSString *accessToken = [[NSProcessInfo processInfo] environment][@"MAPBOX_ACCESS_TOKEN"]; - if ( ! accessToken) mbgl::Log::Warning(mbgl::Event::Setup, "No access token set. Mapbox vector tiles won't work."); - if (accessToken) map.setAccessToken([accessToken cStringUsingEncoding:[NSString defaultCStringEncoding]]); + if (!accessToken) mbgl::Log::Warning(mbgl::Event::Setup, "No access token set. Mapbox vector tiles won't work."); + if (accessToken) fileSource.setAccessToken([accessToken cStringUsingEncoding:[NSString defaultCStringEncoding]]); // Load style const std::string path([[[NSBundle mainBundle] pathForResource:@"bright-v6" ofType:@"json" inDirectory:@"styles/"] UTF8String]); diff --git a/platform/default/caching_http_file_source.cpp b/platform/default/caching_http_file_source.cpp deleted file mode 100644 index f1dc55fb09..0000000000 --- a/platform/default/caching_http_file_source.cpp +++ /dev/null @@ -1,119 +0,0 @@ -#include <mbgl/platform/default/caching_http_file_source.hpp> -#include <mbgl/storage/file_request.hpp> -#include <mbgl/storage/http_request.hpp> -#include <mbgl/storage/sqlite_store.hpp> -#include <mbgl/storage/asset_request.hpp> -#include <mbgl/util/uv-messenger.h> -#include <mbgl/util/std.hpp> - -#include <uv.h> - -namespace mbgl { - -CachingHTTPFileSource::CachingHTTPFileSource(const std::string &path_) - : path(path_) {} - -CachingHTTPFileSource::~CachingHTTPFileSource() { - if (hasLoop()) { - // FIXME temp fix for #608 crash - // assert(thread_id == std::this_thread::get_id()); - uv_messenger_stop(queue, [](uv_messenger_t *msgr) { - delete msgr; - }); - - util::ptr<BaseRequest> req; - - // Send a cancel() message to all requests that we are still holding. - for (const std::pair<std::string, std::weak_ptr<BaseRequest>> &pair : pending) { - if ((req = pair.second.lock())) { - req->cancel(); - } - } - } -} - -void CachingHTTPFileSource::setLoop(uv_loop_t* loop_) { - threadId = std::this_thread::get_id(); - store = !path.empty() ? util::ptr<SQLiteStore>(new SQLiteStore(loop_, path)) : nullptr; - loop = loop_; - queue = new uv_messenger_t; - - uv_messenger_init(loop, queue, [](void *ptr) { - std::unique_ptr<std::function<void()>> fn { reinterpret_cast<std::function<void()> *>(ptr) }; - (*fn)(); - }); - uv_unref((uv_handle_t *)&queue->async); -} - -bool CachingHTTPFileSource::hasLoop() { - return loop; -} - -void CachingHTTPFileSource::setBase(const std::string &value) { - assert(std::this_thread::get_id() == threadId); - base = value; -} - -const std::string &CachingHTTPFileSource::getBase() const { - assert(std::this_thread::get_id() == threadId); - return base; -} - -std::unique_ptr<Request> CachingHTTPFileSource::request(ResourceType type, const std::string &url) { - assert(std::this_thread::get_id() == threadId); - - // Make URL absolute. - const std::string absoluteURL = [&]() -> std::string { - const size_t separator = url.find("://"); - if (separator == std::string::npos) { - // Relative URL. - return base + url; - } else { - return url; - } - }(); - - util::ptr<BaseRequest> req; - - // First, try to find an existing Request object. - auto it = pending.find(absoluteURL); - if (it != pending.end()) { - req = it->second.lock(); - } - - if (!req) { - if (absoluteURL.substr(0, 7) == "file://") { - req = std::make_shared<FileRequest>(absoluteURL.substr(7), loop); - } else if (absoluteURL.substr(0, 8) == "asset://") { - req = std::make_shared<AssetRequest>(absoluteURL.substr(8), loop); - } else { - req = std::make_shared<HTTPRequest>(type, absoluteURL, loop, store); - } - - pending.emplace(absoluteURL, req); - } - - return util::make_unique<Request>(req); -} - -void CachingHTTPFileSource::prepare(std::function<void()> fn) { - if (std::this_thread::get_id() == threadId) { - fn(); - } else { - uv_messenger_send(queue, new std::function<void()>(std::move(fn))); - } -} - -void CachingHTTPFileSource::retryAllPending() { - assert(std::this_thread::get_id() == threadId); - - util::ptr<BaseRequest> req; - for (const std::pair<std::string, std::weak_ptr<BaseRequest>> &pair : pending) { - if ((req = pair.second.lock())) { - req->retryImmediately(); - } - } - -} - -} diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp index e600340dda..95903d5f8e 100644 --- a/platform/default/glfw_view.cpp +++ b/platform/default/glfw_view.cpp @@ -1,8 +1,6 @@ #include <mbgl/platform/default/glfw_view.hpp> #include <mbgl/platform/gl.hpp> -#include <mbgl/util/string.hpp> - GLFWView::GLFWView(bool fullscreen_) : fullscreen(fullscreen_) { #ifdef NVIDIA glDiscardFramebufferEXT = (PFNGLDISCARDFRAMEBUFFEREXTPROC)glfwGetProcAddress("glDiscardFramebufferEXT"); @@ -10,7 +8,6 @@ GLFWView::GLFWView(bool fullscreen_) : fullscreen(fullscreen_) { } GLFWView::~GLFWView() { - map->terminate(); glfwTerminate(); } @@ -242,7 +239,7 @@ int GLFWView::run() { glfwWaitEvents(); } - map->stop([](void *) { + map->stop([]() { glfwWaitEvents(); }); diff --git a/platform/default/settings_json.cpp b/platform/default/settings_json.cpp index f81c75115e..9b2ae654a5 100644 --- a/platform/default/settings_json.cpp +++ b/platform/default/settings_json.cpp @@ -1,40 +1,30 @@ #include <mbgl/platform/default/settings_json.hpp> -#include <rapidjson/prettywriter.h> -#include <rapidjson/filestream.h> -#include <rapidjson/document.h> -#include <stdio.h> +#include <fstream> using namespace mbgl; Settings_JSON::Settings_JSON() { load(); } void Settings_JSON::load() { - FILE *settingsFile = fopen("/tmp/mbgl-native.json", "r"); - if (settingsFile != NULL) { - rapidjson::FileStream is(settingsFile); - rapidjson::Document document; - document.ParseStream<0>(is); - if (document.IsArray()) { - longitude = document[rapidjson::SizeType(0)].GetDouble(); - latitude = document[1].GetDouble(); - zoom = document[2].GetDouble(); - bearing = document[3].GetDouble(); - debug = document[4].GetBool(); - } + std::ifstream file("/tmp/mbgl-native.cfg"); + if (file) { + file >> longitude; + file >> latitude; + file >> zoom; + file >> bearing; + file >> debug; } } void Settings_JSON::save() { - - rapidjson::FileStream s(fopen("/tmp/mbgl-native.json", "w")); - rapidjson::PrettyWriter<rapidjson::FileStream> writer(s); - writer.StartArray(); - writer.Double(longitude); - writer.Double(latitude); - writer.Double(zoom); - writer.Double(bearing); - writer.Bool(debug); - writer.EndArray(); + std::ofstream file("/tmp/mbgl-native.cfg"); + if (file) { + file << longitude << std::endl; + file << latitude << std::endl; + file << zoom << std::endl; + file << bearing << std::endl; + file << debug << std::endl; + } } void Settings_JSON::clear() { diff --git a/src/clipper/clipper.cpp b/src/clipper/clipper.cpp index ea468d69e4..f5d8cd3c95 100755 --- a/src/clipper/clipper.cpp +++ b/src/clipper/clipper.cpp @@ -38,7 +38,7 @@ * * *******************************************************************************/ -#include <clipper/clipper.hpp> +#include "clipper.hpp" #include <cmath> #include <vector> #include <algorithm> diff --git a/include/clipper/clipper.hpp b/src/clipper/clipper.hpp index 84870141e7..84870141e7 100755 --- a/include/clipper/clipper.hpp +++ b/src/clipper/clipper.hpp diff --git a/src/csscolorparser/csscolorparser.cpp b/src/csscolorparser/csscolorparser.cpp index 938470f192..7ba989fde8 100644 --- a/src/csscolorparser/csscolorparser.cpp +++ b/src/csscolorparser/csscolorparser.cpp @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. -#include <csscolorparser/csscolorparser.hpp> +#include "csscolorparser.hpp" #include <cstdint> #include <vector> diff --git a/include/csscolorparser/csscolorparser.hpp b/src/csscolorparser/csscolorparser.hpp index 6caf796943..6caf796943 100644 --- a/include/csscolorparser/csscolorparser.hpp +++ b/src/csscolorparser/csscolorparser.hpp diff --git a/src/libtess2/bucketalloc.c b/src/libtess2/bucketalloc.c index df1a83c76c..efb2b9813b 100755 --- a/src/libtess2/bucketalloc.c +++ b/src/libtess2/bucketalloc.c @@ -35,7 +35,7 @@ extern "C" { #include <stdio.h> #include <stdlib.h> -#include <libtess2/tesselator.h> +#include "tesselator.h" //#define CHECK_BOUNDS diff --git a/src/libtess2/bucketalloc.h b/src/libtess2/bucketalloc.h index 7168cd7aa7..077d768136 100755 --- a/src/libtess2/bucketalloc.h +++ b/src/libtess2/bucketalloc.h @@ -36,7 +36,7 @@ extern "C" { #endif -#include <libtess2/tesselator.h> +#include "tesselator.h" struct BucketAlloc *createBucketAlloc( TESSalloc* alloc, const char *name, unsigned int itemSize, unsigned int bucketSize ); diff --git a/src/libtess2/dict.c b/src/libtess2/dict.c index 53c66568d1..dd7bade2c8 100755 --- a/src/libtess2/dict.c +++ b/src/libtess2/dict.c @@ -30,7 +30,7 @@ */ #include <stddef.h> -#include <libtess2/tesselator.h> +#include "tesselator.h" #include "bucketalloc.h" #include "dict.h" diff --git a/src/libtess2/mesh.h b/src/libtess2/mesh.h index d6142716a9..1e16a194c1 100755 --- a/src/libtess2/mesh.h +++ b/src/libtess2/mesh.h @@ -32,7 +32,7 @@ #ifndef MESH_H #define MESH_H -#include <libtess2/tesselator.h> +#include "tesselator.h" typedef struct TESSmesh TESSmesh; typedef struct TESSvertex TESSvertex; diff --git a/src/libtess2/priorityq.c b/src/libtess2/priorityq.c index 49e1c012f5..6229b6bfce 100755 --- a/src/libtess2/priorityq.c +++ b/src/libtess2/priorityq.c @@ -32,7 +32,7 @@ //#include "tesos.h" #include <stddef.h> #include <assert.h> -#include <libtess2/tesselator.h> +#include "tesselator.h" #include "priorityq.h" diff --git a/src/libtess2/tess.h b/src/libtess2/tess.h index e4673b34ff..8ed75600d2 100755 --- a/src/libtess2/tess.h +++ b/src/libtess2/tess.h @@ -37,7 +37,7 @@ #include "mesh.h" #include "dict.h" #include "priorityq.h" -#include <libtess2/tesselator.h> +#include "tesselator.h" #ifdef __cplusplus extern "C" { diff --git a/include/libtess2/tesselator.h b/src/libtess2/tesselator.h index 74ca18e27d..74ca18e27d 100755 --- a/include/libtess2/tesselator.h +++ b/src/libtess2/tesselator.h diff --git a/include/mbgl/geometry/anchor.hpp b/src/mbgl/geometry/anchor.hpp index d30394f0b9..d30394f0b9 100644 --- a/include/mbgl/geometry/anchor.hpp +++ b/src/mbgl/geometry/anchor.hpp diff --git a/include/mbgl/geometry/binpack.hpp b/src/mbgl/geometry/binpack.hpp index 9aadaa202c..9aadaa202c 100644 --- a/include/mbgl/geometry/binpack.hpp +++ b/src/mbgl/geometry/binpack.hpp diff --git a/include/mbgl/geometry/buffer.hpp b/src/mbgl/geometry/buffer.hpp index 80cc6b9d1a..80cc6b9d1a 100644 --- a/include/mbgl/geometry/buffer.hpp +++ b/src/mbgl/geometry/buffer.hpp diff --git a/src/geometry/debug_font_buffer.cpp b/src/mbgl/geometry/debug_font_buffer.cpp index 6c233f88df..1ec71463e5 100644 --- a/src/geometry/debug_font_buffer.cpp +++ b/src/mbgl/geometry/debug_font_buffer.cpp @@ -1,10 +1,10 @@ #include <mbgl/geometry/debug_font_buffer.hpp> +#include <mbgl/geometry/debug_font_data.hpp> + #include <mbgl/platform/gl.hpp> #include <cmath> #include <cstring> -#include "debug_font_data.hpp" - using namespace mbgl; void DebugFontBuffer::addText(const char *text, double left, double baseline, double scale) { diff --git a/include/mbgl/geometry/debug_font_buffer.hpp b/src/mbgl/geometry/debug_font_buffer.hpp index 7cceb0f576..802b5dbaac 100644 --- a/include/mbgl/geometry/debug_font_buffer.hpp +++ b/src/mbgl/geometry/debug_font_buffer.hpp @@ -1,7 +1,7 @@ #ifndef MBGL_GEOMETRY_DEBUG_FONT_BUFFER #define MBGL_GEOMETRY_DEBUG_FONT_BUFFER -#include "buffer.hpp" +#include <mbgl/geometry/buffer.hpp> namespace mbgl { diff --git a/src/geometry/debug_font_data.hpp b/src/mbgl/geometry/debug_font_data.hpp index 26c54cb480..26c54cb480 100644 --- a/src/geometry/debug_font_data.hpp +++ b/src/mbgl/geometry/debug_font_data.hpp diff --git a/src/geometry/elements_buffer.cpp b/src/mbgl/geometry/elements_buffer.cpp index 79af1b7e35..79af1b7e35 100644 --- a/src/geometry/elements_buffer.cpp +++ b/src/mbgl/geometry/elements_buffer.cpp diff --git a/include/mbgl/geometry/elements_buffer.hpp b/src/mbgl/geometry/elements_buffer.hpp index 045560f9aa..9255337cb5 100644 --- a/include/mbgl/geometry/elements_buffer.hpp +++ b/src/mbgl/geometry/elements_buffer.hpp @@ -3,6 +3,7 @@ #include <mbgl/geometry/buffer.hpp> #include <mbgl/geometry/vao.hpp> + #include <mbgl/util/noncopyable.hpp> #include <array> diff --git a/src/geometry/fill_buffer.cpp b/src/mbgl/geometry/fill_buffer.cpp index c75ad3477d..3392699431 100644 --- a/src/geometry/fill_buffer.cpp +++ b/src/mbgl/geometry/fill_buffer.cpp @@ -1,4 +1,5 @@ #include <mbgl/geometry/fill_buffer.hpp> + #include <mbgl/platform/gl.hpp> #include <climits> diff --git a/include/mbgl/geometry/fill_buffer.hpp b/src/mbgl/geometry/fill_buffer.hpp index 4a3d5a5b38..2cd1637fa1 100644 --- a/include/mbgl/geometry/fill_buffer.hpp +++ b/src/mbgl/geometry/fill_buffer.hpp @@ -1,7 +1,7 @@ #ifndef MBGL_GEOMETRY_FILL_BUFFER #define MBGL_GEOMETRY_FILL_BUFFER -#include "buffer.hpp" +#include <mbgl/geometry/buffer.hpp> #include <vector> #include <cstdint> diff --git a/include/mbgl/geometry/geometry.hpp b/src/mbgl/geometry/geometry.hpp index 484d17b36d..484d17b36d 100644 --- a/include/mbgl/geometry/geometry.hpp +++ b/src/mbgl/geometry/geometry.hpp diff --git a/src/geometry/glyph_atlas.cpp b/src/mbgl/geometry/glyph_atlas.cpp index 40459821fd..bafcf2b000 100644 --- a/src/geometry/glyph_atlas.cpp +++ b/src/mbgl/geometry/glyph_atlas.cpp @@ -1,5 +1,6 @@ #include <mbgl/geometry/glyph_atlas.hpp> #include <mbgl/map/vector_tile.hpp> + #include <mbgl/platform/gl.hpp> #include <mbgl/platform/platform.hpp> diff --git a/include/mbgl/geometry/glyph_atlas.hpp b/src/mbgl/geometry/glyph_atlas.hpp index 7b3c223fe5..7b3c223fe5 100644 --- a/include/mbgl/geometry/glyph_atlas.hpp +++ b/src/mbgl/geometry/glyph_atlas.hpp diff --git a/src/geometry/icon_buffer.cpp b/src/mbgl/geometry/icon_buffer.cpp index c571dfa69e..c571dfa69e 100644 --- a/src/geometry/icon_buffer.cpp +++ b/src/mbgl/geometry/icon_buffer.cpp diff --git a/include/mbgl/geometry/icon_buffer.hpp b/src/mbgl/geometry/icon_buffer.hpp index e7e5f40355..08c9687004 100644 --- a/include/mbgl/geometry/icon_buffer.hpp +++ b/src/mbgl/geometry/icon_buffer.hpp @@ -1,7 +1,7 @@ #ifndef MBGL_GEOMETRY_ICON_BUFFER #define MBGL_GEOMETRY_ICON_BUFFER -#include "buffer.hpp" +#include <mbgl/geometry/buffer.hpp> #include <array> diff --git a/src/geometry/line_buffer.cpp b/src/mbgl/geometry/line_buffer.cpp index 50a6e66b93..50a6e66b93 100644 --- a/src/geometry/line_buffer.cpp +++ b/src/mbgl/geometry/line_buffer.cpp diff --git a/include/mbgl/geometry/line_buffer.hpp b/src/mbgl/geometry/line_buffer.hpp index 5012bb12ac..1c217b59d2 100644 --- a/include/mbgl/geometry/line_buffer.hpp +++ b/src/mbgl/geometry/line_buffer.hpp @@ -1,7 +1,7 @@ #ifndef MBGL_GEOMETRY_LINE_BUFFER #define MBGL_GEOMETRY_LINE_BUFFER -#include "buffer.hpp" +#include <mbgl/geometry/buffer.hpp> namespace mbgl { diff --git a/src/geometry/resample.cpp b/src/mbgl/geometry/resample.cpp index abb3ef1e3c..abb3ef1e3c 100644 --- a/src/geometry/resample.cpp +++ b/src/mbgl/geometry/resample.cpp diff --git a/include/mbgl/geometry/resample.hpp b/src/mbgl/geometry/resample.hpp index bcfe4ca53d..bcfe4ca53d 100644 --- a/include/mbgl/geometry/resample.hpp +++ b/src/mbgl/geometry/resample.hpp diff --git a/src/geometry/sprite_atlas.cpp b/src/mbgl/geometry/sprite_atlas.cpp index 7dc8f60ae6..7dc8f60ae6 100644 --- a/src/geometry/sprite_atlas.cpp +++ b/src/mbgl/geometry/sprite_atlas.cpp diff --git a/include/mbgl/geometry/sprite_atlas.hpp b/src/mbgl/geometry/sprite_atlas.hpp index 9fb42a30b5..9e0fe995bb 100644 --- a/include/mbgl/geometry/sprite_atlas.hpp +++ b/src/mbgl/geometry/sprite_atlas.hpp @@ -2,6 +2,7 @@ #define MBGL_GEOMETRY_SPRITE_ATLAS #include <mbgl/geometry/binpack.hpp> + #include <mbgl/util/noncopyable.hpp> #include <mbgl/util/ptr.hpp> diff --git a/src/geometry/static_vertex_buffer.cpp b/src/mbgl/geometry/static_vertex_buffer.cpp index c86211c50f..c86211c50f 100644 --- a/src/geometry/static_vertex_buffer.cpp +++ b/src/mbgl/geometry/static_vertex_buffer.cpp diff --git a/include/mbgl/geometry/static_vertex_buffer.hpp b/src/mbgl/geometry/static_vertex_buffer.hpp index ce932269f0..ce932269f0 100644 --- a/include/mbgl/geometry/static_vertex_buffer.hpp +++ b/src/mbgl/geometry/static_vertex_buffer.hpp diff --git a/src/geometry/text_buffer.cpp b/src/mbgl/geometry/text_buffer.cpp index 295ff02efa..295ff02efa 100644 --- a/src/geometry/text_buffer.cpp +++ b/src/mbgl/geometry/text_buffer.cpp diff --git a/include/mbgl/geometry/text_buffer.hpp b/src/mbgl/geometry/text_buffer.hpp index 159f3207a8..4687b32f97 100644 --- a/include/mbgl/geometry/text_buffer.hpp +++ b/src/mbgl/geometry/text_buffer.hpp @@ -1,7 +1,7 @@ #ifndef MBGL_GEOMETRY_TEXT_BUFFER #define MBGL_GEOMETRY_TEXT_BUFFER -#include "buffer.hpp" +#include <mbgl/geometry/buffer.hpp> #include <array> namespace mbgl { diff --git a/src/geometry/vao.cpp b/src/mbgl/geometry/vao.cpp index d2fd2727ef..66822ba5ce 100644 --- a/src/geometry/vao.cpp +++ b/src/mbgl/geometry/vao.cpp @@ -1,5 +1,6 @@ #include <mbgl/geometry/vao.hpp> #include <mbgl/platform/log.hpp> +#include <mbgl/util/string.hpp> namespace mbgl { @@ -31,8 +32,8 @@ void VertexArrayObject::verifyBinding(Shader &shader, GLuint vertexBuffer, GLuin char *offset) { if (bound_shader != shader.getID()) { throw std::runtime_error(std::string("trying to rebind VAO to another shader from " + - std::to_string(bound_shader) + "(" + bound_shader_name + ") to " + - std::to_string(shader.getID()) + "(" + shader.name + ")" )); + util::toString(bound_shader) + "(" + bound_shader_name + ") to " + + util::toString(shader.getID()) + "(" + shader.name + ")" )); } else if (bound_offset != offset) { throw std::runtime_error("trying to bind VAO to another offset"); } else if (bound_vertex_buffer != vertexBuffer) { diff --git a/include/mbgl/geometry/vao.hpp b/src/mbgl/geometry/vao.hpp index 2ecba731f7..2ecba731f7 100644 --- a/include/mbgl/geometry/vao.hpp +++ b/src/mbgl/geometry/vao.hpp diff --git a/src/map/map.cpp b/src/mbgl/map/map.cpp index 89d84b48f0..b0a06e8711 100644 --- a/src/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -1,7 +1,8 @@ #include <mbgl/map/map.hpp> -#include <mbgl/map/source.hpp> #include <mbgl/map/view.hpp> #include <mbgl/platform/platform.hpp> +#include <mbgl/map/source.hpp> +#include <mbgl/renderer/painter.hpp> #include <mbgl/map/sprite.hpp> #include <mbgl/util/transition.hpp> #include <mbgl/util/time.hpp> @@ -11,10 +12,10 @@ #include <mbgl/util/constants.hpp> #include <mbgl/util/uv_detail.hpp> #include <mbgl/util/std.hpp> -#include <mbgl/util/mapbox.hpp> #include <mbgl/style/style.hpp> #include <mbgl/text/glyph_store.hpp> #include <mbgl/geometry/glyph_atlas.hpp> +#include <mbgl/style/style_layer.hpp> #include <mbgl/style/style_layer_group.hpp> #include <mbgl/style/style_bucket.hpp> #include <mbgl/util/texture_pool.hpp> @@ -98,10 +99,11 @@ Map::Map(View& view_, FileSource& fileSource_) #endif transform(view_), fileSource(fileSource_), - glyphAtlas(1024, 1024), - spriteAtlas(512, 512), + glyphAtlas(util::make_unique<GlyphAtlas>(1024, 1024)), + glyphStore(std::make_shared<GlyphStore>(fileSource)), + spriteAtlas(util::make_unique<SpriteAtlas>(512, 512)), texturePool(std::make_shared<TexturePool>()), - painter(spriteAtlas, glyphAtlas) + painter(util::make_unique<Painter>(*spriteAtlas, *glyphAtlas)) { view.initialize(this); // Make sure that we're doing an initial drawing in all cases. @@ -149,11 +151,12 @@ void Map::start(bool startPaused) { assert(std::this_thread::get_id() == mapThread); // Remove all of these to make sure they are destructed in the correct thread. - glyphStore.reset(); style.reset(); workers.reset(); activeSources.clear(); + fileSource.clearLoop(); + terminating = true; // Closes all open handles on the loop. This means that the loop will automatically terminate. @@ -182,7 +185,8 @@ void Map::start(bool startPaused) { }); asyncCleanup = util::make_unique<uv::async>(**loop, [this]() { - painter.cleanup(); + assert(painter); + painter->cleanup(); }); // Do we need to pause first? @@ -211,7 +215,7 @@ void Map::start(bool startPaused) { }); } -void Map::stop(stop_callback cb, void *data) { +void Map::stop(std::function<void ()> callback) { assert(std::this_thread::get_id() == mainThread); assert(mainThread != mapThread); assert(async); @@ -220,7 +224,7 @@ void Map::stop(stop_callback cb, void *data) { resume(); - if (cb) { + if (callback) { // Wait until the render thread stopped. We are using this construct instead of plainly // relying on the thread_join because the system might need to run things in the current // thread that is required for the render thread to terminate correctly. This is for example @@ -228,7 +232,7 @@ void Map::stop(stop_callback cb, void *data) { // thread (== main thread) is blocked. The callback function should use an efficient waiting // function to avoid a busy waiting loop. while (!isStopped) { - cb(data); + callback(); } } @@ -364,24 +368,17 @@ void Map::cleanup() { } void Map::terminate() { - painter.terminate(); -} - -void Map::setReachability(bool reachable) { - // Note: This function may be called from *any* thread. - if (reachable) { - fileSource.prepare([&]() { - fileSource.retryAllPending(); - }); - } + assert(painter); + painter->terminate(); } #pragma mark - Setup void Map::setup() { assert(std::this_thread::get_id() == mapThread); + assert(painter); view.make_active(); - painter.setup(); + painter->setup(); } void Map::setStyleURL(const std::string &url) { @@ -404,12 +401,8 @@ void Map::setStyleJSON(std::string newStyleJSON, const std::string &base) { } style->loadJSON((const uint8_t *)styleJSON.c_str()); - if (!fileSource.hasLoop()) { - fileSource.setLoop(**loop); - glyphStore = std::make_shared<GlyphStore>(fileSource); - } fileSource.setBase(base); - glyphStore->setURL(util::mapbox::normalizeGlyphsURL(style->glyph_url, getAccessToken())); + glyphStore->setURL(style->glyph_url); style->setDefaultTransitionDuration(defaultTransitionDuration); @@ -431,15 +424,6 @@ std::string Map::getStyleJSON() const { return styleJSON; } -void Map::setAccessToken(std::string accessToken_) { - // TODO: Make threadsafe. - accessToken.swap(accessToken_); -} - -std::string Map::getAccessToken() const { - return accessToken; -} - util::ptr<Sprite> Map::getSprite() { const float pixelRatio = state.getPixelRatio(); const std::string &sprite_url = style->getSpriteURL(); @@ -604,7 +588,8 @@ void Map::stopRotating() { void Map::setDebug(bool value) { debug = value; - painter.setDebug(debug); + assert(painter); + painter->setDebug(debug); update(); } @@ -700,8 +685,8 @@ void Map::updateSources(const util::ptr<StyleLayerGroup> &group) { void Map::updateTiles() { for (const auto& source : activeSources) { source->source->update(*this, getWorker(), - style, glyphAtlas, *glyphStore, - spriteAtlas, getSprite(), + style, *glyphAtlas, *glyphStore, + *spriteAtlas, getSprite(), *texturePool, fileSource, [this](){ update(); }); } } @@ -709,7 +694,6 @@ void Map::updateTiles() { void Map::prepare() { if (!fileSource.hasLoop()) { fileSource.setLoop(**loop); - glyphStore = std::make_shared<GlyphStore>(fileSource); } if (!style) { @@ -744,14 +728,15 @@ void Map::prepare() { style->updateProperties(state.getNormalizedZoom(), animationTime); // Allow the sprite atlas to potentially pull new sprite images if needed. - spriteAtlas.resize(state.getPixelRatio()); - spriteAtlas.setSprite(getSprite()); + spriteAtlas->resize(state.getPixelRatio()); + spriteAtlas->setSprite(getSprite()); updateTiles(); } void Map::render() { - painter.render(*style, activeSources, + assert(painter); + painter->render(*style, activeSources, state, animationTime); // Schedule another rerender when we definitely need a next frame. if (transform.needsTransition() || style->hasTransitions()) { diff --git a/src/map/raster_tile_data.cpp b/src/mbgl/map/raster_tile_data.cpp index 6fac7862e7..6fac7862e7 100644 --- a/src/map/raster_tile_data.cpp +++ b/src/mbgl/map/raster_tile_data.cpp diff --git a/include/mbgl/map/raster_tile_data.hpp b/src/mbgl/map/raster_tile_data.hpp index 42070d9c61..42070d9c61 100644 --- a/include/mbgl/map/raster_tile_data.hpp +++ b/src/mbgl/map/raster_tile_data.hpp diff --git a/src/map/source.cpp b/src/mbgl/map/source.cpp index 35f5072860..798cd41d1d 100644 --- a/src/map/source.cpp +++ b/src/mbgl/map/source.cpp @@ -10,6 +10,7 @@ #include <mbgl/util/vec.hpp> #include <mbgl/util/math.hpp> #include <mbgl/util/std.hpp> +#include <mbgl/util/box.hpp> #include <mbgl/util/mapbox.hpp> #include <mbgl/geometry/glyph_atlas.hpp> #include <mbgl/style/style_layer.hpp> @@ -36,10 +37,9 @@ void Source::load(Map& map, FileSource& fileSource) { return; } - std::string url = util::mapbox::normalizeSourceURL(info.url, map.getAccessToken()); util::ptr<Source> source = shared_from_this(); - fileSource.request(ResourceType::JSON, url)->onload([source, &map](const Response &res) { + fileSource.request(ResourceType::JSON, info.url)->onload([source, &map](const Response &res) { if (res.code != 200) { Log::Warning(Event::General, "failed to load source TileJSON"); return; @@ -88,13 +88,13 @@ size_t Source::getTileCount() const { void Source::drawClippingMasks(Painter &painter) { for (std::pair<const Tile::ID, std::unique_ptr<Tile>> &pair : tiles) { Tile &tile = *pair.second; - gl::group group(util::sprintf<32>("mask %d/%d/%d", tile.id.z, tile.id.y, tile.id.z)); + gl::group group(std::string { "mask: " } + std::string(tile.id)); painter.drawClippingMask(tile.matrix, tile.clip); } } void Source::render(Painter &painter, util::ptr<StyleLayer> layer_desc) { - gl::group group(std::string("layer: ") + layer_desc->id); + gl::group group(std::string { "layer: " } + layer_desc->id); for (const std::pair<const Tile::ID, std::unique_ptr<Tile>> &pair : tiles) { Tile &tile = *pair.second; if (tile.data && tile.data->state == TileData::State::parsed) { diff --git a/include/mbgl/map/source.hpp b/src/mbgl/map/source.hpp index 8976f67b05..8976f67b05 100644 --- a/include/mbgl/map/source.hpp +++ b/src/mbgl/map/source.hpp diff --git a/src/map/sprite.cpp b/src/mbgl/map/sprite.cpp index c1f71e59d9..c1f71e59d9 100644 --- a/src/map/sprite.cpp +++ b/src/mbgl/map/sprite.cpp diff --git a/include/mbgl/map/sprite.hpp b/src/mbgl/map/sprite.hpp index d4b54ba1b5..d4b54ba1b5 100644 --- a/include/mbgl/map/sprite.hpp +++ b/src/mbgl/map/sprite.hpp diff --git a/src/map/tile.cpp b/src/mbgl/map/tile.cpp index 3070d3fd96..9f31048857 100644 --- a/src/map/tile.cpp +++ b/src/mbgl/map/tile.cpp @@ -1,5 +1,8 @@ #include <mbgl/map/tile.hpp> #include <mbgl/util/vec.hpp> +#include <mbgl/util/string.hpp> +#include <mbgl/util/box.hpp> + #include <cassert> @@ -52,6 +55,11 @@ bool Tile::ID::isChildOf(const Tile::ID &parent_id) const { } +Tile::ID::operator std::string() const { + return util::toString(z) + "/" + util::toString(x) + "/" + util::toString(y); +} + + // Taken from polymaps src/Layer.js // https://github.com/simplegeo/polymaps/blob/master/src/Layer.js#L333-L383 diff --git a/src/map/tile_data.cpp b/src/mbgl/map/tile_data.cpp index c1354d490b..f89ff15baf 100644 --- a/src/map/tile_data.cpp +++ b/src/mbgl/map/tile_data.cpp @@ -11,12 +11,12 @@ using namespace mbgl; TileData::TileData(Tile::ID const& id_, const SourceInfo& source_) : id(id_), + name(id), state(State::initial), source(source_), debugBucket(debugFontBuffer) { // Initialize tile debug coordinates - const std::string str = util::sprintf<32>("%d/%d/%d", id_.z, id_.x, id_.y); - debugFontBuffer.addText(str.c_str(), 50, 200, 5); + debugFontBuffer.addText(name.c_str(), 50, 200, 5); } TileData::~TileData() { @@ -24,7 +24,7 @@ TileData::~TileData() { } const std::string TileData::toString() const { - return util::sprintf<32>("[tile %d/%d/%d]", id.z, id.x, id.y); + return std::string { "[tile " } + name + "]"; } void TileData::request(uv::worker& worker, FileSource& fileSource, @@ -34,9 +34,9 @@ void TileData::request(uv::worker& worker, FileSource& fileSource, std::string url = source.tiles[(id.x + id.y) % source.tiles.size()]; url = util::replaceTokens(url, [&](const std::string &token) -> std::string { - if (token == "z") return std::to_string(id.z); - if (token == "x") return std::to_string(id.x); - if (token == "y") return std::to_string(id.y); + if (token == "z") return util::toString(id.z); + if (token == "x") return util::toString(id.x); + if (token == "y") return util::toString(id.y); if (token == "prefix") { std::string prefix { 2 }; prefix[0] = "0123456789abcdef"[id.x % 16]; diff --git a/include/mbgl/map/tile_data.hpp b/src/mbgl/map/tile_data.hpp index c8a13b83de..1ae215b204 100644 --- a/include/mbgl/map/tile_data.hpp +++ b/src/mbgl/map/tile_data.hpp @@ -66,6 +66,7 @@ public: public: const Tile::ID id; + const std::string name; std::atomic<State> state; public: diff --git a/src/map/tile_parser.cpp b/src/mbgl/map/tile_parser.cpp index cbfd6fa7b3..1e12e5fc16 100644 --- a/src/map/tile_parser.cpp +++ b/src/mbgl/map/tile_parser.cpp @@ -1,5 +1,4 @@ #include <mbgl/map/tile_parser.hpp> - #include <mbgl/map/vector_tile_data.hpp> #include <mbgl/style/style.hpp> #include <mbgl/style/style_layer.hpp> diff --git a/include/mbgl/map/tile_parser.hpp b/src/mbgl/map/tile_parser.hpp index beae3af831..beae3af831 100644 --- a/include/mbgl/map/tile_parser.hpp +++ b/src/mbgl/map/tile_parser.hpp diff --git a/src/map/transform.cpp b/src/mbgl/map/transform.cpp index d05d1f7446..d05d1f7446 100644 --- a/src/map/transform.cpp +++ b/src/mbgl/map/transform.cpp diff --git a/src/map/transform_state.cpp b/src/mbgl/map/transform_state.cpp index afc5b59ef1..a7da8ccab2 100644 --- a/src/map/transform_state.cpp +++ b/src/mbgl/map/transform_state.cpp @@ -1,5 +1,6 @@ #include <mbgl/map/transform_state.hpp> #include <mbgl/util/constants.hpp> +#include <mbgl/util/box.hpp> using namespace mbgl; diff --git a/src/map/vector_tile.cpp b/src/mbgl/map/vector_tile.cpp index ac7134fb0c..ac7134fb0c 100644 --- a/src/map/vector_tile.cpp +++ b/src/mbgl/map/vector_tile.cpp diff --git a/include/mbgl/map/vector_tile.hpp b/src/mbgl/map/vector_tile.hpp index 2d02ba3a0b..2d02ba3a0b 100644 --- a/include/mbgl/map/vector_tile.hpp +++ b/src/mbgl/map/vector_tile.hpp diff --git a/src/map/vector_tile_data.cpp b/src/mbgl/map/vector_tile_data.cpp index 06782057f6..06782057f6 100644 --- a/src/map/vector_tile_data.cpp +++ b/src/mbgl/map/vector_tile_data.cpp diff --git a/include/mbgl/map/vector_tile_data.hpp b/src/mbgl/map/vector_tile_data.hpp index b9bf55a1b3..b9bf55a1b3 100644 --- a/include/mbgl/map/vector_tile_data.hpp +++ b/src/mbgl/map/vector_tile_data.hpp diff --git a/src/platform/gl.cpp b/src/mbgl/platform/gl.cpp index 155fd70d95..155fd70d95 100644 --- a/src/platform/gl.cpp +++ b/src/mbgl/platform/gl.cpp diff --git a/src/platform/log.cpp b/src/mbgl/platform/log.cpp index b83c7a9322..b83c7a9322 100644 --- a/src/platform/log.cpp +++ b/src/mbgl/platform/log.cpp diff --git a/include/mbgl/renderer/bucket.hpp b/src/mbgl/renderer/bucket.hpp index 696bfb1110..696bfb1110 100644 --- a/include/mbgl/renderer/bucket.hpp +++ b/src/mbgl/renderer/bucket.hpp diff --git a/src/renderer/debug_bucket.cpp b/src/mbgl/renderer/debug_bucket.cpp index 58fbf8a35b..f089374564 100644 --- a/src/renderer/debug_bucket.cpp +++ b/src/mbgl/renderer/debug_bucket.cpp @@ -1,5 +1,4 @@ #include <mbgl/renderer/debug_bucket.hpp> - #include <mbgl/renderer/painter.hpp> #include <mbgl/platform/gl.hpp> diff --git a/include/mbgl/renderer/debug_bucket.hpp b/src/mbgl/renderer/debug_bucket.hpp index fb6cfb4cae..fb6cfb4cae 100644 --- a/include/mbgl/renderer/debug_bucket.hpp +++ b/src/mbgl/renderer/debug_bucket.hpp diff --git a/src/renderer/fill_bucket.cpp b/src/mbgl/renderer/fill_bucket.cpp index 0a7d77935d..0a7d77935d 100644 --- a/src/renderer/fill_bucket.cpp +++ b/src/mbgl/renderer/fill_bucket.cpp diff --git a/include/mbgl/renderer/fill_bucket.hpp b/src/mbgl/renderer/fill_bucket.hpp index ae766ec28d..ae766ec28d 100644 --- a/include/mbgl/renderer/fill_bucket.hpp +++ b/src/mbgl/renderer/fill_bucket.hpp diff --git a/src/renderer/frame_history.cpp b/src/mbgl/renderer/frame_history.cpp index 8b69162a23..8b69162a23 100644 --- a/src/renderer/frame_history.cpp +++ b/src/mbgl/renderer/frame_history.cpp diff --git a/include/mbgl/renderer/frame_history.hpp b/src/mbgl/renderer/frame_history.hpp index 61bb59da33..61bb59da33 100644 --- a/include/mbgl/renderer/frame_history.hpp +++ b/src/mbgl/renderer/frame_history.hpp diff --git a/src/renderer/line_bucket.cpp b/src/mbgl/renderer/line_bucket.cpp index 8267cbaba2..8267cbaba2 100644 --- a/src/renderer/line_bucket.cpp +++ b/src/mbgl/renderer/line_bucket.cpp diff --git a/include/mbgl/renderer/line_bucket.hpp b/src/mbgl/renderer/line_bucket.hpp index 7337ca80ad..7337ca80ad 100644 --- a/include/mbgl/renderer/line_bucket.hpp +++ b/src/mbgl/renderer/line_bucket.hpp diff --git a/src/renderer/painter.cpp b/src/mbgl/renderer/painter.cpp index a08cf39dcb..bfc59942e7 100644 --- a/src/renderer/painter.cpp +++ b/src/mbgl/renderer/painter.cpp @@ -370,7 +370,7 @@ void Painter::renderLayer(util::ptr<StyleLayer> layer_desc, const Tile::ID* id, void Painter::renderTileLayer(const Tile& tile, util::ptr<StyleLayer> layer_desc, const mat4 &matrix) { assert(tile.data); if (tile.data->hasData(*layer_desc) || layer_desc->type == StyleLayerType::Raster) { - gl::group group(util::sprintf<32>("render %d/%d/%d\n", tile.id.z, tile.id.y, tile.id.z)); + gl::group group(std::string { "render " } + tile.data->name); prepareTile(tile); tile.data->render(*this, layer_desc, matrix); } diff --git a/include/mbgl/renderer/painter.hpp b/src/mbgl/renderer/painter.hpp index be4bd12710..be4bd12710 100644 --- a/include/mbgl/renderer/painter.hpp +++ b/src/mbgl/renderer/painter.hpp diff --git a/src/renderer/painter_clipping.cpp b/src/mbgl/renderer/painter_clipping.cpp index dc625ded4e..dc625ded4e 100644 --- a/src/renderer/painter_clipping.cpp +++ b/src/mbgl/renderer/painter_clipping.cpp diff --git a/src/renderer/painter_debug.cpp b/src/mbgl/renderer/painter_debug.cpp index 5bc36a233c..c4d273aa47 100644 --- a/src/renderer/painter_debug.cpp +++ b/src/mbgl/renderer/painter_debug.cpp @@ -6,7 +6,7 @@ using namespace mbgl; void Painter::renderTileDebug(const Tile& tile) { - gl::group group(util::sprintf<32>("debug %d/%d/%d", tile.id.z, tile.id.y, tile.id.z)); + gl::group group(std::string { "debug " } + std::string(tile.id)); assert(tile.data); if (debug) { prepareTile(tile); diff --git a/src/renderer/painter_fill.cpp b/src/mbgl/renderer/painter_fill.cpp index f2759ffd61..f2759ffd61 100644 --- a/src/renderer/painter_fill.cpp +++ b/src/mbgl/renderer/painter_fill.cpp diff --git a/src/renderer/painter_line.cpp b/src/mbgl/renderer/painter_line.cpp index 4bf50569ac..4bf50569ac 100644 --- a/src/renderer/painter_line.cpp +++ b/src/mbgl/renderer/painter_line.cpp diff --git a/src/renderer/painter_prerender.cpp b/src/mbgl/renderer/painter_prerender.cpp index 22a2be9b64..22a2be9b64 100644 --- a/src/renderer/painter_prerender.cpp +++ b/src/mbgl/renderer/painter_prerender.cpp diff --git a/src/renderer/painter_raster.cpp b/src/mbgl/renderer/painter_raster.cpp index df655cdae8..df655cdae8 100644 --- a/src/renderer/painter_raster.cpp +++ b/src/mbgl/renderer/painter_raster.cpp diff --git a/src/renderer/painter_symbol.cpp b/src/mbgl/renderer/painter_symbol.cpp index 79625f1681..79625f1681 100644 --- a/src/renderer/painter_symbol.cpp +++ b/src/mbgl/renderer/painter_symbol.cpp diff --git a/src/renderer/prerendered_texture.cpp b/src/mbgl/renderer/prerendered_texture.cpp index f17fe3b82a..f17fe3b82a 100644 --- a/src/renderer/prerendered_texture.cpp +++ b/src/mbgl/renderer/prerendered_texture.cpp diff --git a/include/mbgl/renderer/prerendered_texture.hpp b/src/mbgl/renderer/prerendered_texture.hpp index 3ccd24038d..3ccd24038d 100644 --- a/include/mbgl/renderer/prerendered_texture.hpp +++ b/src/mbgl/renderer/prerendered_texture.hpp diff --git a/src/renderer/raster_bucket.cpp b/src/mbgl/renderer/raster_bucket.cpp index 85bb66970e..85bb66970e 100644 --- a/src/renderer/raster_bucket.cpp +++ b/src/mbgl/renderer/raster_bucket.cpp diff --git a/include/mbgl/renderer/raster_bucket.hpp b/src/mbgl/renderer/raster_bucket.hpp index 0a7651d7cc..0a7651d7cc 100644 --- a/include/mbgl/renderer/raster_bucket.hpp +++ b/src/mbgl/renderer/raster_bucket.hpp diff --git a/src/renderer/symbol_bucket.cpp b/src/mbgl/renderer/symbol_bucket.cpp index a005449628..a005449628 100644 --- a/src/renderer/symbol_bucket.cpp +++ b/src/mbgl/renderer/symbol_bucket.cpp diff --git a/include/mbgl/renderer/symbol_bucket.hpp b/src/mbgl/renderer/symbol_bucket.hpp index 9a5da1d012..dd596b1a00 100644 --- a/include/mbgl/renderer/symbol_bucket.hpp +++ b/src/mbgl/renderer/symbol_bucket.hpp @@ -1,7 +1,7 @@ #ifndef MBGL_RENDERER_SYMBOLBUCKET #define MBGL_RENDERER_SYMBOLBUCKET -#include "bucket.hpp" +#include <mbgl/renderer/bucket.hpp> #include <mbgl/geometry/vao.hpp> #include <mbgl/geometry/elements_buffer.hpp> #include <mbgl/geometry/text_buffer.hpp> diff --git a/src/shader/dot.fragment.glsl b/src/mbgl/shader/dot.fragment.glsl index 6d998b5611..6d998b5611 100644 --- a/src/shader/dot.fragment.glsl +++ b/src/mbgl/shader/dot.fragment.glsl diff --git a/src/shader/dot.vertex.glsl b/src/mbgl/shader/dot.vertex.glsl index 5310ae745e..5310ae745e 100644 --- a/src/shader/dot.vertex.glsl +++ b/src/mbgl/shader/dot.vertex.glsl diff --git a/src/shader/dot_shader.cpp b/src/mbgl/shader/dot_shader.cpp index a897f410a7..a897f410a7 100644 --- a/src/shader/dot_shader.cpp +++ b/src/mbgl/shader/dot_shader.cpp diff --git a/include/mbgl/shader/dot_shader.hpp b/src/mbgl/shader/dot_shader.hpp index 2c4176f364..2c4176f364 100644 --- a/include/mbgl/shader/dot_shader.hpp +++ b/src/mbgl/shader/dot_shader.hpp diff --git a/src/shader/gaussian.fragment.glsl b/src/mbgl/shader/gaussian.fragment.glsl index ee8406e9e1..ee8406e9e1 100644 --- a/src/shader/gaussian.fragment.glsl +++ b/src/mbgl/shader/gaussian.fragment.glsl diff --git a/src/shader/gaussian.vertex.glsl b/src/mbgl/shader/gaussian.vertex.glsl index 26a8394204..26a8394204 100644 --- a/src/shader/gaussian.vertex.glsl +++ b/src/mbgl/shader/gaussian.vertex.glsl diff --git a/src/shader/gaussian_shader.cpp b/src/mbgl/shader/gaussian_shader.cpp index 9060f0ee71..9060f0ee71 100644 --- a/src/shader/gaussian_shader.cpp +++ b/src/mbgl/shader/gaussian_shader.cpp diff --git a/include/mbgl/shader/gaussian_shader.hpp b/src/mbgl/shader/gaussian_shader.hpp index 0f494f5c7e..0f494f5c7e 100644 --- a/include/mbgl/shader/gaussian_shader.hpp +++ b/src/mbgl/shader/gaussian_shader.hpp diff --git a/src/shader/icon.fragment.glsl b/src/mbgl/shader/icon.fragment.glsl index 45b56793eb..45b56793eb 100644 --- a/src/shader/icon.fragment.glsl +++ b/src/mbgl/shader/icon.fragment.glsl diff --git a/src/shader/icon.vertex.glsl b/src/mbgl/shader/icon.vertex.glsl index 8c69c40410..8c69c40410 100644 --- a/src/shader/icon.vertex.glsl +++ b/src/mbgl/shader/icon.vertex.glsl diff --git a/src/shader/icon_shader.cpp b/src/mbgl/shader/icon_shader.cpp index 5c54177eb6..5c54177eb6 100644 --- a/src/shader/icon_shader.cpp +++ b/src/mbgl/shader/icon_shader.cpp diff --git a/include/mbgl/shader/icon_shader.hpp b/src/mbgl/shader/icon_shader.hpp index 645d7e21b6..645d7e21b6 100644 --- a/include/mbgl/shader/icon_shader.hpp +++ b/src/mbgl/shader/icon_shader.hpp diff --git a/src/shader/line.fragment.glsl b/src/mbgl/shader/line.fragment.glsl index f4ac1458b3..f4ac1458b3 100644 --- a/src/shader/line.fragment.glsl +++ b/src/mbgl/shader/line.fragment.glsl diff --git a/src/shader/line.vertex.glsl b/src/mbgl/shader/line.vertex.glsl index 1d8e687c95..1d8e687c95 100644 --- a/src/shader/line.vertex.glsl +++ b/src/mbgl/shader/line.vertex.glsl diff --git a/src/shader/line_shader.cpp b/src/mbgl/shader/line_shader.cpp index 8353f4c6ca..8353f4c6ca 100644 --- a/src/shader/line_shader.cpp +++ b/src/mbgl/shader/line_shader.cpp diff --git a/include/mbgl/shader/line_shader.hpp b/src/mbgl/shader/line_shader.hpp index b789330882..b789330882 100644 --- a/include/mbgl/shader/line_shader.hpp +++ b/src/mbgl/shader/line_shader.hpp diff --git a/src/shader/linejoin.fragment.glsl b/src/mbgl/shader/linejoin.fragment.glsl index 705a57766e..705a57766e 100644 --- a/src/shader/linejoin.fragment.glsl +++ b/src/mbgl/shader/linejoin.fragment.glsl diff --git a/src/shader/linejoin.vertex.glsl b/src/mbgl/shader/linejoin.vertex.glsl index 2e03561e5b..2e03561e5b 100644 --- a/src/shader/linejoin.vertex.glsl +++ b/src/mbgl/shader/linejoin.vertex.glsl diff --git a/src/shader/linejoin_shader.cpp b/src/mbgl/shader/linejoin_shader.cpp index 050e180e00..050e180e00 100644 --- a/src/shader/linejoin_shader.cpp +++ b/src/mbgl/shader/linejoin_shader.cpp diff --git a/include/mbgl/shader/linejoin_shader.hpp b/src/mbgl/shader/linejoin_shader.hpp index 61406fd45c..61406fd45c 100644 --- a/include/mbgl/shader/linejoin_shader.hpp +++ b/src/mbgl/shader/linejoin_shader.hpp diff --git a/src/shader/linepattern.fragment.glsl b/src/mbgl/shader/linepattern.fragment.glsl index 52ca823a3b..52ca823a3b 100644 --- a/src/shader/linepattern.fragment.glsl +++ b/src/mbgl/shader/linepattern.fragment.glsl diff --git a/src/shader/linepattern.vertex.glsl b/src/mbgl/shader/linepattern.vertex.glsl index 4600ebf65b..4600ebf65b 100644 --- a/src/shader/linepattern.vertex.glsl +++ b/src/mbgl/shader/linepattern.vertex.glsl diff --git a/src/shader/linepattern_shader.cpp b/src/mbgl/shader/linepattern_shader.cpp index 954dbd2b3f..954dbd2b3f 100644 --- a/src/shader/linepattern_shader.cpp +++ b/src/mbgl/shader/linepattern_shader.cpp diff --git a/include/mbgl/shader/linepattern_shader.hpp b/src/mbgl/shader/linepattern_shader.hpp index bf85940b8a..bf85940b8a 100644 --- a/include/mbgl/shader/linepattern_shader.hpp +++ b/src/mbgl/shader/linepattern_shader.hpp diff --git a/src/shader/outline.fragment.glsl b/src/mbgl/shader/outline.fragment.glsl index eccda714e5..eccda714e5 100644 --- a/src/shader/outline.fragment.glsl +++ b/src/mbgl/shader/outline.fragment.glsl diff --git a/src/shader/outline.vertex.glsl b/src/mbgl/shader/outline.vertex.glsl index 29c16e3ded..29c16e3ded 100644 --- a/src/shader/outline.vertex.glsl +++ b/src/mbgl/shader/outline.vertex.glsl diff --git a/src/shader/outline_shader.cpp b/src/mbgl/shader/outline_shader.cpp index ddabfa5d0d..ddabfa5d0d 100644 --- a/src/shader/outline_shader.cpp +++ b/src/mbgl/shader/outline_shader.cpp diff --git a/include/mbgl/shader/outline_shader.hpp b/src/mbgl/shader/outline_shader.hpp index f3e8175fd7..f3e8175fd7 100644 --- a/include/mbgl/shader/outline_shader.hpp +++ b/src/mbgl/shader/outline_shader.hpp diff --git a/src/shader/pattern.fragment.glsl b/src/mbgl/shader/pattern.fragment.glsl index ba6aed3023..ba6aed3023 100644 --- a/src/shader/pattern.fragment.glsl +++ b/src/mbgl/shader/pattern.fragment.glsl diff --git a/src/shader/pattern.vertex.glsl b/src/mbgl/shader/pattern.vertex.glsl index f2de884ead..f2de884ead 100644 --- a/src/shader/pattern.vertex.glsl +++ b/src/mbgl/shader/pattern.vertex.glsl diff --git a/src/shader/pattern_shader.cpp b/src/mbgl/shader/pattern_shader.cpp index 31374bc3e8..31374bc3e8 100644 --- a/src/shader/pattern_shader.cpp +++ b/src/mbgl/shader/pattern_shader.cpp diff --git a/include/mbgl/shader/pattern_shader.hpp b/src/mbgl/shader/pattern_shader.hpp index 9fabd8e18a..9fabd8e18a 100644 --- a/include/mbgl/shader/pattern_shader.hpp +++ b/src/mbgl/shader/pattern_shader.hpp diff --git a/src/shader/plain.fragment.glsl b/src/mbgl/shader/plain.fragment.glsl index 8df552c171..8df552c171 100644 --- a/src/shader/plain.fragment.glsl +++ b/src/mbgl/shader/plain.fragment.glsl diff --git a/src/shader/plain.vertex.glsl b/src/mbgl/shader/plain.vertex.glsl index 866c3cd2f3..866c3cd2f3 100644 --- a/src/shader/plain.vertex.glsl +++ b/src/mbgl/shader/plain.vertex.glsl diff --git a/src/shader/plain_shader.cpp b/src/mbgl/shader/plain_shader.cpp index 8a37837b30..8a37837b30 100644 --- a/src/shader/plain_shader.cpp +++ b/src/mbgl/shader/plain_shader.cpp diff --git a/include/mbgl/shader/plain_shader.hpp b/src/mbgl/shader/plain_shader.hpp index 051501c3c9..051501c3c9 100644 --- a/include/mbgl/shader/plain_shader.hpp +++ b/src/mbgl/shader/plain_shader.hpp diff --git a/src/shader/raster.fragment.glsl b/src/mbgl/shader/raster.fragment.glsl index 333de76dc1..333de76dc1 100644 --- a/src/shader/raster.fragment.glsl +++ b/src/mbgl/shader/raster.fragment.glsl diff --git a/src/shader/raster.vertex.glsl b/src/mbgl/shader/raster.vertex.glsl index 97e563f585..97e563f585 100644 --- a/src/shader/raster.vertex.glsl +++ b/src/mbgl/shader/raster.vertex.glsl diff --git a/src/shader/raster_shader.cpp b/src/mbgl/shader/raster_shader.cpp index 7351f7d0c4..7351f7d0c4 100644 --- a/src/shader/raster_shader.cpp +++ b/src/mbgl/shader/raster_shader.cpp diff --git a/include/mbgl/shader/raster_shader.hpp b/src/mbgl/shader/raster_shader.hpp index 8cf97055a2..8cf97055a2 100644 --- a/include/mbgl/shader/raster_shader.hpp +++ b/src/mbgl/shader/raster_shader.hpp diff --git a/src/shader/sdf.fragment.glsl b/src/mbgl/shader/sdf.fragment.glsl index d72d61dab1..d72d61dab1 100644 --- a/src/shader/sdf.fragment.glsl +++ b/src/mbgl/shader/sdf.fragment.glsl diff --git a/src/shader/sdf.vertex.glsl b/src/mbgl/shader/sdf.vertex.glsl index c5166ae46f..c5166ae46f 100644 --- a/src/shader/sdf.vertex.glsl +++ b/src/mbgl/shader/sdf.vertex.glsl diff --git a/src/shader/sdf_shader.cpp b/src/mbgl/shader/sdf_shader.cpp index b86733c0e4..b86733c0e4 100644 --- a/src/shader/sdf_shader.cpp +++ b/src/mbgl/shader/sdf_shader.cpp diff --git a/include/mbgl/shader/sdf_shader.hpp b/src/mbgl/shader/sdf_shader.hpp index 0737c25ee1..0737c25ee1 100644 --- a/include/mbgl/shader/sdf_shader.hpp +++ b/src/mbgl/shader/sdf_shader.hpp diff --git a/src/shader/shader.cpp b/src/mbgl/shader/shader.cpp index f083beaa48..f083beaa48 100644 --- a/src/shader/shader.cpp +++ b/src/mbgl/shader/shader.cpp diff --git a/include/mbgl/shader/shader.hpp b/src/mbgl/shader/shader.hpp index 27e831a510..27e831a510 100644 --- a/include/mbgl/shader/shader.hpp +++ b/src/mbgl/shader/shader.hpp diff --git a/src/shader/uniform.cpp b/src/mbgl/shader/uniform.cpp index 24f179baf1..24f179baf1 100644 --- a/src/shader/uniform.cpp +++ b/src/mbgl/shader/uniform.cpp diff --git a/include/mbgl/shader/uniform.hpp b/src/mbgl/shader/uniform.hpp index a87bbd7aa3..8579ae22c7 100644 --- a/include/mbgl/shader/uniform.hpp +++ b/src/mbgl/shader/uniform.hpp @@ -43,7 +43,7 @@ public: private: void bind(const T&); - + T current; GLint location; }; diff --git a/src/storage/base_request.cpp b/src/mbgl/storage/base_request.cpp index 510bd7bf1c..510bd7bf1c 100644 --- a/src/storage/base_request.cpp +++ b/src/mbgl/storage/base_request.cpp diff --git a/include/mbgl/storage/base_request.hpp b/src/mbgl/storage/base_request.hpp index 5119c343e9..5119c343e9 100644 --- a/include/mbgl/storage/base_request.hpp +++ b/src/mbgl/storage/base_request.hpp diff --git a/src/mbgl/storage/caching_http_file_source.cpp b/src/mbgl/storage/caching_http_file_source.cpp new file mode 100644 index 0000000000..cf09c58113 --- /dev/null +++ b/src/mbgl/storage/caching_http_file_source.cpp @@ -0,0 +1,130 @@ +#include <mbgl/storage/caching_http_file_source.hpp> +#include <mbgl/storage/file_request.hpp> +#include <mbgl/storage/http_request.hpp> +#include <mbgl/storage/sqlite_store.hpp> +#include <mbgl/storage/asset_request.hpp> +#include <mbgl/util/uv-messenger.h> +#include <mbgl/util/mapbox.hpp> +#include <mbgl/util/std.hpp> + +#include <uv.h> + +namespace mbgl { + +CachingHTTPFileSource::CachingHTTPFileSource(const std::string &path_) + : path(path_) {} + +CachingHTTPFileSource::~CachingHTTPFileSource() { +} + +void CachingHTTPFileSource::setLoop(uv_loop_t* loop_) { + threadId = std::this_thread::get_id(); + store = !path.empty() ? util::ptr<SQLiteStore>(new SQLiteStore(loop_, path)) : nullptr; + loop = loop_; + queue = new uv_messenger_t; + + uv_messenger_init(loop, queue, [](void *ptr) { + std::unique_ptr<std::function<void()>> fn { reinterpret_cast<std::function<void()> *>(ptr) }; + (*fn)(); + }); + uv_unref((uv_handle_t *)&queue->async); +} + +bool CachingHTTPFileSource::hasLoop() { + return loop; +} + +void CachingHTTPFileSource::clearLoop() { + assert(std::this_thread::get_id() == threadId); + assert(loop); + + uv_messenger_stop(queue, [](uv_messenger_t *msgr) { + delete msgr; + }); + + util::ptr<BaseRequest> req; + + // Send a cancel() message to all requests that we are still holding. + for (const std::pair<std::string, std::weak_ptr<BaseRequest>> &pair : pending) { + if ((req = pair.second.lock())) { + req->cancel(); + } + } + + store.reset(); +} + +void CachingHTTPFileSource::setBase(std::string value) { + // TODO: Make threadsafe. + base.swap(value); +} + +void CachingHTTPFileSource::setAccessToken(std::string value) { + // TODO: Make threadsafe. + accessToken.swap(value); +} + +std::unique_ptr<Request> CachingHTTPFileSource::request(ResourceType type, const std::string& url_) { + assert(tstd::this_thread::get_id() == threadId); + + std::string url = url_; + + // Make URL absolute. + const size_t separator = url.find("://"); + if (separator == std::string::npos) { + url = base + url; + } + + // Normalize mapbox:// URLs. + switch (type) { + case ResourceType::Glyphs: + url = util::mapbox::normalizeGlyphsURL(url, accessToken); + default: + url = util::mapbox::normalizeSourceURL(url, accessToken); + } + + util::ptr<BaseRequest> req; + + // First, try to find an existing Request object. + auto it = pending.find(url); + if (it != pending.end()) { + req = it->second.lock(); + } + + if (!req) { + if (url.substr(0, 7) == "file://") { + req = std::make_shared<FileRequest>(url.substr(7), loop); + } else if (url.substr(0, 8) == "asset://") { + req = std::make_shared<AssetRequest>(url.substr(8), loop); + } else { + req = std::make_shared<HTTPRequest>(type, url, loop, store); + } + + pending.emplace(url, req); + } + + return util::make_unique<Request>(req); +} + +void CachingHTTPFileSource::prepare(std::function<void()> fn) { + if (std::this_thread::get_id() == threadId) { + fn(); + } else { + uv_messenger_send(queue, new std::function<void()>(std::move(fn))); + } +} + +void CachingHTTPFileSource::setReachability(bool reachable) { + if (reachable && loop) { + prepare([this]() { + util::ptr<BaseRequest> req; + for (const std::pair<std::string, std::weak_ptr<BaseRequest>> &pair : pending) { + if ((req = pair.second.lock())) { + req->retryImmediately(); + } + } + }); + } +} + +} diff --git a/src/storage/file_request.cpp b/src/mbgl/storage/file_request.cpp index 6cb882101d..6cb882101d 100644 --- a/src/storage/file_request.cpp +++ b/src/mbgl/storage/file_request.cpp diff --git a/include/mbgl/storage/file_request.hpp b/src/mbgl/storage/file_request.hpp index 3de2d5b60d..3de2d5b60d 100644 --- a/include/mbgl/storage/file_request.hpp +++ b/src/mbgl/storage/file_request.hpp diff --git a/src/storage/file_request_baton.cpp b/src/mbgl/storage/file_request_baton.cpp index c661cd347a..c661cd347a 100644 --- a/src/storage/file_request_baton.cpp +++ b/src/mbgl/storage/file_request_baton.cpp diff --git a/include/mbgl/storage/file_request_baton.hpp b/src/mbgl/storage/file_request_baton.hpp index 0c3fa16da3..0c3fa16da3 100644 --- a/include/mbgl/storage/file_request_baton.hpp +++ b/src/mbgl/storage/file_request_baton.hpp diff --git a/src/storage/http_request.cpp b/src/mbgl/storage/http_request.cpp index 57e6c260ef..57e6c260ef 100644 --- a/src/storage/http_request.cpp +++ b/src/mbgl/storage/http_request.cpp diff --git a/include/mbgl/storage/http_request.hpp b/src/mbgl/storage/http_request.hpp index 7cc72101d5..7cc72101d5 100644 --- a/include/mbgl/storage/http_request.hpp +++ b/src/mbgl/storage/http_request.hpp diff --git a/src/storage/http_request_baton.cpp b/src/mbgl/storage/http_request_baton.cpp index d781a3bdf4..d781a3bdf4 100644 --- a/src/storage/http_request_baton.cpp +++ b/src/mbgl/storage/http_request_baton.cpp diff --git a/src/storage/request.cpp b/src/mbgl/storage/request.cpp index 39fbd36789..39fbd36789 100644 --- a/src/storage/request.cpp +++ b/src/mbgl/storage/request.cpp diff --git a/src/storage/response.cpp b/src/mbgl/storage/response.cpp index a08a6d31ce..a08a6d31ce 100644 --- a/src/storage/response.cpp +++ b/src/mbgl/storage/response.cpp diff --git a/src/storage/sqlite_store.cpp b/src/mbgl/storage/sqlite_store.cpp index d382921dec..d382921dec 100644 --- a/src/storage/sqlite_store.cpp +++ b/src/mbgl/storage/sqlite_store.cpp diff --git a/include/mbgl/storage/sqlite_store.hpp b/src/mbgl/storage/sqlite_store.hpp index a691b474e0..988eca2597 100644 --- a/include/mbgl/storage/sqlite_store.hpp +++ b/src/mbgl/storage/sqlite_store.hpp @@ -1,8 +1,9 @@ #ifndef MBGL_STORAGE_SQLITE_STORE #define MBGL_STORAGE_SQLITE_STORE -#include <mbgl/storage/file_source.hpp> #include <mbgl/storage/response.hpp> +#include <mbgl/storage/resource_type.hpp> +#include <mbgl/util/ptr.hpp> #include <uv.h> diff --git a/src/style/applied_class_properties.cpp b/src/mbgl/style/applied_class_properties.cpp index 9037c6ad5d..9037c6ad5d 100644 --- a/src/style/applied_class_properties.cpp +++ b/src/mbgl/style/applied_class_properties.cpp diff --git a/include/mbgl/style/applied_class_properties.hpp b/src/mbgl/style/applied_class_properties.hpp index 827f15a2a1..827f15a2a1 100644 --- a/include/mbgl/style/applied_class_properties.hpp +++ b/src/mbgl/style/applied_class_properties.hpp diff --git a/src/style/class_dictionary.cpp b/src/mbgl/style/class_dictionary.cpp index ba7c0d55be..ba7c0d55be 100644 --- a/src/style/class_dictionary.cpp +++ b/src/mbgl/style/class_dictionary.cpp diff --git a/include/mbgl/style/class_dictionary.hpp b/src/mbgl/style/class_dictionary.hpp index ecf80be3e3..ecf80be3e3 100644 --- a/include/mbgl/style/class_dictionary.hpp +++ b/src/mbgl/style/class_dictionary.hpp diff --git a/src/style/class_properties.cpp b/src/mbgl/style/class_properties.cpp index e7bf855bfc..e7bf855bfc 100644 --- a/src/style/class_properties.cpp +++ b/src/mbgl/style/class_properties.cpp diff --git a/include/mbgl/style/class_properties.hpp b/src/mbgl/style/class_properties.hpp index 888a90c5d7..888a90c5d7 100644 --- a/include/mbgl/style/class_properties.hpp +++ b/src/mbgl/style/class_properties.hpp diff --git a/src/style/filter_expression.cpp b/src/mbgl/style/filter_expression.cpp index 7d4f60b3ed..7d4f60b3ed 100644 --- a/src/style/filter_expression.cpp +++ b/src/mbgl/style/filter_expression.cpp diff --git a/include/mbgl/style/filter_expression.hpp b/src/mbgl/style/filter_expression.hpp index 8c6f447770..8c6f447770 100644 --- a/include/mbgl/style/filter_expression.hpp +++ b/src/mbgl/style/filter_expression.hpp diff --git a/include/mbgl/style/filter_expression_private.hpp b/src/mbgl/style/filter_expression_private.hpp index 381f8f617c..381f8f617c 100644 --- a/include/mbgl/style/filter_expression_private.hpp +++ b/src/mbgl/style/filter_expression_private.hpp diff --git a/src/style/function_properties.cpp b/src/mbgl/style/function_properties.cpp index 69466c1f64..69466c1f64 100644 --- a/src/style/function_properties.cpp +++ b/src/mbgl/style/function_properties.cpp diff --git a/include/mbgl/style/function_properties.hpp b/src/mbgl/style/function_properties.hpp index 924f192330..924f192330 100644 --- a/include/mbgl/style/function_properties.hpp +++ b/src/mbgl/style/function_properties.hpp diff --git a/src/style/property_fallback.cpp b/src/mbgl/style/property_fallback.cpp index 965baf6c4b..965baf6c4b 100644 --- a/src/style/property_fallback.cpp +++ b/src/mbgl/style/property_fallback.cpp diff --git a/include/mbgl/style/property_fallback.hpp b/src/mbgl/style/property_fallback.hpp index 5c5eae0cd6..5c5eae0cd6 100644 --- a/include/mbgl/style/property_fallback.hpp +++ b/src/mbgl/style/property_fallback.hpp diff --git a/include/mbgl/style/property_key.hpp b/src/mbgl/style/property_key.hpp index efeebf0242..efeebf0242 100644 --- a/include/mbgl/style/property_key.hpp +++ b/src/mbgl/style/property_key.hpp diff --git a/include/mbgl/style/property_transition.hpp b/src/mbgl/style/property_transition.hpp index 07b7cfe288..07b7cfe288 100644 --- a/include/mbgl/style/property_transition.hpp +++ b/src/mbgl/style/property_transition.hpp diff --git a/include/mbgl/style/property_value.hpp b/src/mbgl/style/property_value.hpp index 1b22b31177..1b22b31177 100644 --- a/include/mbgl/style/property_value.hpp +++ b/src/mbgl/style/property_value.hpp diff --git a/src/style/style.cpp b/src/mbgl/style/style.cpp index 9669e0e4a7..9669e0e4a7 100644 --- a/src/style/style.cpp +++ b/src/mbgl/style/style.cpp diff --git a/include/mbgl/style/style.hpp b/src/mbgl/style/style.hpp index 56f318ecbb..56f318ecbb 100644 --- a/include/mbgl/style/style.hpp +++ b/src/mbgl/style/style.hpp diff --git a/src/style/style_bucket.cpp b/src/mbgl/style/style_bucket.cpp index 9a40c2386b..9a40c2386b 100644 --- a/src/style/style_bucket.cpp +++ b/src/mbgl/style/style_bucket.cpp diff --git a/include/mbgl/style/style_bucket.hpp b/src/mbgl/style/style_bucket.hpp index d84d35d5b2..d84d35d5b2 100644 --- a/include/mbgl/style/style_bucket.hpp +++ b/src/mbgl/style/style_bucket.hpp diff --git a/src/style/style_layer.cpp b/src/mbgl/style/style_layer.cpp index e58756afa4..e58756afa4 100644 --- a/src/style/style_layer.cpp +++ b/src/mbgl/style/style_layer.cpp diff --git a/include/mbgl/style/style_layer.hpp b/src/mbgl/style/style_layer.hpp index 641dc1e71c..641dc1e71c 100644 --- a/include/mbgl/style/style_layer.hpp +++ b/src/mbgl/style/style_layer.hpp diff --git a/src/style/style_layer_group.cpp b/src/mbgl/style/style_layer_group.cpp index a731aebdcb..0ca0fa0cce 100644 --- a/src/style/style_layer_group.cpp +++ b/src/mbgl/style/style_layer_group.cpp @@ -1,4 +1,3 @@ - #include <mbgl/style/style_layer_group.hpp> namespace mbgl { diff --git a/include/mbgl/style/style_layer_group.hpp b/src/mbgl/style/style_layer_group.hpp index 1af6e23bd7..1af6e23bd7 100644 --- a/include/mbgl/style/style_layer_group.hpp +++ b/src/mbgl/style/style_layer_group.hpp diff --git a/src/style/style_parser.cpp b/src/mbgl/style/style_parser.cpp index 2dec648aff..2dec648aff 100644 --- a/src/style/style_parser.cpp +++ b/src/mbgl/style/style_parser.cpp diff --git a/include/mbgl/style/style_parser.hpp b/src/mbgl/style/style_parser.hpp index c37e856034..c37e856034 100644 --- a/include/mbgl/style/style_parser.hpp +++ b/src/mbgl/style/style_parser.hpp diff --git a/src/style/style_properties.cpp b/src/mbgl/style/style_properties.cpp index 29730fb85b..29730fb85b 100644 --- a/src/style/style_properties.cpp +++ b/src/mbgl/style/style_properties.cpp diff --git a/include/mbgl/style/style_properties.hpp b/src/mbgl/style/style_properties.hpp index c44b7c34c8..c44b7c34c8 100644 --- a/include/mbgl/style/style_properties.hpp +++ b/src/mbgl/style/style_properties.hpp diff --git a/src/style/style_source.cpp b/src/mbgl/style/style_source.cpp index f46a6fb09b..f46a6fb09b 100644 --- a/src/style/style_source.cpp +++ b/src/mbgl/style/style_source.cpp diff --git a/include/mbgl/style/style_source.hpp b/src/mbgl/style/style_source.hpp index 8c7d028880..8c7d028880 100644 --- a/include/mbgl/style/style_source.hpp +++ b/src/mbgl/style/style_source.hpp diff --git a/src/style/types.cpp b/src/mbgl/style/types.cpp index e69de29bb2..e69de29bb2 100644 --- a/src/style/types.cpp +++ b/src/mbgl/style/types.cpp diff --git a/include/mbgl/style/types.hpp b/src/mbgl/style/types.hpp index 2f7ca7683d..2f7ca7683d 100644 --- a/include/mbgl/style/types.hpp +++ b/src/mbgl/style/types.hpp diff --git a/src/style/value.cpp b/src/mbgl/style/value.cpp index bda9a089a8..ae51ce3783 100644 --- a/src/style/value.cpp +++ b/src/mbgl/style/value.cpp @@ -1,11 +1,5 @@ #include <mbgl/style/value.hpp> - -#pragma GCC diagnostic push -#ifndef __clang__ -#pragma GCC diagnostic ignored "-Wunused-local-typedefs" -#endif -#include <boost/lexical_cast.hpp> -#pragma GCC diagnostic pop +#include <mbgl/util/string.hpp> mbgl::Value mbgl::parseValue(pbf data) { while (data.next()) @@ -37,9 +31,9 @@ mbgl::Value mbgl::parseValue(pbf data) { std::string mbgl::toString(const mbgl::Value& value) { if (value.is<std::string>()) return value.get<std::string>(); else if (value.is<bool>()) return value.get<bool>() ? "true" : "false"; - else if (value.is<int64_t>()) return std::to_string(value.get<int64_t>()); - else if (value.is<uint64_t>()) return std::to_string(value.get<uint64_t>()); - else if (value.is<double>()) return boost::lexical_cast<std::string>(value.get<double>()); + else if (value.is<int64_t>()) return util::toString(value.get<int64_t>()); + else if (value.is<uint64_t>()) return util::toString(value.get<uint64_t>()); + else if (value.is<double>()) return util::toString(value.get<double>()); else return "null"; } diff --git a/include/mbgl/style/value.hpp b/src/mbgl/style/value.hpp index 87d6f4cda3..87d6f4cda3 100644 --- a/include/mbgl/style/value.hpp +++ b/src/mbgl/style/value.hpp diff --git a/include/mbgl/style/value_comparison.hpp b/src/mbgl/style/value_comparison.hpp index 98e29afa7c..895c8a0869 100644 --- a/include/mbgl/style/value_comparison.hpp +++ b/src/mbgl/style/value_comparison.hpp @@ -1,7 +1,7 @@ #ifndef MBGL_STYLE_VALUE_COMPARISON #define MBGL_STYLE_VALUE_COMPARISON -#include "value.hpp" +#include <mbgl/style/value.hpp> #include <cstdlib> #include <cerrno> diff --git a/src/text/collision.cpp b/src/mbgl/text/collision.cpp index 2e0ec6dce2..2e0ec6dce2 100644 --- a/src/text/collision.cpp +++ b/src/mbgl/text/collision.cpp diff --git a/include/mbgl/text/collision.hpp b/src/mbgl/text/collision.hpp index 3bf37a6a12..3bf37a6a12 100644 --- a/include/mbgl/text/collision.hpp +++ b/src/mbgl/text/collision.hpp diff --git a/src/text/glyph.cpp b/src/mbgl/text/glyph.cpp index f02c710db2..f02c710db2 100644 --- a/src/text/glyph.cpp +++ b/src/mbgl/text/glyph.cpp diff --git a/include/mbgl/text/glyph.hpp b/src/mbgl/text/glyph.hpp index 4fbb75fc1e..4fbb75fc1e 100644 --- a/include/mbgl/text/glyph.hpp +++ b/src/mbgl/text/glyph.hpp diff --git a/src/text/glyph_store.cpp b/src/mbgl/text/glyph_store.cpp index 8537ab5156..2f5db180fd 100644 --- a/src/text/glyph_store.cpp +++ b/src/mbgl/text/glyph_store.cpp @@ -143,7 +143,7 @@ GlyphPBF::GlyphPBF(const std::string &glyphURL, const std::string &fontStack, Gl // Load the glyph set URL std::string url = util::replaceTokens(glyphURL, [&](const std::string &name) -> std::string { if (name == "fontstack") return util::percentEncode(fontStack); - if (name == "range") return std::to_string(glyphRange.first) + "-" + std::to_string(glyphRange.second); + if (name == "range") return util::toString(glyphRange.first) + "-" + util::toString(glyphRange.second); return ""; }); @@ -153,7 +153,7 @@ GlyphPBF::GlyphPBF(const std::string &glyphURL, const std::string &fontStack, Gl request->onload([&, url](const Response &res) { if (res.code != 200) { // Something went wrong with loading the glyph pbf. Pass on the error to the future listeners. - const std::string msg = util::sprintf<255>("[ERROR] failed to load glyphs (%d): %s\n", res.code, res.message.c_str()); + const std::string msg = std::string { "[ERROR] failed to load glyphs (" } + util::toString(res.code) + "): " + res.message; promise.set_exception(std::make_exception_ptr(std::runtime_error(msg))); } else { // Transfer the data to the GlyphSet and signal its availability. diff --git a/include/mbgl/text/glyph_store.hpp b/src/mbgl/text/glyph_store.hpp index 95ab92f307..95ab92f307 100644 --- a/include/mbgl/text/glyph_store.hpp +++ b/src/mbgl/text/glyph_store.hpp diff --git a/src/text/placement.cpp b/src/mbgl/text/placement.cpp index 84d4e20b2f..84d4e20b2f 100644 --- a/src/text/placement.cpp +++ b/src/mbgl/text/placement.cpp diff --git a/include/mbgl/text/placement.hpp b/src/mbgl/text/placement.hpp index 28eb8d5317..28eb8d5317 100644 --- a/include/mbgl/text/placement.hpp +++ b/src/mbgl/text/placement.hpp diff --git a/src/text/rotation_range.cpp b/src/mbgl/text/rotation_range.cpp index 664ea9c709..664ea9c709 100644 --- a/src/text/rotation_range.cpp +++ b/src/mbgl/text/rotation_range.cpp diff --git a/include/mbgl/text/rotation_range.hpp b/src/mbgl/text/rotation_range.hpp index 4968fda164..4968fda164 100644 --- a/include/mbgl/text/rotation_range.hpp +++ b/src/mbgl/text/rotation_range.hpp diff --git a/include/mbgl/text/types.hpp b/src/mbgl/text/types.hpp index 23f49aa748..23f49aa748 100644 --- a/include/mbgl/text/types.hpp +++ b/src/mbgl/text/types.hpp diff --git a/src/mbgl/util/box.hpp b/src/mbgl/util/box.hpp new file mode 100644 index 0000000000..55a5d46fbc --- /dev/null +++ b/src/mbgl/util/box.hpp @@ -0,0 +1,15 @@ +#ifndef MBGL_UTIL_BOX +#define MBGL_UTIL_BOX + +#include <mbgl/util/vec.hpp> + +namespace mbgl { + +struct box { + vec2<double> tl, tr, bl, br; + vec2<double> center; +}; + +} + +#endif diff --git a/src/util/clip_ids.cpp b/src/mbgl/util/clip_ids.cpp index 9c391c38ad..9c391c38ad 100644 --- a/src/util/clip_ids.cpp +++ b/src/mbgl/util/clip_ids.cpp diff --git a/include/mbgl/util/clip_ids.hpp b/src/mbgl/util/clip_ids.hpp index 5855b16af7..5855b16af7 100644 --- a/include/mbgl/util/clip_ids.hpp +++ b/src/mbgl/util/clip_ids.hpp diff --git a/src/util/compression.cpp b/src/mbgl/util/compression.cpp index d6d6370546..d6d6370546 100644 --- a/src/util/compression.cpp +++ b/src/mbgl/util/compression.cpp diff --git a/include/mbgl/util/compression.hpp b/src/mbgl/util/compression.hpp index a33b2476a7..a33b2476a7 100644 --- a/include/mbgl/util/compression.hpp +++ b/src/mbgl/util/compression.hpp diff --git a/config/constants.cpp b/src/mbgl/util/constants.cpp index 3d1422e6c7..3d1422e6c7 100644 --- a/config/constants.cpp +++ b/src/mbgl/util/constants.cpp diff --git a/include/mbgl/util/constants.hpp b/src/mbgl/util/constants.hpp index 89e8af2ef1..98365e0f32 100644 --- a/include/mbgl/util/constants.hpp +++ b/src/mbgl/util/constants.hpp @@ -3,8 +3,6 @@ #include <cmath> -#include "vec.hpp" - namespace mbgl { namespace util { diff --git a/include/mbgl/util/error.hpp b/src/mbgl/util/error.hpp index 09fa8d3e21..09fa8d3e21 100644 --- a/include/mbgl/util/error.hpp +++ b/src/mbgl/util/error.hpp diff --git a/include/mbgl/util/interpolate.hpp b/src/mbgl/util/interpolate.hpp index c9232db4eb..c9232db4eb 100644 --- a/include/mbgl/util/interpolate.hpp +++ b/src/mbgl/util/interpolate.hpp diff --git a/src/util/io.cpp b/src/mbgl/util/io.cpp index 76f7c35ade..76f7c35ade 100644 --- a/src/util/io.cpp +++ b/src/mbgl/util/io.cpp diff --git a/include/mbgl/util/io.hpp b/src/mbgl/util/io.hpp index e95fc16d9d..e95fc16d9d 100644 --- a/include/mbgl/util/io.hpp +++ b/src/mbgl/util/io.hpp diff --git a/src/util/mapbox.cpp b/src/mbgl/util/mapbox.cpp index 277b647f34..277b647f34 100644 --- a/src/util/mapbox.cpp +++ b/src/mbgl/util/mapbox.cpp diff --git a/include/mbgl/util/mapbox.hpp b/src/mbgl/util/mapbox.hpp index 0fbb9a91ed..0fbb9a91ed 100644 --- a/include/mbgl/util/mapbox.hpp +++ b/src/mbgl/util/mapbox.hpp diff --git a/src/util/mat3.cpp b/src/mbgl/util/mat3.cpp index 263768ee41..263768ee41 100644 --- a/src/util/mat3.cpp +++ b/src/mbgl/util/mat3.cpp diff --git a/include/mbgl/util/mat3.hpp b/src/mbgl/util/mat3.hpp index fa40751764..fa40751764 100644 --- a/include/mbgl/util/mat3.hpp +++ b/src/mbgl/util/mat3.hpp diff --git a/src/util/mat4.cpp b/src/mbgl/util/mat4.cpp index 50270d9217..50270d9217 100644 --- a/src/util/mat4.cpp +++ b/src/mbgl/util/mat4.cpp diff --git a/src/util/math.cpp b/src/mbgl/util/math.cpp index a7eab2d771..a7eab2d771 100644 --- a/src/util/math.cpp +++ b/src/mbgl/util/math.cpp diff --git a/include/mbgl/util/optional.hpp b/src/mbgl/util/optional.hpp index 133e2c8f97..8d46eae857 100644 --- a/include/mbgl/util/optional.hpp +++ b/src/mbgl/util/optional.hpp @@ -3,7 +3,7 @@ #include <type_traits> -#include "variant.hpp" +#include <mbgl/util/variant.hpp> namespace mapbox { diff --git a/src/util/parsedate.c b/src/mbgl/util/parsedate.c index f888def853..f888def853 100644 --- a/src/util/parsedate.c +++ b/src/mbgl/util/parsedate.c diff --git a/include/mbgl/util/pbf.hpp b/src/mbgl/util/pbf.hpp index d017219a52..d017219a52 100644 --- a/include/mbgl/util/pbf.hpp +++ b/src/mbgl/util/pbf.hpp diff --git a/include/mbgl/util/queue.h b/src/mbgl/util/queue.h index fe02b454ea..fe02b454ea 100644 --- a/include/mbgl/util/queue.h +++ b/src/mbgl/util/queue.h diff --git a/src/util/raster.cpp b/src/mbgl/util/raster.cpp index 56461aec5f..56461aec5f 100644 --- a/src/util/raster.cpp +++ b/src/mbgl/util/raster.cpp diff --git a/include/mbgl/util/raster.hpp b/src/mbgl/util/raster.hpp index ff27f509f4..ff27f509f4 100644 --- a/include/mbgl/util/raster.hpp +++ b/src/mbgl/util/raster.hpp diff --git a/include/mbgl/util/rect.hpp b/src/mbgl/util/rect.hpp index f5c77f93d1..f5c77f93d1 100644 --- a/include/mbgl/util/rect.hpp +++ b/src/mbgl/util/rect.hpp diff --git a/src/util/sqlite3.cpp b/src/mbgl/util/sqlite3.cpp index 787db83992..787db83992 100644 --- a/src/util/sqlite3.cpp +++ b/src/mbgl/util/sqlite3.cpp diff --git a/include/mbgl/util/sqlite3.hpp b/src/mbgl/util/sqlite3.hpp index 3e324f7ce1..3e324f7ce1 100644 --- a/include/mbgl/util/sqlite3.hpp +++ b/src/mbgl/util/sqlite3.hpp diff --git a/src/util/stopwatch.cpp b/src/mbgl/util/stopwatch.cpp index c9b8756e3b..14b4f4018b 100644 --- a/src/util/stopwatch.cpp +++ b/src/mbgl/util/stopwatch.cpp @@ -1,6 +1,7 @@ #ifndef DISABLE_STOPWATCH #include <mbgl/util/stopwatch.hpp> #include <mbgl/util/time.hpp> +#include <mbgl/util/string.hpp> #include <mbgl/platform/log.hpp> #include <iostream> @@ -23,7 +24,7 @@ stopwatch::stopwatch(const std::string &name_, EventSeverity severity_, Event ev void stopwatch::report(const std::string &name_) { timestamp duration = now() - start; - Log::Record(severity, event, name_ + ": " + std::to_string((double)(duration) / 1_millisecond) + "ms"); + Log::Record(severity, event, name_ + ": " + util::toString(double(duration) / 1_millisecond) + "ms"); start += duration; } diff --git a/include/mbgl/util/stopwatch.hpp b/src/mbgl/util/stopwatch.hpp index 663bbb6fc7..663bbb6fc7 100644 --- a/include/mbgl/util/stopwatch.hpp +++ b/src/mbgl/util/stopwatch.hpp diff --git a/src/util/texture_pool.cpp b/src/mbgl/util/texture_pool.cpp index 9c8c24b085..9c8c24b085 100644 --- a/src/util/texture_pool.cpp +++ b/src/mbgl/util/texture_pool.cpp diff --git a/include/mbgl/util/texture_pool.hpp b/src/mbgl/util/texture_pool.hpp index 95d918c237..95d918c237 100644 --- a/include/mbgl/util/texture_pool.hpp +++ b/src/mbgl/util/texture_pool.hpp diff --git a/src/util/time.cpp b/src/mbgl/util/time.cpp index 1953975b18..1953975b18 100644 --- a/src/util/time.cpp +++ b/src/mbgl/util/time.cpp diff --git a/include/mbgl/util/token.hpp b/src/mbgl/util/token.hpp index 64192a99f9..64192a99f9 100644 --- a/include/mbgl/util/token.hpp +++ b/src/mbgl/util/token.hpp diff --git a/src/util/transition.cpp b/src/mbgl/util/transition.cpp index e63a5c311f..e63a5c311f 100644 --- a/src/util/transition.cpp +++ b/src/mbgl/util/transition.cpp diff --git a/include/mbgl/util/transition.hpp b/src/mbgl/util/transition.hpp index b78abfa8fd..d6bbc9eba0 100644 --- a/include/mbgl/util/transition.hpp +++ b/src/mbgl/util/transition.hpp @@ -3,7 +3,6 @@ #include <mbgl/util/noncopyable.hpp> #include <mbgl/util/time.hpp> -#include <mbgl/style/types.hpp> namespace mbgl { namespace util { diff --git a/include/mbgl/util/unitbezier.hpp b/src/mbgl/util/unitbezier.hpp index 095e15f809..095e15f809 100644 --- a/include/mbgl/util/unitbezier.hpp +++ b/src/mbgl/util/unitbezier.hpp diff --git a/src/util/url.cpp b/src/mbgl/util/url.cpp index e9b9672109..e9b9672109 100644 --- a/src/util/url.cpp +++ b/src/mbgl/util/url.cpp diff --git a/include/mbgl/util/url.hpp b/src/mbgl/util/url.hpp index a7e5291ec5..a7e5291ec5 100644 --- a/include/mbgl/util/url.hpp +++ b/src/mbgl/util/url.hpp diff --git a/src/mbgl/util/utf.hpp b/src/mbgl/util/utf.hpp new file mode 100644 index 0000000000..d6ba2a1f2f --- /dev/null +++ b/src/mbgl/util/utf.hpp @@ -0,0 +1,24 @@ +#ifndef MBGL_UTIL_UTF +#define MBGL_UTIL_UTF + +#include <memory> + +#include <boost/regex/pending/unicode_iterator.hpp> + +namespace mbgl { + +namespace util { + +class utf8_to_utf32 { + public: + static std::u32string convert(std::string const& utf8) + { + boost::u8_to_u32_iterator<std::string::const_iterator> begin(utf8.begin()); + boost::u8_to_u32_iterator<std::string::const_iterator> end(utf8.end()); + return std::u32string(begin,end); + } +}; + +}} + +#endif diff --git a/src/util/uv-channel.c b/src/mbgl/util/uv-channel.c index 4e3b9fa5ff..4e3b9fa5ff 100644 --- a/src/util/uv-channel.c +++ b/src/mbgl/util/uv-channel.c diff --git a/include/mbgl/util/uv-channel.h b/src/mbgl/util/uv-channel.h index ea5c279f65..ea5c279f65 100644 --- a/include/mbgl/util/uv-channel.h +++ b/src/mbgl/util/uv-channel.h diff --git a/src/util/uv-messenger.c b/src/mbgl/util/uv-messenger.c index 935b6f1c41..935b6f1c41 100644 --- a/src/util/uv-messenger.c +++ b/src/mbgl/util/uv-messenger.c diff --git a/src/util/uv-worker.c b/src/mbgl/util/uv-worker.c index d2aa908019..d2aa908019 100644 --- a/src/util/uv-worker.c +++ b/src/mbgl/util/uv-worker.c diff --git a/include/mbgl/util/uv-worker.h b/src/mbgl/util/uv-worker.h index cb2075d1c3..cb2075d1c3 100644 --- a/include/mbgl/util/uv-worker.h +++ b/src/mbgl/util/uv-worker.h diff --git a/src/util/uv.cpp b/src/mbgl/util/uv.cpp index 7aa5bad0cf..7aa5bad0cf 100644 --- a/src/util/uv.cpp +++ b/src/mbgl/util/uv.cpp diff --git a/include/mbgl/util/uv_detail.hpp b/src/mbgl/util/uv_detail.hpp index 99f5edc145..99f5edc145 100644 --- a/include/mbgl/util/uv_detail.hpp +++ b/src/mbgl/util/uv_detail.hpp diff --git a/include/rapidjson/document.h b/src/rapidjson/document.h index 83d95a33d0..83d95a33d0 100755 --- a/include/rapidjson/document.h +++ b/src/rapidjson/document.h diff --git a/include/rapidjson/filestream.h b/src/rapidjson/filestream.h index 885894963f..885894963f 100755 --- a/include/rapidjson/filestream.h +++ b/src/rapidjson/filestream.h diff --git a/include/rapidjson/internal/pow10.h b/src/rapidjson/internal/pow10.h index bf3a9afb04..bf3a9afb04 100755 --- a/include/rapidjson/internal/pow10.h +++ b/src/rapidjson/internal/pow10.h diff --git a/include/rapidjson/internal/stack.h b/src/rapidjson/internal/stack.h index 966893b3fc..966893b3fc 100755 --- a/include/rapidjson/internal/stack.h +++ b/src/rapidjson/internal/stack.h diff --git a/include/rapidjson/internal/strfunc.h b/src/rapidjson/internal/strfunc.h index bbf444fe6d..bbf444fe6d 100755 --- a/include/rapidjson/internal/strfunc.h +++ b/src/rapidjson/internal/strfunc.h diff --git a/include/rapidjson/prettywriter.h b/src/rapidjson/prettywriter.h index 238ff5ff62..238ff5ff62 100755 --- a/include/rapidjson/prettywriter.h +++ b/src/rapidjson/prettywriter.h diff --git a/include/rapidjson/rapidjson.h b/src/rapidjson/rapidjson.h index 7acb2aa4fd..7acb2aa4fd 100755 --- a/include/rapidjson/rapidjson.h +++ b/src/rapidjson/rapidjson.h diff --git a/include/rapidjson/reader.h b/src/rapidjson/reader.h index 16d672633b..16d672633b 100755 --- a/include/rapidjson/reader.h +++ b/src/rapidjson/reader.h diff --git a/include/rapidjson/stringbuffer.h b/src/rapidjson/stringbuffer.h index 269ae10761..269ae10761 100755 --- a/include/rapidjson/stringbuffer.h +++ b/src/rapidjson/stringbuffer.h diff --git a/include/rapidjson/writer.h b/src/rapidjson/writer.h index d96f2081a9..d96f2081a9 100755 --- a/include/rapidjson/writer.h +++ b/src/rapidjson/writer.h diff --git a/test/headless.cpp b/test/headless.cpp index 29db9500d4..1c583a9c07 100644 --- a/test/headless.cpp +++ b/test/headless.cpp @@ -2,16 +2,16 @@ #include <mbgl/map/map.hpp> #include <mbgl/util/image.hpp> -#include <mbgl/util/io.hpp> #include <mbgl/util/std.hpp> +#include <mbgl/util/io.hpp> #include <rapidjson/document.h> #include <rapidjson/writer.h> #include <rapidjson/stringbuffer.h> #include <mbgl/platform/default/headless_view.hpp> #include <mbgl/platform/default/headless_display.hpp> -#include <mbgl/platform/default/caching_http_file_source.hpp> +#include <mbgl/storage/caching_http_file_source.hpp> #include "./fixtures/fixture_log.hpp" diff --git a/test/test.gyp b/test/test.gyp index 86dbcc08a5..5aec5ac3ac 100644 --- a/test/test.gyp +++ b/test/test.gyp @@ -23,6 +23,7 @@ '../deps/gtest/gtest.gyp:gtest', '../mapboxgl.gyp:mbgl-standalone', ], + 'include_dirs': [ '../src' ], 'conditions': [ ['OS == "mac"', { 'xcode_settings': { 'OTHER_LDFLAGS': [ '<@(ldflags)' ] } }, { @@ -41,6 +42,7 @@ '../deps/gtest/gtest.gyp:gtest', '../mapboxgl.gyp:mbgl-standalone', ], + 'include_dirs': [ '../src' ], 'conditions': [ ['OS == "mac"', { 'xcode_settings': { 'OTHER_LDFLAGS': [ '<@(ldflags)'] } }, { @@ -59,6 +61,7 @@ '../deps/gtest/gtest.gyp:gtest', '../mapboxgl.gyp:mbgl-standalone', ], + 'include_dirs': [ '../src' ], 'conditions': [ ['OS == "mac"', { 'xcode_settings': { 'OTHER_LDFLAGS': [ '<@(ldflags)'] } }, { @@ -79,6 +82,7 @@ '../deps/gtest/gtest.gyp:gtest', '../mapboxgl.gyp:mbgl-standalone' ], + 'include_dirs': [ '../src' ], 'conditions': [ ['OS == "mac"', { 'xcode_settings': { 'OTHER_LDFLAGS': [ '<@(ldflags)' ] } }, { @@ -97,6 +101,7 @@ '../deps/gtest/gtest.gyp:gtest', '../mapboxgl.gyp:mbgl-standalone', ], + 'include_dirs': [ '../src' ], 'conditions': [ ['OS == "mac"', { 'xcode_settings': { 'OTHER_LDFLAGS': [ '<@(ldflags)' ] } }, { @@ -115,6 +120,7 @@ '../deps/gtest/gtest.gyp:gtest', '../mapboxgl.gyp:mbgl-standalone', ], + 'include_dirs': [ '../src' ], 'conditions': [ ['OS == "mac"', { 'xcode_settings': { 'OTHER_LDFLAGS': [ '<@(ldflags)' ] } }, { @@ -133,6 +139,7 @@ '../deps/gtest/gtest.gyp:gtest', '../mapboxgl.gyp:mbgl-standalone', ], + 'include_dirs': [ '../src' ], 'conditions': [ ['OS == "mac"', { 'xcode_settings': { 'OTHER_LDFLAGS': [ '<@(ldflags)' ] } }, { @@ -151,6 +158,7 @@ '../deps/gtest/gtest.gyp:gtest', '../mapboxgl.gyp:mbgl-standalone', ], + 'include_dirs': [ '../src' ], 'conditions': [ ['OS == "mac"', { 'xcode_settings': { 'OTHER_LDFLAGS': [ '<@(ldflags)' ] } }, { @@ -184,7 +192,8 @@ '../mapboxgl.gyp:mbgl-standalone', '../mapboxgl.gyp:mbgl-headless', '<(platform_library)', - ] + ], + 'include_dirs': [ '../src' ] }, { 'target_name': 'text_conversions', 'product_name': 'test_text_conversions', @@ -198,6 +207,7 @@ '../mapboxgl.gyp:mbgl-standalone', '<(platform_library)', ], + 'include_dirs': [ '../src' ], 'variables': { 'cflags_cc': [ '-I<(boost_root)/include', |