summaryrefslogtreecommitdiff
path: root/src/mbgl/sprite
Commit message (Collapse)AuthorAgeFilesLines
* [core] Fix performance-unnecessary-value-param errors in header filesThiago Marcos P. Santos2020-04-171-0/+3
| | | | As reported by clang-tidy-8.
* [build] Fix undefined behavour sanitizer (#16375)zmiao2020-04-072-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [build] Fix integer overflow runtime error for core part Temporarily remove circle ci UBSAN build precondition * [build] Enable all of the ubsans [build] Check runtime error [build] Update UBSAN_OPTION * [build] Add UBSAN blacklist [build] Ignore system libraries [build] Ignore vendor library * [build] Fix implicit conversion runtime error in core * [build] Fix division by zero runtime error * [build] Add unfixed error to ubsan blacklist * [build] Make UBSAN halt on error Revert "Temporary remove build precondition" * [build] Fix division by zero error * [build] Make UBSAN officially work without FIXME prefix * [build] Fix implicit conversion from int64_t to uint64_t * [build] Rename style test json file name * Address review findings
* [core] Fix performance-unnecessary-value-param errorsThiago Marcos P. Santos2020-03-232-14/+5
| | | | As reported by clang-tidy-8.
* [core] Dismiss actors from sprite loaderMikhail Pozdnyakov2020-02-244-87/+40
| | | | and get rid of `SpriteLoaderWorker`, use `scheduleAndReplyValue()` API instead.
* [core] Fix sprite sheet merging in Style::Impl::onSpriteLoadedAlexander Shalamov2020-02-171-6/+12
| | | | | | If we get a new sprite sheet from the server, we need to merge current sprite sheet with a new one, while overwiting duplicates and keeping old unique images in a style.
* [core] Set priorData from cache only if resource is useableAlexander Shalamov2020-02-141-2/+4
| | | | | | In cases when cached resource is useable, yet don't have an expiration timestamp, we provided data to the requester from the cache and the same data was returned once 304 response was received from the network.
* Revert "[core] Fix excessive onSpriteLoaded() notifications"Alexander Shalamov2020-02-141-4/+4
| | | | This reverts commit 80cb05420a86ed53815cae7fb2cb3fddf07dd1d1.
* [core] Fix excessive onSpriteLoaded() notificationsMikhail Pozdnyakov2020-02-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | What happened: The excessive `onSpriteLoaded()` notifications were caused by the trick inside `OnlineFileRequest::completed()` implemenation, which causes receving of two file source updates pointing to the *same* data in case the network response is `notModified` and the local storage has the sprite sheet already stored inside. In the SpriteLoader` implementation, it resulted in 2 extra `parseSprite()` calls and 2 extra `onSpriteLoaded()` notifications. Then, the excessive `onSpriteLoaded()` notifications affected style images and all the unnecessarily added image dupes (btw, the amount of these dupes `= 2 * number of style images`) were treated by the `RenderOrchestrator` as *updated* images. Further, `RenderOrchestrator` called `ImageManager::updateImage()` for the updated images and the `ImageManager` populated the `updatedImageVersions` map. Finally, at every frame all the geometry tiles iterated through the `updatedImageVersions` to check whether their uploaded textures needed patching. All the mentioned above had a negative performance impact. The fix: Now, `SpriteLoader` sends `onSpriteLoaded()` notifications only if the data in the file source response is different comparing to the existing one.
* [core] Loading images to style optimizationMikhail Pozdnyakov2020-02-115-42/+46
| | | | | | This change enables attaching images to the style with batches and avoids massive re-allocations. Thus, it improves UI performance especially at start-up time.
* [core] parse stretchX, stretchX, and content from sprite JSON filesKonstantin Käfer2020-01-152-35/+110
|
* [core] Add stretches and content to style::ImageKonstantin Käfer2020-01-151-1/+1
|
* [core] Modularize FileSource codebase (#15768)Alexander Shalamov2020-01-131-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [core] Introduce FileSourceManager and use it for default platform impl - Add `FileSourceManager` interface that provides access to `FileSource` instances and means of registering / unregistering `FileSource` factories - Split `DefaultFileSource` into smaller parts - Add `DatabaseFileSource` interface and it's default implementation - Remove inter-dependencies between concrete `FileSource` classes * [build] Add files to next build system * [core] Add generic property setters / getters * [core] Remove setOnlineStatus from OnlineFileSource interface * [core] Hide threading implementation details from DatabaseFileSource interface * [core] Make DB file source methods virtual * [core] Add documentation for DatabaseFileSource and rename one method * [core] Use simple callback instead of ActorRef * [core] Remove ActorRef from OnlineFileSource public header * [core] Add callback to FileSource::forward async API * [core] Pass OfflineRegionDefinition by value * [core] Update tests to use modular file sources * [core] Update unit tests * [core] Update unit tests after rebase * [core] Backport low prio fix for cached requests * [core] Backport pack database * [core] Return removed factory from unRegisterFileSourceFactory * [core] Rename shadowed args in onlinefilesource * [core] Remove simple std::function callback aliases * [core] Expose online file source property keys in public header file * [test-runner] Add proxy file source test runner * [cache] Update mbgl-cache utility to use new file source * [metrics] Rebaseline binary size metrics * [offline] Update offline utility * [core] Update changelog
* [core] Make the BackgroundScheduler a singletonThiago Marcos P. Santos2019-05-102-6/+5
| | | | | | | | | | - Do not carry it over everywhere as parameter, it is a shared instance anyway and the lifecycle is pretty much the app lifecycle from the moment we instantiate a map. - Rename to BackgroundScheduler because it is a Scheduler that will do tasks in the background, we don't make assumptions if it is a thread pool or a single thread. - Most importantly, remove the dependency from `core` on `platform`.
* [build] update Boost to 1.69 and remove RTTIKonstantin Käfer2019-03-131-2/+2
|
* [core] remove some uses of <iostream> and <sstream>Konstantin Käfer2018-10-231-4/+1
|
* [core] Avoid blocking in Thread<Object> constructor (#12151)Anand Thakker2018-07-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Introduce AspiringActor, EstablishedActor This pair of objects represents the two-phase (parent-thread / child-thread) construction that's needed to support constructing Thread<Object> without blocking until the child thread is up and running. An `AspiringActor<O>` is responsible for: - ownership of the actor's `Mailbox` - allocating the memory for (but *not* constructing) the target object `O` Using these two pieces--the mailbox and a stable address for `O`--an `AspiringActor<O>` can accept messages for the target object, or provide `ActorRef<O>`s that do so, before the object has actually been constructed by the corresponding `EstablishedActor<O>`. (Such messages are queued in the mailbox until after the object is constructed.) This allows for an `AspiringActor<O>` to be created and safely used by a thread other than the one on which the target object will (eventually) live. An `EstablishedActor<O>` is responsible for managing the lifetime of the target object `O` and the open/closed state of the parent's `mailbox`. The `O` object's lifetime is contained by that of its owning `EstablishedActor<O>`: the `EstablishedActor` constructor executes the `O` constructor via "placement new", constructing it at the address provided by the parent `AspiringActor`, and the `~EstablishedActor` destructor similarly executes the `~O` destructor (after closing the mailbox). `EstablishedActor` should therefore live entirely on the thread intended to own `O`. * Remove Actor#{invoke,ask}
* [core] remove dependencies on RunLoopIvo van Dongen2017-08-091-2/+2
|
* [core] Per-bucket icon atlasesJohn Firebaugh2017-06-133-395/+2
|
* [core] Replace inline SpriteAtlas updates with diffingJohn Firebaugh2017-05-302-15/+15
|
* [core] Don't use a separate SpriteAtlas for annotation imagesJohn Firebaugh2017-05-264-73/+17
| | | | Instead, just add them to the Style as needed. Includes changes from #8905 and takes care to avoid regressing #3817.
* [core] Auto-growable SpriteAtlas using shelf-packJohn Firebaugh2017-05-262-46/+55
|
* [core] Simplify and fix sprite atlas coordinate calculationsJohn Firebaugh2017-05-232-42/+64
| | | | | | | | * Always return image metrics exclusive of padding * Work with integer coordinates whenever possible * Eliminate redundant SpriteAtlasElement members * Fix asymmetric re-padding in getIconQuad when pixelRatio != 1 * Add explanatory comments
* [core] Move pattern coordinate division by texture size into shaderJohn Firebaugh2017-05-232-6/+4
| | | | This makes pattern usage more like icons, and will be necessary for data-driven *-pattern properties.
* [core] add error for non-virtual destructor deletes + add virtual dtorsKonstantin Käfer2017-05-181-0/+1
|
* [core] Remove redundant SpriteAtlasElement membersJohn Firebaugh2017-05-172-6/+2
|
* [core] Remove ambiguous get{Width,Height} accessors from style::ImageJohn Firebaugh2017-05-171-5/+5
|
* [core] Remove obsolete modular arithmetic on atlas coordinatesJohn Firebaugh2017-05-171-12/+5
| | | | We switched to 16-bit coordinates in attributes in b0cb8715ed74678b4d0f05829fa71a590e41b2f6, so there's no longer any reason to require that they are divisible by four.
* [core, node, darwin, android, qt] Make image ID part of ImageJohn Firebaugh2017-05-169-55/+36
| | | | More like Source and Layer.
* [core] Immutable<Impl> for ImageJohn Firebaugh2017-05-152-14/+15
|
* [core] Split style image collection from SpriteAtlasIvo van Dongen2017-05-1211-152/+272
|
* [tidy] modernize-use-usingBruno de Oliveira Abinader2017-05-121-2/+2
|
* [core] Tweak handling of annotation special case SpriteAtlasJohn Firebaugh2017-04-262-8/+4
| | | | | * Simplify SymbolLayout; it never needs to care about more than one SpriteAtlas. * Move the reference from SymbolLayer::Impl to SymbolBucket. This is a prerequisite for making layer Impls immutable.
* [all] Rationalize style::ImageJohn Firebaugh2017-04-245-116/+77
| | | | | | | A style has a collection of images, just as it has collections of sources and layers. * Name things appropriately * Use std::unique_ptr
* [core] Move Sprite parsing to thread poolKonstantin Käfer2017-04-246-35/+97
|
* [core] De-mutex GlyphAtlas and SpriteAtlasChris Loer2017-04-042-15/+62
| | | | | | | | | | | | - Expose glyph and icon information to workers via message interface. - Glyph/SpriteAtlas track which tiles have outstanding requests and send messages to them when glyphs/icons become available. - Remove obsolete "updateSymbolDependentTiles" pathway - Symbol preparation for a tile now depends on all glyphs becoming available before it can start. - Start tracking individual icons needed for a tile, although we don't do anything with the information yet. - Introduce typedef for GlyphID
* [core] Eliminate SpritePatternModeJohn Firebaugh2017-02-142-44/+37
|
* [core] Mutex no longer needs to be recursiveJohn Firebaugh2017-02-142-6/+6
|
* [core] Combine SpriteAtlas::getPosition with SpriteAtlas::getImageJohn Firebaugh2017-02-142-41/+29
|
* [core] Inline SpriteAtlas::allocateImageJohn Firebaugh2017-02-142-23/+11
|
* [core] Eliminate SpriteAtlas::updateDirtyJohn Firebaugh2017-02-142-92/+93
| | | | Simplify internal datastructures. Properly remove rects from the bin pack when an image is removed.
* [core] Eliminate SpriteAtlas::HolderJohn Firebaugh2017-02-142-37/+25
|
* [core] Make Image saferJohn Firebaugh2017-02-142-48/+19
| | | | | | Provide Image::copy, which handles copying rectangles from a source to a destination, with thorough bounds checking. Also fixes an indexing error in SpriteAtlas, where the top row of pixels in a wrapped image was copied from the wrong source row.
* [build] move logging to utilKonstantin Käfer2016-11-222-3/+3
|
* [core] add more detail to invalid metrics error in createSpriteImageMike Morris2016-11-041-1/+5
|
* [core] convert SpriteAtlas to use managed texture handlingKonstantin Käfer2016-11-012-109/+50
|
* [core] Use numeric_limits<>::max() for checking element groupsBruno de Oliveira Abinader2016-10-311-1/+1
|
* [core] Modern C++ bindings for OpenGLJohn Firebaugh2016-10-281-2/+4
|
* [core] change std::array<uint16_t, 2> to mbgl::SizeKonstantin Käfer2016-10-274-20/+22
|
* [core] remove dependence on gl.h typesKonstantin Käfer2016-09-292-10/+9
|
* [core] merge gl::ObjectStore into gl::ContextKonstantin Käfer2016-09-272-7/+7
|