Commit Graph

2989 Commits

Author SHA1 Message Date
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
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
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
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
Tobrun
34fef22d95 [core] [android] - allow zooming/scaling to use AnimationOptions (#8181)
[glfw] - allow glfw binding to use AnimationOptions instead of using direction directly
2017-02-28 13:22:47 -05:00
John Firebaugh
e3500c1f79 [core] Replace three maps/mutexes in GlyphAtlas with a single map and mutex 2017-02-27 16:19:35 -08:00
Thiago Marcos P. Santos
86300ccedf [core] Add pause/resume to the Thread class
Make a thread completely halt and not process any message on
the message queue until resume() is called.

Sending a sync message to a halted thread will result on
a deadlock, thus the assertion.

Deleting a paused thread will trigger a resume.
2017-02-25 14:03:38 +02:00
Jesse Bounds
c0718a863d [core, ios, macos] Return null when removing nonexistent source 2017-02-23 15:07:43 -08:00
Eimantas Vaiciunas
76b3825360 [core] Return null when removing nonexistent layer
In case of exception, silently ignore removal of nonexistent layer
and return nullptr
2017-02-23 15:07:43 -08:00
Konstantin Käfer
9ffbfdc7b9 [core] don't treat empty raster tiles as "DataAvailability::All" 2017-02-22 22:28:29 +01:00
Bruno de Oliveira Abinader
0562bcb418 [core] Use std::call_once to report about missing VAOs 2017-02-22 20:04:37 +02:00
Tobrun
a0992f0550 [core] - allow moveBy to use AnimationOptions
[android] - update jni bindings for moveBy with an interpolator
2017-02-20 16:52:18 -08:00
John Firebaugh
7d3c9338c9 [core] Link BackendScopes in a list for additional assertions 2017-02-20 12:04:21 -08:00
John Firebaugh
694159c49e [core] Nestable BackendScope 2017-02-20 12:04:21 -08:00
John Firebaugh
4e752f63b9 [core] Redo approach to unsupported VAO extension 2017-02-20 08:24:42 -08:00
Jesse Bounds
9924535415 [core] Render a circle if either the color or stroke color are visible
This updates the circle paint check to pass if the circle stroke is
visible but:

* The circle color is clear
* The circle is transparent
* The circle has a radius of 0

Previously, a transparent circle or a circle with a radius of 0 would
cause the layer to be passed up even if the circle stroke color had a
non zero alpha.
2017-02-17 14:36:36 -08:00
Anand Thakker
062b18374d [core] Enable property functions for text-{field,transform} (#7944) 2017-02-17 13:16:25 -08:00
John Firebaugh
8f1c580ea1 [core] Fix aliased text on mobile GPUs
Need highp precision for gamma values on mobile devices. lowp triggers aliasing artifacts at larger font sizes.

Note that this change is a hand-edit to the generated shader sources, rather than pulling https://github.com/mapbox/mapbox-gl-js/pull/4275 and running the generator script. The reason for that is that the upstream shader now assumes support for DDS properties that gl-native does not yet support. Once that support lands in gl-native, we can regenerate the shader source.
2017-02-15 11:22:41 -06:00
John Firebaugh
0351e9c370 [core] Eliminate SpritePatternMode 2017-02-14 16:28:12 -06:00
John Firebaugh
b18a4d6e78 [core] Mutex no longer needs to be recursive 2017-02-14 16:28:12 -06:00
John Firebaugh
d819ece74c [core] Combine SpriteAtlas::getPosition with SpriteAtlas::getImage 2017-02-14 16:28:12 -06:00
John Firebaugh
58de1e15c5 [core] Inline SpriteAtlas::allocateImage 2017-02-14 16:28:12 -06:00
John Firebaugh
5524506abd [core] Eliminate SpriteAtlas::updateDirty
Simplify internal datastructures. Properly remove rects from the bin pack when an image is removed.
2017-02-14 16:28:12 -06:00
John Firebaugh
3fa6a4f4ff [core] Eliminate SpriteAtlas::Holder 2017-02-14 16:28:12 -06:00
John Firebaugh
94f011895c [core] Make Image safer
Provide Image::copy, which handles copying rectangles from a source to a destination, with thorough bounds checking.

Also fixes an indexing error in SpriteAtlas, where the top row of pixels in a wrapped image was copied from the wrong source row.
2017-02-14 12:29:01 -06:00
Jason Wray
4c311a0091 [core] Expose Map::setZoom with anchor parameter 2017-02-13 18:35:04 -05:00
Konstantin Käfer
f97e36acc8 [core] add tests for user/password, port, trailing dot, and IPv4/IPv6 address parsing 2017-02-13 17:23:20 +01:00
Minh Nguyễn
e6c15d0f6f Upright CJK characters in vertically-oriented labels (#7114)
CJK characters and adjacent punctuation now remain upright in vertically oriented labels that have line placement.

Fixes #1682.
2017-02-10 18:57:48 -06:00