Commit Graph

114 Commits

Author SHA1 Message Date
Konstantin Käfer
ec1a58d8ef [core] clear the render order when we're loading a new style
regression introduced by #2908
2015-11-06 16:42:44 +01:00
Konstantin Käfer
177372b836 [core] only update the render order array when there are changes to tiles 2015-11-05 10:33:21 +01:00
Konstantin Käfer
4d5c6333be [core] move retry logic to DefaultFileSource 2015-11-02 17:24:40 +01:00
John Firebaugh
014b517820 [node] Output debug logs when a render test times out 2015-10-28 15:54:34 -07:00
Konstantin Käfer
5173bf1bb8 [core] Make response data shared to avoid excessive copying 2015-10-26 15:54:27 +01:00
Konstantin Käfer
6a7334b882 [core] add support for stale responses
We're now returning stale responses from cache. Those responses will have the `stale` flag set to true. Currently, all requesters in the core code discard stale responses, and cancel the request immediately after they got a non-stale response.
2015-10-26 15:54:27 +01:00
Konstantin Käfer
096a3edf39 [core] use RAII-style lifetime tracking of Request objects 2015-10-26 15:54:27 +01:00
Konstantin Käfer
94a5ac857f [core] all requests have to be canceled explicitly now
By not automatically destroying Request objects after the result has been delivered, we are making sure that we can potentially fire the callback multiple times without adverse effects. This means that you have to hold on to the result of fs->request(), can explicitly cancel it if you don't want to be notified of data changes anymore. Not doing so will monitor the request indefinitely and will prevent the app from exiting.
2015-10-26 15:54:27 +01:00
Bruno de Oliveira Abinader
6824a24acd [core] Removed time param from Painter::render
Animation time can be obtained directly from MapData.
2015-10-21 11:20:45 -07:00
Bruno de Oliveira Abinader
0045eef00a [core] Moved Painter::setup() to Painter ctor 2015-10-21 11:20:39 -07:00
Bruno de Oliveira Abinader
ad3078e73d [core] Remove redundant setDebug() from Painter
This information can be obtained directly from MapData.
2015-10-21 11:20:20 -07:00
Jason Wray
e5aab73b60 [core] only check for mapbox:// at the start of the failed request's URL 2015-10-21 11:38:01 -04:00
Jason Wray
ae5a345cc4 [core] Improve error message when style is not found or is incompatible
Attempting to use a Mapbox-hosted incompatible raster map/style with GL
would throw a simple 404, without any indication of the real issue.

Fix #1724, ref #1841
2015-10-21 11:38:01 -04:00
Bruno de Oliveira Abinader
6a1b9b31a6 [core] MapContext setStyle{URL,JSON} should ignore redundant calls
Our engine should be robust enough to ignore redundant calls and avoid
triggering a whole style update if the style URL and/or JSON are the
same.
2015-10-16 13:16:02 +11:00
Leith Bade
2ee7b02189 [core] [android] Fix InfoWindow topOffsetPixels adjustment when switching styles
Fixes #2599
Make getTopOffsetPixelsForAnnotationSymbol private
Also implements MapChangeWillStartLoadingMap, MapChangeDidFinishLoadingMap
Paritally implements #630
2015-10-16 13:06:49 +11:00
Bruno de Oliveira Abinader
074d61a55e [core] MapContext setStyle{URL,JSON} should ignore redundant calls
Our engine should be robust enough to ignore redundant calls and avoid
triggering a whole style update if the style URL and/or JSON are the
same.
2015-10-14 22:44:00 -07:00
Bruno de Oliveira Abinader
402819e1ad Fix for style properties transition updates 2015-10-06 12:25:46 -07:00
Leith Bade
b869771992 Correctly handle spurious wake-ups in Map::pause()
Fixes #2522
2015-10-06 14:10:32 +11:00
John Firebaugh
af392b9434 Rewrite annotation invalidation strategy
First, move style mutation code out of StyleParser and into AnnotationManager,
coalescing it with the mutation code for shape layers.

Second, allow AnnotationManager to keep track of stale tiles entirely
internally. There's no reason to pass sets of TileIDs around.

