Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Convert colors to sRGB for mbgl; fix title case unit tests - #11391

Merged
1ec5 merged 3 commits into
release-bobafrom
1ec5-macos-srgb-11289
Mar 8, 2018
Merged

1ec5 merged 3 commits into
release-bobafrom
1ec5-macos-srgb-11289

Conversation

@1ec5

@1ec5 1ec5 commented Mar 6, 2018 •

Copy link
Copy Markdown
Contributor

When converting an NSColor to mbgl::Color on macOS 10.13 High Sierra, automatically convert to the sRGB color space instead of the calibrated RGB color space. Colors set via the runtime styling API, as well as any colors displayed in the attribution buttons, should be more accurate now.

This PR fixes the macOS SDK’s unit tests so that they pass on High Sierra. The calibrated RGB color space differs between Sierra and High Sierra. In addition, a compile-time conditional compilation check added in #10224 has been refined to work on macOS, and the macOS targets have been upgraded to Swift 4 (a pro forma procedure).

Fixes #11289.

/cc @frederoni @friedbunny @julianrex

@1ec5 1ec5 added bug macOS Mapbox Maps SDK for macOS tests labels Mar 6, 2018
@1ec5 1ec5 added this to the macos-v0.7.0 milestone Mar 6, 2018
@1ec5 1ec5 self-assigned this Mar 6, 2018
@1ec5
1ec5 requested review from frederoni and friedbunny March 6, 2018 09:41
@1ec5

1ec5 commented Mar 6, 2018

Copy link
Copy Markdown
Contributor Author

mapbox/mapbox-gl-js#6285 tracks officially documenting the color space expected in the style JSON file format.

@frederoni

Copy link
Copy Markdown
Contributor

The implementation looks good. Not sure why it doesn't round trip.

@1ec5

1ec5 commented Mar 6, 2018 •

Copy link
Copy Markdown
Contributor Author

Still struggling with the tests on CircleCI, which apparently runs under Sierra rather than High Sierra:

    ✗ testProperties, ((rawLayer->getBackgroundColor()) equal to (propertyValue)) failed: ("<01000000 00000000 0000803f e8b5183e 00000000 0000803f 50f7048f c67f0000 a08c760a 01000000 501eb958 00000000 30ef048f c67f0000 b0ed048f c67f0000 f0ed048f c67f0000 50c5048f c67f0000 00706eb0 ff7f0000>") is not equal to ("<01000000 00000000 0000803f 00000000 00000000 0000803f a08c760a 01000000 30cb1c0a 01000000 50f7048f c67f0000 c01db958 ff7f0000 bb8b6eb0 ff7f0000 07030000 00000000 102c760a 01000000 201eb958 ff7f0000>") - Setting backgroundColor to a constant value expression should update background-color.
    ✗ testProperties, ((layer.backgroundColor) equal to (constantExpression)) failed: ("NSCalibratedRGBColorSpace 0.986246 0.00712079 0.0274342 1") is not equal to ("NSCalibratedRGBColorSpace 1 0 0 1") - backgroundColor should round-trip constant value expressions.

@1ec5

1ec5 commented Mar 8, 2018

Copy link
Copy Markdown
Contributor Author

21 commits later, the builds are green. 😓 I’m going to squash and merge this one.

@friedbunny friedbunny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😓

Comment thread platform/darwin/test/MGLTileSetTests.mm Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is redundant to the following lines.

Assume mbgl needs colors in the sRGB color space rather than the calibrated RGB color space. Fixed link colors when creating attribution from HTML.
@1ec5
1ec5 force-pushed the 1ec5-macos-srgb-11289 branch from a53f1a8 to 3e433b7 Compare March 8, 2018 00:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug macOS Mapbox Maps SDK for macOS tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants