Commit Graph

2203 Commits

Author SHA1 Message Date
John Firebaugh
9c26f06318 [core] Thread GLObjectStore through to Holder objects
This eliminates the reliance on ThreadContext to provide GLObjectStore, and statically enforces that GL cleanup functions happen only when GLObjectStore::performCleanup is called.

With the elimination of the Map thread, this becomes important because there may be multiple GLObjectStore's per-thread, and Map will need to ensure that the correct context is active when calling GLObjectStore::performCleanup.
2016-02-18 15:15:24 -08:00
John Firebaugh
7b39ce9521 [core] Remove ThreadContext::getFileSource; instead thread FileSource through 2016-02-18 15:15:24 -08:00
Bruno de Oliveira Abinader
3762dcfb82 [gl] Refactor texture pool cleanup
Texture pool now allocates a block of 64 textures per time. Each block
contains a TextureObject which handles GL object lifetime. Blocks can be
added or removed according to the following rules:

1. If pool is empty, created a new block upon first call (lazy load);
2. Iterate blocks to find an available texture ID:
- If found, remove that from the list of available IDs for that block
  and return its ID.
- Othewise, allocate a new block and grab an available ID from that.
3. When releasing a texture ID, check if the associated block is free.
If no IDs are currently in use, then abandon its TextureObject and
remove the block from the pool.
2016-02-18 13:27:35 +02:00
Bruno de Oliveira Abinader
93cfca4d4e [gl] Added mbgl::gl::VAOHolder 2016-02-18 13:27:35 +02:00
Bruno de Oliveira Abinader
124173080f [gl] Added mbgl::gl::Texture{,Pool}Holder 2016-02-18 13:27:35 +02:00
Bruno de Oliveira Abinader
3397398c1f [gl] Added mbgl::gl::BufferHolder 2016-02-18 13:27:35 +02:00
Bruno de Oliveira Abinader
a503233d1c [gl] Added mbgl::gl::ShaderHolder 2016-02-18 13:27:35 +02:00
Bruno de Oliveira Abinader
69fa8fe3c0 [gl] Added mbgl::gl::ProgramHolder 2016-02-18 13:27:35 +02:00
Bruno de Oliveira Abinader
bfafc360a7 [gl] Moved TexturePool to gl namespace 2016-02-18 13:27:35 +02:00
Bruno de Oliveira Abinader
1336e3e30f [gl] Moved GLObjectStore to gl namespace 2016-02-18 13:27:35 +02:00
Bruno de Oliveira Abinader
47d6099242 [gl] Use Buffer::getID() whenever possible 2016-02-18 13:27:35 +02:00
Bruno de Oliveira Abinader
0386dc7a4e [gl] Use Shader::getID() whenever possible 2016-02-18 13:27:35 +02:00
Bruno de Oliveira Abinader
ee72e93f94 [gl] Moved VAO helpers to common header 2016-02-18 13:27:35 +02:00
Ansis Brammanis
47dc38bf4a [core] less slanted dashed lines near sharp corners
port https://github.com/mapbox/mapbox-gl-js/pull/2043 from -js
2016-02-15 12:55:41 -08:00
Ansis Brammanis
cdab06306f [core] round points created by clipLines instead of truncating them 2016-02-15 12:55:41 -08:00
Gabriel Miklós
d742c2d3eb [core] Add support for updating point annotations 2016-02-12 16:47:24 -08:00
John Firebaugh
c2ab5b34a7 [tests] Fix build 2016-02-11 18:01:53 -08:00
John Firebaugh
62bbf2627a [core] Organize files that were in map folder better
Fixes #996
2016-02-11 17:30:35 -08:00
Young Hahn
43c44eccdc Allow using tileSize: 512 as a switch to trade retina support for 512px raster tiles 2016-02-11 11:28:35 -08:00
Konstantin Käfer
5726d2b357 [core] use std::move() to prevent copies 2016-02-11 12:17:33 +01:00
John Firebaugh
20be32f217 [core] Always store tiles without ratio support with ratio = 1 2016-02-10 16:25:47 -08:00
John Firebaugh
a9e0c1b99a [core] Eliminate maximumCacheEntrySize
Instead, the eviction policy accounts for the actual size needed for an incoming put.
2016-02-10 15:40:20 -08:00
John Firebaugh
db3620c58f [core] Implement an eviction policy for OfflineDatabase
When inserting an cached resource, or removing a region, remove least-recently used resources and tiles, not used by offline regions, until the used database size, as calculated by multiplying the number of in-use pages by the page size, is less than the maximum cache size minus 5 times the page size.

In addition, OfflineDatabase may be configured to ignore cache puts of individual resources larger than a certain size.

This policy is similar but not identical to the former SQLiteCache policy:

