Commit Graph

1750 Commits

Author SHA1 Message Date
Konstantin Käfer
78ec33320f don't use certain STL functions
some functions defined in <cmath>, as well as std::to_string aren't available on GNU's STL for some platforms, e.g. Android
2015-08-04 14:08:19 +02:00
Bruno de Oliveira Abinader
58b93553c1 Replace size() with empty() whenever possible
Before C++11, std::list's implementation of size was O(n). It should be
all O(1) now, but it is probably still a good idea to use empty() to
emphasize the intend.
2015-07-29 11:03:47 +03:00
Bruno de Oliveira Abinader
3c43171bc0 s/AssetContext/AssetContextBase/ 2015-07-28 19:27:13 +03:00
Bruno de Oliveira Abinader
0cc69b368d s/HTTPContext/HTTPContextBase/ 2015-07-28 19:27:13 +03:00
Bruno de Oliveira Abinader
590d9ab95c Created HTTPRequestBase as base for HTTP requests
- Added HTTPRequestBase (inherits from RequestBase)
- retry() is now a pure virtual in HTTPRequestBase
- Moved cancelled bool to HTTPRequestBase
- HTTPContext now handles only HTTPRequestBase*
- Renamed HTTPNSURLRequest, HTTPCURLRequest
2015-07-28 19:27:13 +03:00
Bruno de Oliveira Abinader
785b34df2e Moved ResponseStatus to its own header 2015-07-28 19:27:13 +03:00
Bruno de Oliveira Abinader
5e2f3b1323 Avoid nudging transitions if a gesture is in progress #2
Following the same steps from #1548 and #1912 for GLFW and iOS ports.
Also removed a redundant check if transform state is changing since
we're already dealing with that.
2015-07-27 21:57:51 +03:00
jakepruitt
44182a30cf Add curly-braces to if-statements 2015-07-27 10:16:14 -04:00
jakepruitt
14ba3cfd6a Adding special case for non-fontstack "glyph" resource URLs
- does not prepend /v4/ to api endpoints like /fonts/v1/
- only prepends it to things starting with /fontstack
- solves the problem in #1918
- refs mapbox/mapbox-gl-style-spec#309
2015-07-27 10:16:14 -04:00
Bruno de Oliveira Abinader
38f3bed63e Export default transition delay in Map public API
Added a setter/getter for default transition delay, in the same fashion
as the default transition duration.

Spin-off from #1888. Fixes #302.
2015-07-21 18:02:09 +03:00
Bruno de Oliveira Abinader
784eb35512 Revert "Revert "split renderSync and transition nudging to allow client view syncing""
This reverts commit 263f9fad30.
2015-07-20 21:59:13 +03:00
Bruno de Oliveira Abinader
f034a028be s/AppliedClassProperties/AppliedClassPropertyValues/
This class stores a list of property values which belongs to the same
property.
2015-07-20 18:14:24 +03:00
Bruno de Oliveira Abinader
51403b3c8b Cleaned up FrameHistory 2015-07-20 18:14:24 +03:00
Bruno de Oliveira Abinader
263f9fad30 Revert "split renderSync and transition nudging to allow client view syncing"
This reverts commit b8388168dd.

It seems 'nudgeTransitions()' is no longer necessary as #1548 has fixed the update issues.
2015-07-20 17:07:55 +03:00
Bruno de Oliveira Abinader
0753aad57b Check for pending animations or transitions when scheduling another render pass
In continuous mode, we need to check if there are any pending animations or
transitions so we can properly tell the client application that another render
pass is required.
2015-07-20 14:38:19 +03:00
Thiago Marcos P. Santos
234a653931 Use the observer pattern for GlyphPBF loading
This will make the code a lot more clear and it will
also move how parsing is initiated to the GlyphPBF
class, to be initiated after the request, like we do
for other resources.
2015-07-17 21:00:34 +03:00
Thiago Marcos P. Santos
dbf3edad8a Add docs to WorkQueue and GlyphStore 2015-07-17 20:58:38 +03:00
Thiago Marcos P. Santos
38351554f4 Only print Sprite warnings if we have Sprites set
If we don't set Sprites at all or the Sprites were not
loaded yet, the warnings can be misleading.
2015-07-16 20:15:14 +03:00
Thiago Marcos P. Santos
dd818874cc Remove hacks because of Glyph requests could not be canceled 2015-07-16 19:38:39 +03:00
Thiago Marcos P. Santos
a75cc8c06b Make Glyph requests from the Map Thread
Now the requests are bound to the Map Thread loop and
we can cancel it quickly when shutting down or changing
style.

Previously requests were made by the workers and we would
have to wait them to finish because workers are destroyed
before the GlyphStore. This was giving the impression that
the application was frozen (in fact it was, momentarily).
2015-07-16 19:38:39 +03:00
Thiago Marcos P. Santos
c6e58515fc Keep updating until all the tiles are State::parsed
This is needed because of a race that can occur now that we
requests Glyphs from the Map Thread:

The glyph might arrive at the moment a tile is being parsed
and they won't be notified again of any new data, remaining
forever at the partial state.
2015-07-16 19:38:38 +03:00
Thiago Marcos P. Santos
7d500e9330 Introduce the WorkQueue
The WorkQueue allow other threads to submit tasks to be executed in
the thread that the WorkQueue lives on.

