Commit Graph

3013 Commits

Author SHA1 Message Date
Anand Thakker
0abaae23b6 Small edit to improve code resiliency (#8540)
h/t @ChrisLoer catching this place where we were relying on member
initialization order.  While it _happened_ to be okay here, it's
unnecessarily fragile.
2017-03-28 07:41:03 -04:00
Bruno de Oliveira Abinader
80915992ab [core] Added Map::latLngBoundsForCamera 2017-03-24 13:51:35 +02:00
Konstantin Käfer
e67abfbe67 [core] Refactor OpenGL extension loading mechanism
Previously, we initialized global variables that held pointers to the extension functions. While this seemed to work, the spec doesn't guarantee that the function pointers are identical for different OpenGL contexts. Therefore, we are now making them a member variable of the Context object.
2017-03-23 14:50:11 -07:00
Konstantin Käfer
234384ece9 [core] Move OpenGL extension initialization to Backend 2017-03-23 14:50:11 -07:00
Konstantin Käfer
8e5214144e [core] Ensure that a BackendScope exists when doing GL calls 2017-03-23 14:50:11 -07:00
John Firebaugh
d7227e13a7 [all] Replace Result<T> with optional<T> plus out Error parameter 2017-03-23 13:31:13 -07:00
Chris Loer
a3f40d0c0c Verbose commenting on getSegmentGlyphs (#8361)
* Verbose commenting on getSegmentGlyphs
 This came out of @cloer and @anandthakker trying to figure out
 how getSegmentGlyphs actually worked.
 Goal is to use this commented version as the base for a refactor.

* Refactor getSegmentGlyphs for clarity.

* Add more documentation, inline helper functions

* Initialize VirtualSegments directly

* Fix virtual anchor diagram
2017-03-22 17:27:06 -04:00
Konstantin Käfer
3c91b6b7de [core] cache binary shaders on Android 2017-03-22 15:59:10 +01:00
John Firebaugh
e488ca702e Merge branch 'release-ios-v3.5.0-android-v5.0.0' 2017-03-21 12:04:20 -07:00
Bruno de Oliveira Abinader
1f8910de18 Make Source::getZoomRange return an optional range 2017-03-21 19:33:36 +02:00
John Firebaugh
86cddaf751 [core] Remove unnecessary unordered_map includes 2017-03-21 09:27:22 -07:00
John Firebaugh
c16bd14416 [core] Prefer std::map to std::unordered_map for smaller binary size 2017-03-21 09:27:22 -07:00
Bruno de Oliveira Abinader
c1a410be8b [core] s/onSourceDidChange/onSourceChanged/ + source ref 2017-03-21 17:36:56 +02:00
Bruno de Oliveira Abinader
24198ebca8 [core] Expose Source::getZoomRange 2017-03-20 18:25:04 +02:00
John Firebaugh
8552d6312b [core] Use core wagyu algorithm; move results into GeometryCollection 2017-03-17 08:28:51 -07:00
Blake Thompson
fb37f5e543 Added wagyu and removed angus clipper 2017-03-17 08:28:51 -07:00
John Firebaugh
ff413f6b99 [core] Fix overspecialization of PaintPropertyBinder template
PaintPropertyBinder and subclass templates were being instantiated for every unique attribute type (e.g. a_color, a_fill_color, a_halo_color) even though they behave identically for a given property value type (e.g. Color). To fix this, a unique type such as a_color no longer derives from gl::Attribute<...> -- instead it has an inner Type typedef, which should be used wherever neither a unique type nor attribute name is required. This reduces binary size substantially:

     VM SIZE                               FILE SIZE
 ++++++++++++++ GROWING                 ++++++++++++++

 -------------- SHRINKING               --------------
  -2.0% -49.3Ki __TEXT,__text           -49.3Ki  -2.0%
  -3.1% -5.21Ki [None]                  -2.79Ki  -1.6%
  -2.1% -4.12Ki __TEXT,__const          -4.12Ki  -2.1%
  -1.4% -4.04Ki __TEXT,__gcc_except_tab -4.04Ki  -1.4%
 -19.3% -3.62Ki __DATA,__data           -3.62Ki -19.3%
  -2.5% -1.65Ki __TEXT,__unwind_info    -1.65Ki  -2.5%
  -4.2%      -8 __DATA,__mod_init_func        0  [ = ]

  -1.9% -68.0Ki TOTAL                   -65.6Ki  -1.9%
2017-03-17 08:27:53 -07:00
John Firebaugh
0dca6cd9bf [core] Don't need to use normalized attributes anymore 2017-03-17 08:27:53 -07:00
Bruno de Oliveira Abinader
5ff4110243 [core] Pass std::exception_ptr in MapObserver::onDidFailLoadingMap 2017-03-17 11:25:48 +02:00
Bruno de Oliveira Abinader
e10e37bc20 [core] Pass std::exception_ptr in style::Observer::onStyleError 2017-03-17 11:25:48 +02:00
Justin R. Miller
aae11a3430 [core] fixes #8433: don't skip style recalculations for fade-from-zero transitions (#8440) 2017-03-16 16:23:15 -07:00
Anand Thakker
458de43b9e Increase precision of shader variable (#8423)
Fixes #7599
2017-03-15 15:02:02 -04:00
John Firebaugh
af3898d980 [core] Avoid copy construction of PaintPropertyBinders 2017-03-15 11:43:42 -07:00
John Firebaugh
cee26ee3c8 [core] Replace variant with polymorphic PaintPropertyBinder class 2017-03-15 11:43:42 -07:00
John Firebaugh
841da960bc [node] Work around a link error on macOS release builds (#8409) 2017-03-15 08:39:21 -07:00
Bruno de Oliveira Abinader
fc70cbf1e1 [core] Replace MapChange enum with MapObserver 2017-03-15 14:53:32 +02:00
Ivo van Dongen
7a13bee72e [core] don’t query rendered features until all data is available 2017-03-14 13:28:32 -07:00
John Firebaugh
bd05bcfe9f [core] Never join coincident start/end points of LineStrings 2017-03-14 09:31:59 -07:00
Ivo van Dongen
96a53156c2 [core] don’t query rendered features until all data is available 2017-03-14 17:27:59 +02:00
Thiago Marcos P. Santos
a0da2fb5d1 [build] Fix build when using a Z_PREFIX zlib
It will redefine mbgl::util::compress to mbgl::util::z_compress and
cause a link error. Aka pre-processor hell.
2017-03-14 11:18:55 +02:00
Fabian Guerra Soto
20712b7c84 Per-attribute transition properties on MGLStyleLayer (#8225)
* [ios, macos] new struct MGLTransition

* [ios] MGLTransition struct moved to MGLTypes.h

* [ios] MGLTransition implemented for style layer properties

* [ios, macos] added support for getting property transitions

* [ios, macos] updated to MGLDurationFromTimeInterval and MGLTimeIntervalFromDuration

* [ios, macos] added transition properties test

* [ios, macos] modified key strings imp

* [ios, macos] The impl for transition properties were changed to public methods

* [ios, macos] Changelog update

* [ios] Fixed layer space formatting

* [core] The name space was fixed for getters that returned TransitionOptions

* [ios, macos] Added rawLayer transition property tests

* [ios] Added a factory method for MGLTransition and transition-related methods to NSValue(MGLAdditions)

* [ios, macos] Copyedited changelog blurbs about transition properties
2017-03-10 11:33:31 -08:00
Ivo van Dongen
517659b1b4 [core] query source features 2017-03-10 11:08:32 -08:00
Ivo van Dongen
4d325879b8 [core] rename query options for query rendered features 2017-03-10 11:08:32 -08:00
Ivo van Dongen
0d10d2df1c [core] query source features 2017-03-09 13:11:23 -08:00
Ivo van Dongen
548675a196 [core] rename query options for query rendered features 2017-03-09 13:11:23 -08:00
John Firebaugh
d5c2920104 [core] Extract and de-templatize several Program static methods 2017-03-09 10:32:34 -08:00
John Firebaugh
af75736857 [core] Avoid unnecessary convert template instantiations 2017-03-09 10:31:21 -08:00
Molly Lloyd
692f5e0a9f Pack min + max into one attribute 💪
Some devices supported by Mapbox GL provide only 8 vertex attributes; this change packs existing attributes to get us just under that limit.

For properties using a composite function, pack the min and max values into a single attribute with two logical components instead of using two separate attributes and buffers. Special logic is included for color attributes, whose integer components must be packed into the available bits of floating-point attributes. (We don't have access to ivec types in GL ES 2.0.)

For source functions, continue to bind just a one-component attribute even though the GLSL type is vec2 (or vec4 for colors). The type-checking done by gl::Attribute is relaxed slightly to accommodate this.
2017-03-08 15:23:25 -08:00
John Firebaugh
b83b14feb0 [core] De-duplicate shader prelude source 2017-03-08 13:49:24 -08:00
Anand Thakker
bb846fd6cd For data-driven paint setters, transition immediately to target value (#8306)
Closes #8237
2017-03-08 11:53:44 -05:00
Ivo van Dongen
0da6d8a646 [core] clear source when removed from style 2017-03-06 18:04:22 -08:00
Asheem Mamoowala
60d10dd27d [core] Add support for queryRenderedFeatures filter 2017-03-04 15:42:07 -08:00
John Firebaugh
e1c85e8ec3 [core] const-correction 2017-03-02 14:36:30 -08:00
John Firebaugh
a7b7f3d442 [core] Fix whitespace; no need for explicit on multi-parameter constructors 2017-03-02 14:36:30 -08:00
Konstantin Käfer
0c3521d46c [core] privatize OffscreenTexture implementation 2017-03-01 17:25:22 -08:00
Anand Thakker
f901e776b3 [core] Implement data-driven styling for {text,icon}-{color,opacity,halo-color,halo-blur,halo-width} (#7939)
* Add symbol dds attributes and adapt style code generation

* Update to mapbox-gl-js/master

* Refactor SymbolFeature as a subclass of GeometryTileFeature

Prepares for enabling DDS on symbol paint properties by allowing the
SymbolFeatures, which we keep around after constructing SymbolLayout,
to be used in evaluating data-driven paint properties later in the
layout process.

* Draft approach for splitting icon/text paint properties

The `Program` types are set up to bind GL attributes to each of the
data-driven paint properties specified in the `PaintProperties` type
provided.  Since `SymbolPaintProperties` specifies both `Text*` and
`Icon*` properties, the symbolIcon, symbolIconSDF, and symbolGlyph
programs each attempt to bind roughly double the number of attributes
that they actually need.

This change addresses this by:
- Adding the more specific `IconPaintProperties` and `TextPaintProperties` types, which are subsets of the full `SymbolPaintProperties`.
- The symbol layer continues to use its `SymbolPaintProperties paint` member to track layer property state, but it provides helpers that construct objects of each the specific `{Icon,Text}PaintProperties::Evaluated` type, for use by the painter.
- The three symbol programs instantiate `Program<>` using the appropriate `{Icon,Text}PaintProperties` type.

* check in generated style code

* Populate paint buffers for symbol DDS properties

* Address first round of review comments

* Refactor VectorTile{Layer,Feature} to explicitly share data

* Update submodule
2017-02-28 19:54:24 -08:00
Konstantin Käfer
c3ed1f51ca [core] remove gl.hpp include from shader headers 2017-02-28 18:28:41 -08:00
John Firebaugh
e18f60229e [core] There's only ever one icon quad 2017-02-28 13:59:14 -08:00
John Firebaugh
02d56488e4 [core] Eliminate Shaping::text
This was already accessible via SymbolFeature::text.
2017-02-28 13:59:14 -08:00
John Firebaugh
0d741b3439 [core] Release compareText after symbol preparation
It's a temporary structure and not needed for placement.
2017-02-28 13:59:14 -08:00