Commit Graph

210 Commits

Author SHA1 Message Date
Thiago Marcos P. Santos
1f12bcee90 Support shape annotations on GLFWView
Add different random triangles count by using the keys 7, 8, 9 or 0.
Q will clear all the annotations.
W will remove one annotation.
2015-06-18 13:39:18 +03:00
Minh Nguyễn
714b68f7b3 Revert "use array of structs rather than parallel arrays for annotations"
This reverts commit 2435c1ad26 (#1710), which needs to be revisited in light of #1655, which is a much higher priority at the moment.
2015-06-15 15:58:22 -07:00
Konstantin Käfer
2435c1ad26 use array of structs rather than parallel arrays for annotations 2015-06-11 17:26:37 -04:00
Konstantin Käfer
0c5f8a2c59 press 1 through 6 to add 10^(n-1) points in the current viewport
(only works correctly when rotated to north, but this is a just a debug functionality anyway)
2015-06-09 10:29:07 -04:00
Ansis Brammanis
ff6a5ce5bc Merge remote-tracking branch 'origin/master' into new-labelling
Conflicts:
	src/mbgl/map/source.cpp
	src/mbgl/map/source.hpp
	src/mbgl/map/tile_data.cpp
	src/mbgl/map/tile_parser.cpp
	src/mbgl/map/vector_tile_data.cpp
	src/mbgl/renderer/painter.cpp
	src/mbgl/renderer/symbol_bucket.cpp
	src/mbgl/text/glyph.hpp
	src/mbgl/text/glyph_store.cpp
	src/mbgl/text/placement.cpp
	test/suite
2015-05-28 20:01:15 -04:00
Ansis Brammanis
8962442b1b make collision debug boxes toggleable 2015-05-28 19:17:07 -04:00
Konstantin Käfer
f4707f72e0 Replace mbgl::util::make_unique<> with std::make_unique<> 2015-05-26 17:57:38 +02:00
John Firebaugh
5aa5976a71 Speculative fix for PNG alpha/gamma handling
The libpng documentation is hopelessly impenetrable and I have no idea
what I'm doing, but this seems to fix the headless rendering failures.
2015-05-14 18:02:15 -07:00
John Firebaugh
7d4f12434e Ensure call-once semantics inside InitializeExtensions 2015-05-13 19:01:58 -07:00
John Firebaugh
a2344c36c3 Extensible GL extension support 2015-05-13 19:01:58 -07:00
John Firebaugh
0f7c6b0b52 Remove unused GL feature flags
These were used only for prerendered textures, which were removed.
2015-05-13 19:01:57 -07:00
John Firebaugh
606e2c7383 Remove currently unsupported styles from defaultStyles 2015-05-12 16:42:26 -07:00
Konstantin Käfer
7dbe768ffc change the window title to indicate the current style 2015-05-07 11:01:15 +02:00
Thiago Marcos P. Santos
769364c117 Make all GLFWView attributes private 2015-05-07 11:01:15 +02:00
Thiago Marcos P. Santos
168d7c4f17 Add style change functionality to the Linux test app
Makes the life of people using Linux as development environment way
easier.

Just press 's' to cycle through 3 different styles.
2015-05-07 11:01:15 +02:00
Konstantin Käfer
248e48eacc decode URLS when loading from file system 2015-05-05 11:47:23 +02:00
Konstantin Käfer
27d8e82e1c lower thread priority of worker threads 2015-05-04 17:33:05 +02:00
Konstantin Käfer
72964f5bef only update GL state when it actually changed 2015-05-04 17:33:05 +02:00
John Firebaugh
5013be138e Fix CURL handle leak (fixes #1394) 2015-05-01 18:48:07 -04:00
John Firebaugh
24695f6c02 More bandaids to avoid #1309
Even though we only bind the shared_ptr in the after callback, the
worker thread was still copying the callback and therefore gaining
a shared reference. Here we try to eliminate the copies.
2015-05-01 17:14:06 -04:00
John Firebaugh
481fa0e69f Restructure *Request and Context
The previous implementation, based on thread-local storage, did not
ensure that the context was destructed before the FileSource run loop.
This resulted in implementations attempting to uv_close handles for a
loop that had already been destroyed.

This change also fixes #1262.
2015-04-28 19:26:35 -04:00
John Firebaugh
3bf0bf9538 Remove unused includes 2015-04-28 14:32:25 -04:00
John Firebaugh
230027e514 Resize view from map thread 2015-04-28 14:32:24 -04:00
John Firebaugh
a625ba8a09 Remove Map::start/stop
Both Android and iOS now use pause/resume. The map thread is
always running, and be able to receive messages. When paused,
it will just refuse to render.
2015-04-28 14:32:24 -04:00
John Firebaugh
6c7a01a503 Following kkaefer's view changes 2015-04-28 14:32:22 -04:00
John Firebaugh
32c818feea Provide Thread objects with access to loop 2015-04-28 14:32:22 -04:00
Konstantin Käfer
dae18cc7bc remove some unused includes 2015-04-28 14:32:21 -04:00
Konstantin Käfer
b0a30943b4 move most private Map code to MapContext 2015-04-28 14:32:20 -04:00
John Firebaugh
8e5fa341eb Remove RequestBase::start
Requests are always started immediately upon construction.

While here, use typed pointers, not void*.
2015-04-28 09:16:26 -04:00
John Firebaugh
cdd8f3ac32 Separate RequestBase from DefaultFileSource internals
SharedRequestBase was trying to do two different jobs: be a base class
for Asset/HttpRequest and track internal state for DefaultFileSource.

Now we have RequestBase for the former, and DefaultFileRequest for the
latter.
2015-04-28 09:16:26 -04:00
John Firebaugh
359aca6624 Privatize SharedRequestBase::source 2015-04-28 09:16:26 -04:00
John Firebaugh
f4adef1889 pointer ⇢ reference 2015-04-28 09:16:25 -04:00
John Firebaugh
9a0005fdea Remove unnecessary moves / casts 2015-04-28 09:16:25 -04:00
Konstantin Käfer
2b633cc51c build on Travis' sudo: false infrastructure 2015-04-28 10:43:13 +02:00
Konstantin Käfer
46bf226910 align static render mode and still image render mode
- static rendering now also runs in a separate thread; you have to start it with map.start(Map::Mode::Static) and join the thread with map.stop() before destructing the Map object
- map.renderStill() takes a callback with will be invoked on the *map* thread, so you'll have to figure out your own method of dispatching back to the main thread.
2015-04-17 13:40:42 +02:00
John Firebaugh
5fa0512be2 Shorten method names 2015-04-15 20:38:25 -07:00
John Firebaugh
1eaf6b8c18 Stricter Thread<> interface
Implements a Thread<>::invoke interface that only permits calling
member functions with bound arguments.

Also introduce invokeWithResult, which accepts a callback and invokes
it, passing the result, on the invoking thread's RunLoop. This closes
the loop of two evented threads doing message passing.
2015-04-15 20:38:25 -07:00
Konstantin Käfer
1066504008 separate SQLiteCache::Impl header from implementation file 2015-04-13 18:38:39 +02:00
Konstantin Käfer
352ff64e06 rename SQLiteCache::Thread to SQLiteCache::Impl 2015-04-13 18:32:59 +02:00
Konstantin Käfer
452d12e6e6 make implementation files private headers 2015-04-13 18:28:18 +02:00
Konstantin Käfer
16849a341b hide Thread<> and separate the Implementation object 2015-04-13 17:57:45 +02:00
Konstantin Käfer
4c7132337f convert DefaultFileSource to use util::Thread<> 2015-04-10 22:37:27 +02:00
Konstantin Käfer
bba3d9838a add Thread<T> and RunLoop
Thread<T> is a generic thread management object that starts a thread, creates an object T in that thread and calls its .start() function. When the Thread<T> object is destructed (which must happen in the thread that created it), it'll call the object's .stop() function, and wait for thread termination. The .stop() function must somehow get the thread to terminate. Note that object T's constructor/destructor/start()/stop() must be protected/private, and Thread<T> must be declared as a friend class. All public functions may be called from any thread and are exposed through operator->().

RunLoop encapsulates a libuv runloop and has a facility of dispatching function objects to the thread. It can be used either as a worker thread class by itself, or it can be derived from. This commit converts SQLiteCache to derive from RunLoop and removes the custom code used previously for managing the cache thread.
2015-04-10 15:36:32 +02:00
Konstantin Käfer
4b66c490b4 guard against invalid database files 2015-04-08 14:55:47 +02:00
Konstantin Käfer
7d58a41de5 make sqlite storage more resilient to sporadic errors
- catch SQLite exceptions and report them
- failed statements are ignored, we're really just caching here, so if it fails we're handling it gracefully elsewhere
- handle cases where the database file goes away after we opened it
- handle cases where the schema wasn't created after the database file was opened successfully
- add tests
2015-04-07 18:04:23 +02:00
John Firebaugh
12c07b916b Rework easing transition code
This brings the easing transition code a bit closer to how easings work
in gl-js. Instead of having an array of individual transitions for scale,
rotate, and pan, there is a single transition function that does all the
required calculations. This permits us to:

* Eliminate the "timeout" transition. (Fixes #126)
* Replace start/stopPanning() et al with setGestureInProgress(). Apps or
  SDKs are expected to make paired calls to setGestureInProgress(). This
  state will be ORed with the active easing state to determine when to
  use texture interpolation. (Fixes #79)
* Run style recalculations only when an ease transition that affects the
  zoom is in progress. (Fixes #1155)
2015-04-02 16:12:29 -07:00
John Firebaugh
9331acf8e6 Add typedefs for std::chrono::steady_clock types 2015-04-02 12:28:12 +02:00
Thiago Marcos P. Santos
490c172b35 Delete the GLFWView object at exit
Also destroy the glfwWindow we create. This leak was probably harmless
but a nice cleanup helps us debug other serious memory leaks.
2015-03-20 14:38:08 +02:00
Thiago Marcos P. Santos
3254cdc85c Log the Environment ID and the Thread name
To make it easier to debug, add the Environment ID and the Thread name
to the log messages. For instance log messages from the TileParser will look like:

[WARNING] {0}{TileWorker_15/18653/9486}[ParseTile]: some relevant warning message
   |       |             |                  |
   |       |             |                  +-> Component
   |       |             +--------------------> Thread name
   |       +----------------------------------> Environment ID
   +------------------------------------------> Severity level

Log messages that are not inside an Environment::Scope will work
normally and will look like:

[WARNING] [JNI]: some relevant warning message

Fixes #882.
2015-03-18 12:51:33 +01:00
Konstantin Käfer
48c55af5c1 fix sprites for pixel ratios that are not 1 and 2
- OpenGL ES 2 doesn't allow NPOT textures with wrap-around
- The Sprite object reported the map's pixelRatio, even though it loaded @2x assets
- Copying icons from the sprite into the atlas now uses bilinear scaling to scale up to the actual size
2015-03-17 12:30:40 +01:00