Commit Graph

2968 Commits

Author SHA1 Message Date
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
John Firebaugh
0bbc6b814c [core] Restore support for GL implementations without VAO extension 2017-02-10 18:04:45 -06:00
John Firebaugh
a1a639120d [core] Introduce dedicated filter types for $type and $id special cases (#7971)
* [core] Introduce dedicated filter types for $type and $id special cases

* [ios, macos] Special-case $id, $type in predicates

Also support $id ≟ nil.
2017-02-09 14:18:57 -08:00
John Firebaugh
b6e5edc268 [core] Restore support for *-transition properties 2017-02-09 15:08:51 -06:00
John Firebaugh
f35ca0d9df [core, ios, macos] Refactor composite stop types and conversions 2017-02-09 11:16:26 -06:00
Dane Springmeyer
13e5041553 compare polygon ring areas absolutely
- This ensures we actually keep the largest polygons
  - Adds testcase that fails without this patch
2017-02-09 10:40:30 -06:00
John Firebaugh
94a3c272ff [core] Update gl-js; fix $id filters with GeoJSON source 2017-02-08 19:07:53 -06:00
John Firebaugh
150b938b49 [build, ios, macos] Simplify version portion of user agent string
The X.Y.Z version portion was unreliable, as it pulled from the latest tag regardless of platform. Set version to 0.0.0 and retrieve only the hash, which allows us to drop the node/npm dependency.
2017-02-08 10:59:59 -06:00
John Firebaugh
74eb8b3609 [core] Use cpp files for shader source 2017-02-07 11:27:36 -06:00
John Firebaugh
9f2f7ddd12 [core] Check in generated shader code
One step toward eliminating the node/npm dependency for platforms other than node.
2017-02-07 11:27:36 -06:00
John Firebaugh
f0d4411871 [node] Temporary: exit(0) on exception in Painter::render
Hope to get complete apitrace with a clean exit rather than an abort.
2017-02-06 17:57:37 -06:00
Ivo van Dongen
8a5bff8ee6 [core] default value support in categorical function conversion 2017-02-02 09:44:42 -08:00
John Firebaugh
141e995806 [core] Add support for data-driven styling 2017-02-02 09:44:42 -08:00
John Firebaugh
67e157e8b4 [core] Move fill-outline special case to FillLayer::Impl::evaluate 2017-02-02 09:44:06 -08:00
Konstantin Käfer
62ea1f2185 [core] remove trailing whitespace, add trailing newlines, add space after // 2017-01-27 11:44:16 +01:00
John Firebaugh
68440ee6c2 [core] Allow tile cache size to change with viewport size 2017-01-26 17:48:44 +02:00
John Firebaugh
44b960fb92 [core] Scale tile cache size based on tile size 2017-01-26 17:48:44 +02:00
Konstantin Käfer
a37ae27aed [core] fix rendering 180° line joins 2017-01-23 17:02:40 +01:00
Thiago Marcos P. Santos
181b3635f1 [core][Qt] Use Qt for UTF16, since codecvt is not always available 2017-01-20 18:50:45 +01:00
Thiago Marcos P. Santos
7b61324d13 [core] Remove unused include
pthread is not used directly, but per platform basis.
2017-01-19 12:47:33 +01:00
John Firebaugh
d076ba0567 [core] Clean up merge_lines.cpp and add bounds checking 2017-01-18 13:38:05 -06:00
John Firebaugh
531a1c3070 [core] Fix calculation of delayed transitions 2017-01-17 15:18:14 -06:00