Commit Graph

118 Commits

Author SHA1 Message Date
Bruno de Oliveira Abinader
1769e6fcb4 [core] Move GLFW stencil clip debug to core
This makes the stencil clip debug available to all platforms.

Fixes #4669.
2016-05-24 19:58:24 +03:00
Bruno de Oliveira Abinader
c13dd32242 [core] Added Viewport mode
Satisfies embedding platforms that requires the viewport coordinate
systems to be set according to its standards e.g. viewport mirrored
vertically.
2016-05-11 15:48:51 +03:00
Thiago Marcos P. Santos
94093493d5 [glfw] Atomic is no longer needed
All View events come from the same thread.
2016-04-28 16:15:07 +03:00
Bruno de Oliveira Abinader
a2a6e22bdd [glfw] Workaround for OS X (#4666) 2016-04-15 12:18:16 -07:00
John Firebaugh
204c7fee03 [core] Render from the main thread
Do not create a thread for the MapContext anymore.
2016-04-14 13:44:08 -07:00
Bruno de Oliveira Abinader
01a0f5464d [glfw] Fix random point generation 2016-04-01 10:21:59 +03:00
Thiago Marcos P. Santos
baf30cd1f7 [glfw] Main loop integration
This new code can be used for rendering on the Main thread
while it will also work for rendering on the Map thread
before we make the switch. Needed by #2909.
2016-03-21 23:58:48 -03:00
Bruno de Oliveira Abinader
4909169996 [core] Added user-defined transition properties when modifying classes 2016-03-18 01:26:22 +02:00
Bruno de Oliveira Abinader
7a509b0369 [linux] Added world tour to GLFW test app 2016-03-14 11:51:37 +02:00
Bruno de Oliveira Abinader
8e30a4a080 [core] Harden Transform anchor & padding usage
Use optional values for anchor & padding in Map and Transform functions
instead of NaNs. Added unit tests to stress some edge cases.
2016-03-13 21:38:20 +02:00
Bruno de Oliveira Abinader
4994b3dc57 [core] PrecisionPoint is now ScreenCoordinate 2016-03-01 20:58:54 +00:00
Konstantin Käfer
33b63f0ef6 [glfw] add "C" button to show stencil clip masks 2016-02-10 11:35:17 +01:00
Konstantin Käfer
e74987b07f [core] move GL value objects from gl_config.hpp to gl_values.hpp
Also removes duplicate code from gl_helper.hpp by reusing the GL values that we already have anyway.
2016-02-08 12:50:00 +01:00
Konstantin Käfer
5c3b01ffcf [core] move util/gl_helper.hpp to gl/gl_helper.hpp 2016-02-08 12:50:00 +01:00
Konstantin Käfer
2f06ca74e2 [core] move platform/gl.hpp to gl/gl.hpp 2016-02-08 12:50:00 +01:00
Bruno de Oliveira Abinader
2f86467586 Cleanup std::chrono usage
Use mbgl::Duration and mbgl::{,Milli}Seconds whenever possible.
2016-01-25 15:11:18 +02:00
Ansis Brammanis
d34f8eb674 [core][ios][osx][android] make SpriteImage accept PremultipliedImage
the SpriteImage constructor signature changes from

SpriteImage(
        uint16_t width, uint16_t height, float pixelRatio,
        std::string&& data, bool sdf = false);

to

SpriteImage(PremultipliedImage&&, float pixelRatio, bool sdf = false)
2016-01-19 18:23:21 -08:00
Thiago Marcos P. Santos
7ad9e47bbe [glfw] Fix panning direction
Follow-up of the transform refactoring
2016-01-19 11:36:26 +02:00
Minh Nguyễn
47b69100f9 [core, ios, osx, android, glfw] Flipped origin of Map::latLngForPixel(), Map::pixelForLatLng()
Map and Transform methods assume an origin at the top-left corner of the view, like iOS, Android, and GLFW but unlike OS X. Transform is responsible for flipping coordinates between the top-left origin of Map and the bottom-left origin of TransformState.

Fixes #3574.
2016-01-18 16:54:58 -08:00
Bruno de Oliveira Abinader
20d2ceef4b [osx] Use framebuffer width/height in GLFW port
Framebuffer width/height takes pixel ration in consideration.

Part of #3294.
2015-12-18 15:31:36 -08:00
Thiago Marcos P. Santos
a903d2eef0 [glfw] Set viewport size from the Map thread
Setting the viewport size from the main thread has no affect
on Linux and thus, the map doesn't scale. We now set the
viewport size on the beforeRender() hook that gets called
from the Map thread.
2015-12-16 17:18:54 -08:00
Konstantin Käfer
4fc8226838 [core] allow changing the orientation
You can now change the orientation of north to be to the right, bottom, left in addition to the default of top
2015-12-15 11:41:58 -08:00
Konstantin Käfer
93c000dd18 [core] viewport is handled by embedding applications 2015-12-10 14:16:11 -08:00
Konstantin Käfer
d5fb535058 [core] add namespace comment to closing brace 2015-12-03 15:38:36 +01:00
John Firebaugh
8afa14fa78 [core] Map::setSprite ⇢ Map::addAnnotationIcon
Fixes #3084
2015-12-01 15:10:28 -08:00
John Firebaugh
622f6691b7 [glfw] No longer necessary to wait for style load to add default marker 2015-12-01 09:15:05 -08:00
John Firebaugh
12fc949006 [tests] Don't use icons from the style for annotations 2015-11-30 12:40:09 -08:00
Bruno de Oliveira Abinader
92856f394c [core] Collision debug is now MapDebugOptions::Collision 2015-11-27 17:47:02 +02:00
Bruno de Oliveira Abinader
1f0820c8e8 [core] Added MapDebugOptions
Map debug options are now cycled up to all debug options enabled, then
back to none.
2015-11-27 17:47:02 +02:00
Justin R. Miller
ac10cc1ecd fixes #3054: move desktop test app keybindings output to startup log 2015-11-17 12:00:51 -08:00
Konstantin Käfer
85ab48636c [core] allow changing pitch in GLFW based apps 2015-11-17 19:02:12 +01:00
John Firebaugh
1e350b7ea4 [core] Reorganize sprite related files 2015-11-12 13:03:14 -08:00
Bruno de Oliveira Abinader
5a24ac605b [core] Use PrecisionPoint in zoom and angle functions 2015-11-11 16:59:49 +02:00
Bruno de Oliveira Abinader
c78e769635 [core] Use PrecisionPoint in coordinate functions 2015-11-11 16:59:49 +02:00
John Firebaugh
54e08b1f83 [core] Eliminate use of ClassProperties for paint 2015-11-10 11:33:17 -08:00
Ansis Brammanis
750c72f324 improve gestures in perspective view
The location under your finger stays under your finger as you pan.
The location you double tap to zoom stays at the same point.
The location at the center of a pinch zoom stays at the center.
The location at the center of a rotation stays at the center.
2015-10-26 12:48:03 -07:00
Konstantin Käfer
75dec6ffac [core] always reparse with the freshest possible placement config
Fixes an issue where updates to stale tiles would remove labels altogether until the map was rotated.
2015-10-26 16:44:55 +01:00
John Firebaugh
3afc8b4a29 [core] Introduce StyleLayer subclasses 2015-10-22 09:34:40 -07:00
John Firebaugh
df89de5cc5 [core] Rationalize style property classes: <type>{Paint,Layout}Properties 2015-10-22 09:21:30 -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
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
Konstantin Käfer
aa06a9d587 query the monitor's resolution instead of forcing 1024x768 2015-08-11 16:40:40 +03:00
Konstantin Käfer
21ec505648 add benchmark mode that shows the real frame time rather than the vsync time 2015-08-11 16:40:40 +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
492bcf0bd7 Added Update::Repaint 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
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
Bruno de Oliveira Abinader
0b8cd02c19 GLFW port now uses nudgeTransitions() 2015-07-20 21:59:13 +03:00
Thiago Marcos P. Santos
bd8210d5a1 Remove unused function: elapsed() 2015-07-11 12:42:45 +03:00