Commit Graph

40 Commits

Author SHA1 Message Date
Konstantin Käfer
220ebf61dd replace iterator variable types with auto 2015-04-01 16:42:42 +02:00
Konstantin Käfer
268129b9c1 use cumulative hash instead of string for linedash lookup 2015-04-01 15:30:57 +02:00
Ansis Brammanis
14e8b4bb09 support wrapped bilinear scaling
to get rid of seams in repeating patterns.

https://github.com/mapbox/mapbox-gl-styles/issues/50#issuecomment-86159351
2015-03-26 10:45:23 +01:00
Ansis Brammanis
9080f25d31 fix sprite padding, fixes
https://github.com/mapbox/mapbox-gl-styles/issues/50#issuecomment-86159351
2015-03-26 10:45:23 +01:00
Ansis Brammanis
24922795c5 height not width, fixes #1038 2015-03-25 13:23:15 -07:00
Konstantin Käfer
61fa436193 coalesce buffer deletions and run them in bulk during rendering
On iOS, the main thread does framebuffer operations just before it requests a rerender of the view contents. This means that GL operations on the Map thread will interfere with that and cause a crash. While most GL operations happen throughout rendering (which is synchronized with the main thread), deletion of shared_ptrs release in turn their OpenGL objects. This may happen at any time and isn't synced with rendering.

This patch changes this so instead of deleting all objects immediately, we are collecting all abandoned IDs and delete them in bulk once the main thread has given us permission to use OpenGL calls (i.e. during render()).
2015-03-20 19:47:54 +01:00
Thiago Marcos P. Santos
ceb7049389 Delete the data buffer of LineAtlas
Data buffer is allocated but never deleted.
2015-03-20 14:38:08 +02: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
John Firebaugh
6325f1e25a Index glyph use by tile pointer value, not tile ID
There can be multiple tiles with the same ID, but from different
sources.

Fixes #957
2015-03-13 10:55:49 -07:00
John Firebaugh
762e4bdfbe Clean up GlyphAtlas 2015-03-13 10:55:49 -07:00
Thiago Marcos P. Santos
124b49562d Get rid of printf and cout by using Log::*
Use our logging system that will route the message accordingly on
the target platform.

Fixes #613
2015-03-12 14:19:32 +02:00
John Firebaugh
5fa628bc00 Inline PBFGeometry 2015-03-10 10:31:24 -07:00
John Firebaugh
b7f04ee7c2 Use single geometry format 2015-03-09 18:32:09 -07:00
Justin R. Miller
a6b6a8d67e move to abstract interfaces to more be in line with original API 2015-03-09 11:57:34 -07:00
Justin R. Miller
41c3b82d3e refs #928: bookmarking working build of refactor 2015-03-09 11:57:31 -07:00
Ansis Brammanis
c621441def Fix line label interpolation offset. 2015-02-11 14:12:32 -08:00
Ansis Brammanis
8e459c2a73 improve line label density
Place the first label as close to the beginning of the line as possible.

js: 316ed0bd9bff8cd430ad81d0b6397f396fbce124
2015-02-10 15:21:18 -08:00
Ansis Brammanis
002a709b67 fix copy_bitmap for wrapped bitmaps 2015-02-04 09:54:41 -08:00
Konstantin Käfer
5503aef690 make vaos immovable 2015-02-04 10:49:05 +01:00
Ansis Brammanis
3de43f5f58 fix uninitialized variable warning 2015-02-03 14:44:50 -08:00
Ansis Brammanis
23dd403a25 add wrapped padding to sprite for repeating images
fixes #798
js: e732e784e41bef35bd40de27fdbfa3e8f9588038
2015-02-03 13:17:26 -08:00
Ansis Brammanis
793985580d fix sprite atlas padding and icon centering
Pad each icon with one pixel on the bottom and right sides.

On top of this, extra padding is added to round the widths and heights
to multiples of four.

This then fixes the positions of the bottom and right vertices to
correctly center the icon's box around the center of the icon, not the
center of the padded icon.

js: 32ca4007699d1d21ab25bb38588b151510194030

fixes https://github.com/mapbox/mapbox-gl-js/issues/947
2015-01-27 19:15:22 -08:00
Leith Bade
42d1972732 Merge branch 'master' of github.com:mapbox/mapbox-gl-native into android-mason
Conflicts:
	src/mbgl/renderer/painter_prerender.cpp
	src/mbgl/renderer/prerendered_texture.cpp
	src/mbgl/renderer/prerendered_texture.hpp
2015-01-23 11:11:04 +11:00
Ansis Brammanis
07e23967d8 eamlessly join odd-length dasharrays
js: 8314099fa4165714c743ebe891fcff0e618ebcde
2015-01-16 16:21:14 -05:00
Ansis Brammanis
bf4e9d0862 remove duplicate lineatlas texture update 2015-01-16 14:39:47 -05:00
Ansis Brammanis
1ce0ca0b7a add warning when line atlas is overflowed 2015-01-16 13:37:13 -05:00
Ansis Brammanis
b66f4e2c4b use TexSubImage2D for line atlas updates 2015-01-14 23:09:14 -05:00
Ansis Brammanis
4f827c21c6 implement round dash caps 2015-01-14 22:56:44 -05:00
Ansis Brammanis
2c615b613c support dash arrays that are any length 2015-01-14 22:24:44 -05:00
Ansis Brammanis
2643a0efc7 start porting dash lines from js
- switches to dash units that are scaled by line width
- adds a lineatlas to store patterns line dashed lines
- adds linesdf shader which renders line fill from the lineatlas

js: 8e83d76af3bd877eb9639c02e296363e2c0186f8
2015-01-14 20:56:18 -05:00
Leith Bade
5ed8d4544f Merge branch 'master' of github.com:mapbox/mapbox-gl-native into android-mason 2015-01-09 09:30:52 +11:00
Ansis Brammanis
59b51f0a9f fix fill pattern spacing
js: 22e24f7f67c4db89d09c0b65df67d0fcf1c3b614
2015-01-08 14:00:06 -05:00
Leith Bade
3aaf1f26f3 Missed rename 2014-12-25 18:10:16 +13:00
Konstantin Käfer
6cabaf0230 provide explicit constructor to appease GCC 2014-12-12 12:37:55 +01:00
Konstantin Käfer
febfb7ac09 fix rendering errors 2014-12-12 12:37:55 +01:00
Konstantin Käfer
2648e6a964 add debug line for showing the sprite atlas 2014-12-12 12:37:55 +01:00
Konstantin Käfer
5b14c85b78 use 4-byte aligned vertex attributes for performance reason
reverts 9d5f02ccaa and 4c0b4a7901
2014-12-12 12:37:54 +01:00
Konstantin Käfer
93d56294cf update error reporting function 2014-12-10 13:21:08 +01:00
Leith Bade
0808485453 Use CHECK_ERROR on every GL call 2014-12-10 21:57:34 +11:00
Konstantin Käfer
abafb52f37 make most headers private 2014-12-04 20:02:50 +01:00