* It accounts for offline, by exempting resources required by offline regions from eviction.
* It must delete from two tables (resources and tiles), rather than one. Currently the strategy is naive: evict 50 rows at a time from each table.
* It makes maximumCacheSize and maximumCacheEntrySize completely independent. The SQLiteCache implementation evicted when `usedSize > maximumCacheSize - 2 * maximumCacheEntrySize`. This evicts when `usedSize > maximumCacheSize - 5 * pageSize`.
* It uses a non-unlimited default value for maximumCacheSize: 50 MB. We should have always had a limit in place; "a cache without an eviction policy is a resource leak".
2016-02-10 15:40:20 -08:00
John Firebaugh
ff15bd51b9 [core] Throttle the number of concurrent requests to 20 2016-02-10 15:40:20 -08:00
John Firebaugh
c91b44b02f Add binary for smoke-testing offline downloads 2016-02-10 15:40:20 -08:00
John Firebaugh
c3c4c7b9a6 [core] Interface and implementation for offline 2016-02-10 15:40:20 -08:00
John Firebaugh
e9302c797f [all] Don't interpret 404s on non-tile resources as "no content" 2016-02-10 15:40:20 -08:00
John Firebaugh
cdedb66387 [core] Reimplement existing caching within an offline-capable database schema 2016-02-10 15:40:20 -08:00
John Firebaugh
025375ad0b [core] Cache with mapbox:// tile URLs 2016-02-10 15:40:20 -08:00
John Firebaugh
f3d4107d19 [core] Add a method for statically evaluating font stacks used by a style 2016-02-10 15:40:20 -08:00
John Firebaugh
7d6c6c00ca [core] Refactor tileCover 2016-02-10 15:40:20 -08:00
Thiago Marcos P. Santos
f52b6105db [core] round() not always on std:: namespace
Build fix.
2016-02-10 19:38:32 +02:00
Konstantin Käfer
4edb2bc222 [core] draw clipping masks from ClipIDGenerator rather than Sources 2016-02-10 11:35:17 +01:00
Konstantin Käfer
a5c9103656 [core] compute the actual clipping masks that we have to draw with getStencils() 2016-02-10 11:35:17 +01:00
Ansis Brammanis
d9244cc973 [core] make sure icons fit before the ends of the line
This skips anchors if there is not enough room before the beginning or
end of the line for the icon to fit.

-js: https://github.com/mapbox/mapbox-gl-js/pull/2077/files
2016-02-09 15:01:34 -08:00
Ansis Brammanis
29d61c0fe7 [node] add debug options to node bindings
fix #3579
2016-02-08 14:22:53 -08: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
2f06ca74e2 [core] move platform/gl.hpp to gl/gl.hpp 2016-02-08 12:50:00 +01:00
Brad Leege
87bac32a33 [core] #509 - Creating and using MIN_ZOOM and MAX_ZOOM constants 2016-02-03 18:57:22 -06:00
Brad Leege
511c01c6ca [core] #509 - Adding min / max checks to parameters and refactoring to utilize clamp function 2016-02-03 18:31:14 -06:00
Brad Leege
932012e931 [android][core] #509 - Setting Min and Max Zooms warning annotations in Android. Clamping Min and Max zooms at Core GL for all platforms to use at runtime. 2016-02-03 17:59:44 -06:00
John Firebaugh
37c27f3a8f [core] Improve LatLngBounds API
* Use "named constructors": empty, world, hull
* Make the two-argument constructor lenient (i.e., it is a hull operation)
* Add various accessors
* Enforce a single empty representation
2016-02-02 23:04:18 -08:00
John Firebaugh
032c8fba3c [core] Remove unused 2016-02-02 20:20:47 -08:00
John Firebaugh
82d67d6912 [core] Remove unused 2016-02-02 18:53:37 -08:00
Ansis Brammanis
8e9510d2b4 [core] tweak dash rendering and enable render tests
fixes #2646
2016-02-02 17:09:38 -08:00
Ansis Brammanis
2cfc624848 [core] make symbol sort order more deterministic 2016-02-02 16:17:30 -08:00
Ansis Brammanis
4e0d1070f6 [core] support tiles with non-4096 extents
Convert all geometries to the maximum extent supported by our buffers
and then use that constant extent everywhere else.
2016-02-02 14:49:03 -08:00
John Firebaugh
f1f53c36d0 [core] Simplify latLngToCoordinate calculation 2016-02-02 12:56:44 -08:00
John Firebaugh
f198f306f3 [core] Remove unused 2016-02-02 12:44:28 -08:00
John Firebaugh
5512d87362 [core] Remove TransformState::getNormalizedZoom
It calculated the same value as TransformState::getZoom.
2016-02-02 12:44:28 -08:00