The WorkQueue will cancel all the pending tasks when it gets
destructed, to make sure the tasks won't get called with
invalid references.
2015-07-16 19:38:35 +03:00
Thiago Marcos P. Santos
70aea89e13 Add an interface for invoking cancellable tasks on the RunLoop
This is interface is going to be used the WorkQueue in the following
patches.
2015-07-15 16:16:51 +03:00
Minh Nguyễn
1f78d28516 Merge branch 'release-v0.5.0' 2015-07-14 10:49:52 -07:00
Bruno de Oliveira Abinader
bef3e1590b Force style cascade in MapContext::loadStyleJSON
Fixes #1889.
2015-07-14 18:12:52 +03:00
Bruno de Oliveira Abinader
0ea8a37cb0 Unify default transition values in MapData
Relevant changes:
 - Added 'defaultFadeDuration' and 'defaultTransitionDelay' to MapData;
 - Painter & StyleParser now receives a reference to MapData;
 - As previously seen on the code: 300ms is the default fade duration
   and 0ms is the default transition duration;
 - We no longer pass the current time point to Style, since it now uses
   MapData.animationTime, which gets updated in MapContext::update().
 - Updated StyleParser check to use a mock MapData;
2015-07-14 16:58:32 +03:00
Bruno de Oliveira Abinader
2aad2f4e14 Pass {Duration,TimePoint} by const ref if possible 2015-07-14 16:48:34 +03:00
Bruno de Oliveira Abinader
7d8b4dc6c0 s/properties/propertyValues/
This list stores different values for the same property, but the
property itself remains the same.
2015-07-14 16:44:42 +03:00
Bruno de Oliveira Abinader
7023ea061c Unify time point for Mapcontext::update
- Let style classes cascade use the same time point as the one used to
  recalculate style.
- Cleaned up MapContext::update to return early whenever possible.
- Cleaned up MapContext::loadStyleJSON to avoid redundant calls to style
  classes cascade.
2015-07-14 16:44:42 +03:00
Bruno de Oliveira Abinader
77a91f64d8 Micro-optimizations to Style 2015-07-14 16:43:07 +03:00
Thiago Marcos P. Santos
805c8b26f7 Do not return a value on a "[]() -> void"
This is an undefined behavior, and it is a mystery why the
compiler was not complaining about it.
2015-07-13 22:44:53 +03:00
Thiago Marcos P. Santos
00308be140 Make one arg ctors explicit 2015-07-11 12:42:45 +03:00
Thiago Marcos P. Santos
a1c701ca93 Remove unused variable 2015-07-11 12:42:45 +03:00
Thiago Marcos P. Santos
d207166abe Remove unused function: cwd() 2015-07-11 12:42:45 +03:00
Thiago Marcos P. Santos
8a9665b085 Deffer updateAnnotationTiles() if Source is not available
The Style object might have been created but the Source is not
yet available because the JSON file was not set. Can happen
specially when the style is loaded from the network.
2015-07-10 20:25:49 +03:00
Nicki Dlugash
d63f706c5f Merge pull request #1840 from mapbox/repeat-distance
Updates to labels along lines
2015-07-10 10:59:37 -04:00
Thiago Marcos P. Santos
b33d5d8a95 Do not report isLoaded() if loading failed 2015-07-10 10:48:46 +03:00
Thiago Marcos P. Santos
0ee9f21c56 Report Sprite parsing errors to Observers
Parsing errors will be reported to Observers. In practice this will
bubble all the way to the Map object.

This will make possible to identify possible corrupted data instead
of rendering without sprites like we do in case of semantic errors.
2015-07-10 10:48:46 +03:00
Thiago Marcos P. Santos
f64ba78910 Merge Sprite loading notifications
Because they are pretty much the same thing.
2015-07-10 10:48:46 +03:00
Nicki Dlugash
f27bd6b68f Updates to labels along lines
Added a filter to remove anchors with the same text that are too close to each other.

Updates to spacing and offset of anchor placement along lines:

Takes into account icon size for calculating label length.

Recalculates spacing for long labels.

Adjusts offsets to first anchors if line is continued from outside the tile boundary.
2015-07-09 18:52:12 -04:00
Justin R. Miller
82cddb5af2 fixes #1858: proper shape placement in style layers 2015-07-09 10:14:13 -07:00
Justin R. Miller
cd7c3ddb9c fixes #1858: proper shape placement in style layers 2015-07-09 08:55:12 -07:00
Justin R. Miller
b8388168dd split renderSync and transition nudging to allow client view syncing 2015-07-08 12:10:12 -07:00
Konstantin Käfer
c66ec8739b show info message when Sprite does not exist 2015-07-08 19:46:03 +02:00
Konstantin Käfer
d37bd549bc make sure that the SpriteStore object correctly replaces the SpriteImages 2015-07-08 19:46:02 +02:00
Konstantin Käfer
32699333e6 add image to odd pixelRatio atlas 2015-07-08 19:46:02 +02:00
Konstantin Käfer
d08ec53a0e add test for fractional pixel ratios 2015-07-08 19:46:02 +02:00
Konstantin Käfer
a57f3ddceb add basic SpriteAtlas test 2015-07-08 19:46:02 +02:00
Konstantin Käfer
c5ed00ae7a fix sprite debug window code 2015-07-08 19:46:02 +02:00
Konstantin Käfer
746e4d20ee explicitly name the sprite that couldn't be changed 2015-07-08 19:46:02 +02:00