Commit Graph

13 Commits

Author SHA1 Message Date
Konstantin Käfer
db5ac4785f [test] rearrange test files so they're not in the fixtures folder 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
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
Thiago Marcos P. Santos
cb06526b10 [tests] Remove libuv dependency from the tests 2015-12-01 11:49:02 +02: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