Third, correct the logic for invalidating the shape source. Since
AnnotationManager does not track shape invalidations on a tile-by-tile basis,
don't try to invalidate the shape source tile-by-tile.

Fixes #1675
Fixes #2322
Fixes #2095
2015-09-28 14:10:23 -07:00
John Firebaugh
24a5834428 Move updateAnnotationTiles[IfNeeded] to AnnotationManager 2015-09-28 14:10:01 -07:00
John Firebaugh
0c4c7ed901 map/annotation.* ⇢ annotation/annotation_manager.* 2015-09-28 14:10:01 -07:00
Justin R. Miller
d57b47b1eb fixes #1675: abstract annotation tile refresh check/render; trigger post-sprite/sprite store load 2015-09-11 15:09:40 -07:00
Bruno de Oliveira Abinader
0ff7cf20e9 Get rid of MapData::{get,set}NeedsRepaint 2015-09-02 23:20:47 +03:00
Bruno de Oliveira Abinader
0b501e0566 Substitute nudgeTransitions with async view invalidation 2015-09-02 23:20:46 +03:00
Bruno de Oliveira Abinader
e920328223 Provide view invalidation call coalescion via uv_async_t 2015-09-02 23:20:46 +03:00
Bruno de Oliveira Abinader
227776dee0 Style no longer requires mainloop access 2015-09-02 23:18:29 +03:00
John Firebaugh
55d25a80a7 In still mode, don't load resources until a render request is made 2015-08-31 18:09:11 -07:00
John Firebaugh
abc1c84fb8 Merge branch 'master' into node 2015-08-31 16:45:21 -07:00
Mike Morris
4540c3c0e8 View::swap -> View::beforeRender View::afterRender
To be able to resize the framebuffer on the map thread
in HeadlessView.
2015-08-25 14:39:49 -04:00
Bruno de Oliveira Abinader
765c4695d8 Revert "only update the render order array when there are changes to tiles"
This reverts commit fd98607c5f.

Fixes #2163.
2015-08-25 11:36:10 -07:00
Konstantin Käfer
fd98607c5f only update the render order array when there are changes to tiles 2015-08-20 16:13:46 -04:00
Bruno de Oliveira Abinader
fa18f1afd0 Trigger a view invalidation upon resume
Causes view to repaint when returning from pause state, fixing the black
screen perceived in some scenarios.

Fixes #2071.
2015-08-19 04:54:07 -04:00
Bruno de Oliveira Abinader
ac9d5886f0 Added operator implementations for mbgl::Update enum class 2015-08-13 10:12:48 +03:00
Konstantin Käfer
0a527f623e don't constantly repaint by setting needsRepaint to false
fix by @brunoabinader
2015-08-10 22:39:08 +03:00
Bruno de Oliveira Abinader
fa4636ffe4 Map::nudgeTransitions no longer depends on client information
Clients no longer need to provide data (eg. if gesturing or in a custom
animation) to Map::nudgeTransitions().

Upon MapContext::renderSync(), a new atomic bool 'needsRepaint' in MapData
allows thread-safe communication between Map and MapContext.
2015-08-05 15:19:00 +03:00
Bruno de Oliveira Abinader
9fd7e883a7 Coalesce view invalidation calls
Do not call for view invalidation until painter has rendered a new
frame.
2015-08-05 15:19:00 +03:00
Bruno de Oliveira Abinader
492bcf0bd7 Added Update::Repaint 2015-08-05 15:19:00 +03:00
Bruno de Oliveira Abinader
0eb7effad7 Make MapContext use StillImageCallback definition from Map 2015-08-05 15:19:00 +03:00
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
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
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
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
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
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
Justin R. Miller
cd7c3ddb9c fixes #1858: proper shape placement in style layers 2015-07-09 08:55:12 -07:00
Konstantin Käfer
b2a3314192 replace Style object immediately
this makes sure that adding custom sprite imagery will add them to the new Style object rather than
the old one in case a user adds new custom sprites immediately after changing a stylesheet
2015-07-08 19:46:01 +02:00
Konstantin Käfer
f9601ae685 add ability to set custom sprites on the Map object 2015-07-08 19:46:01 +02:00