Commit Graph

2818 Commits

Author SHA1 Message Date
John Firebaugh
d1e2fe511e [core] Introduce and use IndexedTuple 2016-11-08 08:09:29 -08:00
John Firebaugh
1db2ffbc1b [core] Use gl::Program to resolve some rough edges in the GL binding types
* Extract `ignore` util to separate header.
* `Segment` now tracks offset and length of indices, rather than primitives. This is more natural.
* Introduce `VertexVector` and `IndexVector` types. These types carry information about the intended draw mode (`Triangles`, `LineStrip`, etc.), and ensure that elements are always appended in a group size appropriate for that draw mode, for both indexed and unindexed rendering.
* `Program`, rather than `Drawable`, is now the unifying object for draw calls. `Program` is the best place to type check the draw call, because it is typed to carry information about the intended primitive, vertex type, attributes, and uniforms.
* Use the debug shaders for debug tile rendering, like gl-js.
* Fix the draw mode for background. It was drawing triangle strips with a triangles array. Surprised this didn’t cause issues. Now it’s type checked.
2016-11-08 08:09:29 -08:00
John Firebaugh
66bdbc3b96 [core] Introduce gl::Program template 2016-11-08 08:09:29 -08:00
John Firebaugh
36210fe4e9 [core] Make attribute binding more similar to uniform binding 2016-11-08 08:09:28 -08:00
John Firebaugh
aa08796767 [core] Separate pathway for notifying workers of new images/glyphs 2016-11-07 10:16:35 -08:00
Konstantin Käfer
1533d28314 [core] move Value class outside of Uniform to enforce explicit construction 2016-11-07 18:51:47 +01:00
Konstantin Käfer
bd3d4bc89a [core] force explicit initialization of uniform values
force users to use the actual names to avoid implicit conversion accidentally targeting the wrong shader
2016-11-07 18:51:47 +01:00
Konstantin Käfer
ed72581e0c [core] remove Uniforms::value in favor of direct construction 2016-11-07 18:51:47 +01:00
Konstantin Käfer
afd43eea3a [core] remove gl.hpp from all headers that don't need it 2016-11-04 21:24:05 +01:00
Konstantin Käfer
7b772611d5 [core] move pixel blitting to gl::Context 2016-11-04 21:24:05 +01:00
Konstantin Käfer
29c5c13aa2 [core] move OpenGL debug information printing to core 2016-11-04 21:24:05 +01:00
Konstantin Käfer
c90a559599 [core] move framebuffer reading to gl::Context 2016-11-04 21:24:05 +01:00
Konstantin Käfer
eed16cb1bb [core] add state tracking to pixel transfer 2016-11-04 21:24:05 +01:00
Konstantin Käfer
008a83b915 [core] add state tracking to pixel store packing alignment 2016-11-04 21:24:05 +01:00
Mike Morris
39e9b30ebc [core] add more detail to invalid metrics error in createSpriteImage 2016-11-04 14:47:34 -04:00
Bruno de Oliveira Abinader
3f5972cba0 [core] Fix render tile ordering when querying sources 2016-11-04 18:43:08 +02:00
Bruno de Oliveira Abinader
549929cefd [core] Set bucket segments to initialize empty 2016-11-02 18:12:28 +02:00
Konstantin Käfer
e4e9b3a2f0 [core] convert FrameHistory to use managed texture handling 2016-11-01 18:41:52 +01:00
Konstantin Käfer
ed155460d3 [core] convert LineAtlas to use managed texture handling 2016-11-01 18:41:52 +01:00
Konstantin Käfer
7b50cac49f [core] convert GlyphAtlas to use managed texture handling 2016-11-01 18:41:52 +01:00
Konstantin Käfer
358701f475 [core] add ability to upload alpha-only textures + images 2016-11-01 18:41:52 +01:00
Konstantin Käfer
9e3839781f [core] convert SpriteAtlas to use managed texture handling 2016-11-01 18:41:52 +01:00
Bruno de Oliveira Abinader
e2981c890e Revert "[core] Don't use GL_LINEAR if panning w/o rotation nor pitch"
This reverts commit a70bfd8910.
2016-11-01 17:44:34 +02:00
Konstantin Käfer
bb6e39a1cf [core] fix depth/stencil visualization
The previous code didn't set the packing correctly, which meant that we had a buffer overrun in the debug code.
2016-11-01 10:46:04 +01:00
Konstantin Käfer
f7801e5d82 [core] correctly set the framebuffer size on retina screens
Also asserts in Debug mode that the internal state and the OpenGL state are identical
2016-11-01 10:46:04 +01:00
Bruno de Oliveira Abinader
7b3e24d74a [core] Cleanup TransformState::getIntegerZoom 2016-10-31 16:53:07 +02:00
Bruno de Oliveira Abinader
384f1a1960 [core] Use numeric_limits<>::max() for checking element groups 2016-10-31 16:53:07 +02:00
Bruno de Oliveira Abinader
38f536049a [core] Moved util::log2 to its own header
- Added util::{MIN,MAX}_ZOOM_F to avoid consecutive conversions from
double to float
- Move util::log2 to its own header (part of mbgl/math)
2016-10-31 16:53:07 +02:00
Bruno de Oliveira Abinader
a70bfd8910 [core] Don't use GL_LINEAR if panning w/o rotation nor pitch 2016-10-31 16:53:07 +02:00
Bruno de Oliveira Abinader
f03afdee21 [core] Use overscaledZ for scale in collision box shader 2016-10-31 16:53:07 +02:00
John Firebaugh
39d5cb3250 [core] Use VAOs internally 2016-10-28 17:14:07 -07:00
John Firebaugh
0e57d10d77 [core] Modern C++ bindings for OpenGL 2016-10-28 17:14:01 -07:00
John Firebaugh
a4c82b8a3b [core] operator bool() must always be explicit
Otherwise, it can participate in unexpected conversions. Case in point: GlyphSet::insert was comparing the result of GlyphMetrics::operator bool() where it wanted to use operator==.
2016-10-28 17:10:45 -07:00
John Firebaugh
ee3235708f [core] Methods don't need to be Painter instance methods 2016-10-28 17:09:51 -07:00
Konstantin Käfer
62b56b799a [core] change std::array<uint16_t, 2> to mbgl::Size 2016-10-27 18:30:58 -07:00
Konstantin Käfer
ef8017198c [core] remove tiles for disabled sources
When no layer of a source is visible anymore, we are now evicting tiles that are still stored in that source and move them to the cache.
2016-10-27 18:14:53 -07:00
Konstantin Käfer
91272992f3 [core] don't load tiles from sources that aren't used 2016-10-27 16:15:36 -07:00
Konstantin Käfer
a4d259c33f [core] move gl::Context to Backend and refactor View 2016-10-25 13:52:36 -07:00
Konstantin Käfer
5cc390d694 [core] separate Backend from View for headless rendering 2016-10-25 13:52:36 -07:00
Ivo van Dongen
b14e83ea40 [core] geojson source - cancel any pending request when setting geojson explicitly 2016-10-25 16:11:36 +02:00
Ivo van Dongen
6277dca898 [core] geojson source - clear cache when json content is set 2016-10-25 16:11:36 +02:00
Ivo van Dongen
068e78a2e7 [core] geojson source - reset req on setURL 2016-10-25 12:47:35 +02:00
Bruno de Oliveira Abinader
e55065e62a [core] Reuse last placement data in CollisionTile::queryRenderedFeatures
To obtain precise results, we:
1. Round scale value to obtain same results from symbol shader.
2. Generate a boost geometry polygon to check if it intersects()
   against all feature boxes.
