John Firebaugh
0b68731207
[core] Per-bucket icon atlases
2017-06-13 10:18:43 -07:00
John Firebaugh
9dfc2d924d
[core] Collection-level immutability
...
Introduce a second level of immutability, over each of the collections held by a style: sources, images, and layers. Tracking immutability at this level allows us to short-circuit significant portions of the RenderStyle update logic via a simple equality check, greatly improving performance.
2017-06-05 19:38:08 -07:00
John Firebaugh
6be6263ebf
[core] Replace inline SpriteAtlas updates with diffing
2017-05-30 11:34:13 -07:00
John Firebaugh
aa216d0025
[core] Don't use a separate SpriteAtlas for annotation images
...
Instead, just add them to the Style as needed. Includes changes from #8905 and takes care to avoid regressing #3817 .
2017-05-26 11:21:56 -07:00
John Firebaugh
d766af44c8
[core] Auto-growable SpriteAtlas using shelf-pack
2017-05-26 11:21:56 -07:00
John Firebaugh
1759603e12
[core] Simplify and fix sprite atlas coordinate calculations
...
* 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
2017-05-23 12:59:27 -07:00
John Firebaugh
e7154adac3
[core] Remove redundant SpriteAtlasElement members
2017-05-17 11:23:47 -07:00
John Firebaugh
786707649a
[core] Remove ambiguous get{Width,Height} accessors from style::Image
2017-05-17 11:23:47 -07:00
John Firebaugh
63558e06ad
[core] Remove obsolete modular arithmetic on atlas coordinates
...
We switched to 16-bit coordinates in attributes in b0cb8715ed , so there's no longer any reason to require that they are divisible by four.
2017-05-17 09:36:43 -07:00
John Firebaugh
cc1ea759a6
[core, node, darwin, android, qt] Make image ID part of Image
...
More like Source and Layer.
2017-05-16 12:26:35 -07:00
John Firebaugh
8fb1a81c46
[core] Immutable<Impl> for Image
2017-05-15 08:20:18 -07:00
John Firebaugh
b3ec985568
[core] Trim StyleObserver interface
...
It doesn't need to inherit from SpriteLoaderObserver and GlyphAtlasObserver.
2017-05-13 09:28:53 -07:00
Ivo van Dongen
cc9f040a2d
[core] Split style image collection from SpriteAtlas
2017-05-12 13:19:00 -07:00
John Firebaugh
5dd98df50b
[all] Rationalize style::Image
...
A style has a collection of images, just as it has collections of sources and layers.
* Name things appropriately
* Use std::unique_ptr
2017-04-24 15:52:28 -07:00
Konstantin Käfer
59055cf403
[core] Move Sprite parsing to thread pool
2017-04-24 10:42:47 +02:00
Chris Loer
5cdf838a38
[core] De-mutex GlyphAtlas and SpriteAtlas
...
- 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
2017-04-04 11:33:12 -07:00
John Firebaugh
0351e9c370
[core] Eliminate SpritePatternMode
2017-02-14 16:28:12 -06:00
John Firebaugh
d819ece74c
[core] Combine SpriteAtlas::getPosition with SpriteAtlas::getImage
2017-02-14 16:28:12 -06:00
John Firebaugh
5524506abd
[core] Eliminate SpriteAtlas::updateDirty
...
Simplify internal datastructures. Properly remove rects from the bin pack when an image is removed.
2017-02-14 16:28:12 -06:00
John Firebaugh
c6d5eaf479
[tests] Use test::checkImage
2017-02-14 12:29:01 -06:00
Mike Morris
39e9b30ebc
[core] add more detail to invalid metrics error in createSpriteImage
2016-11-04 14:47:34 -04:00
Konstantin Käfer
9e3839781f
[core] convert SpriteAtlas to use managed texture handling
2016-11-01 18:41:52 +01: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
3f3fc7b772
[test] add .test.cpp suffix to test case files
2016-09-28 16:34:22 +02:00
John Firebaugh
940124ff71
[core] Merge SpriteStore and SpriteAtlas
2016-09-19 09:40:43 -07:00
Konstantin Käfer
d1d523686c
[core] upgrade RapidJSON to 1.1.0
2016-09-15 14:05:23 +02:00
Konstantin Käfer
ff0c895eaa
[core] change bool wrap/repeating to enum class SpritePatternMode
2016-09-07 17:56:38 +02:00
Bruno de Oliveira Abinader
001b545290
[tidy/linux] modernize-use-default
2016-06-14 22:14:11 +03:00
Konstantin Käfer
2bdecdf9f9
[core] fix pedantic warning messages
2016-06-13 11:16:19 +02:00
Ansis Brammanis
415ea295c5
[core] make sprite metrics checking stricter
...
- check that sprite metrics are within the bounds of the sprite. fix #714
- make sprite metrics problems Errors instead of Warnings
- check for negative image width, height
2016-03-31 10:27:42 -07:00
Konstantin Käfer
db5ac4785f
[test] rearrange test files so they're not in the fixtures folder
2016-03-22 11:56:01 -07:00
Konstantin Käfer
1dd81d9776
[test] remove crc64 and compare images
...
boost's crc64 breaks on iOS
2016-03-22 11:56:01 -07:00
John Firebaugh
7b39ce9521
[core] Remove ThreadContext::getFileSource; instead thread FileSource through
2016-02-18 15:15:24 -08:00
John Firebaugh
19aa090bdc
[tests] Don't call the callback for cancelled responses
...
StubFileSource gets an optional Response return type. Returning null means "cancelled; don't call the callback".
Fixes #3784
2016-02-04 13:18:14 -08:00
John Firebaugh
716997b99e
[tests] Refactor and make MockFileSource more general
...
Now it works more like StubStyleObserver: you can assign std::functions to specific slots based on resource type.
Rewrite resource loading tests in that style, making them less like integration tests of Style and more like unit tests of Source, GlyphStore, and SpriteStore.
2016-02-01 15:29:42 -08: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
Ansis Brammanis
26faa6a5ad
[core][ios][osx][android] fix icons with non-integer width/height
...
ref #3031
ref #2198
For example, an icon that has:
- a pixel width of 10
- a pixel ratio of 3
- a scaled with of 3.333
is now supported.
2016-01-19 18:20:54 -08:00
Ansis Brammanis
e577354567
[core] remove bilinear, nearest scaling, fix #3164
2016-01-13 15:02:41 -08:00
John Firebaugh
845699e698
[tests] Simplify MockFileSource
2015-12-24 08:17:42 -08:00
John Firebaugh
338f94e7ed
[tests] Rewrite {Sprite,Glyph}Store tests in the style of ResourceLoading
2015-12-24 08:17:42 -08:00
John Firebaugh
16de579d7c
[core] Rationalize error handling for resource loading
...
* Standardize on std::exception_ptr as the error representation
(fixes #2854 ).
* Don't format textual strings at the error source; pass on the
constituent data via observer method parameters instead.
* Use the null object pattern to simplify observer notification code.
* Further refactoring for ResourceLoading tests.
2015-12-23 12:50:42 -08:00
Konstantin Käfer
478472e501
[core] add std::move to constructors
2015-12-03 15:38:36 +01:00
John Firebaugh
e5181e2668
[core] Use optional where SpriteAtlas return values might not exist
...
Fixes #3162
2015-12-01 18:05:54 -08:00
Adam Hunter
e1091db45e
[core] Use a separate atlas and store for annotation sprites
...
Fixes #1488
2015-12-01 09:15:05 -08:00
Thiago Marcos P. Santos
cb06526b10
[tests] Remove libuv dependency from the tests
2015-12-01 11:49:02 +02:00
John Firebaugh
0c1e378bc9
[core] Rewrite image handling
...
* Consolidate Image and StillImage
* Typecheck unassociated vs premultiplied images
* Rewrite default platform image decoding implementation
2015-11-25 15:57:36 -08:00
John Firebaugh
f2772309fe
Rewrite CustomSpriteImages test
...
Previous test was invalid; Map::setSprite is only for annotations.
2015-11-18 16:29:18 -08:00
John Firebaugh
f9ebe54a63
[core] Merge Sprite into SpriteStore
2015-11-12 13:03:14 -08:00
John Firebaugh
1e350b7ea4
[core] Reorganize sprite related files
2015-11-12 13:03:14 -08:00