3. Check if current scale is within each feature's minimum and maximum
   placement scales.
4. De-scale feature boxes when intersecting to account for the
   fractional zoom scaling.
2016-10-25 08:12:31 +03:00
Bruno de Oliveira Abinader
fc6344c546 [core] Added util::polygonIntersectsPolygon 2016-10-25 08:12:31 +03:00
Bruno de Oliveira Abinader
679bfbfb32 [core] Simplify CollisionTile::findPlacementScale
Improve findPlacementScale semantics by moving the check if the
placement scale result is bigger than minimum scale out of the function
scope.
2016-10-25 08:12:31 +03:00
Bruno de Oliveira Abinader
846e57de58 [core] Avoid duplicating edges for CollisionTile
Make 'edges' static to avoid every instance of CollisionTile having its
own copy of it.
2016-10-25 08:12:31 +03:00
Bruno de Oliveira Abinader
8743f11345 [core] Cleanup function signatures in CollisionTile
- Prefer pass-by-value for primitive types.
- Use floating point precision for yStretch to match receiving type.
2016-10-25 08:12:31 +03:00
Ivo van Dongen
e31a2c1c11 [core] fixup formatting 2016-10-21 10:05:00 -07:00
Mike Morris
7bbd49c72c [core] extract weak_ptr mailbox->receive into Mailbox::maybeReceive 2016-10-20 14:39:11 -04:00
Mike Morris
817c26111a [core] [node] pass thread pool impl to Map constructor
Updates mbgl::Map constructor usage everywhere

Adds NodeThreadPool implementation using AsyncQueue to call
Nan::AsyncQueueWorker from main thread
2016-10-20 14:37:36 -04:00