Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow full color tinting on grayscale template images. #1629

Merged
merged 4 commits into from
Aug 22, 2019

Conversation

jessietea
Copy link
Contributor

As an optimization, imageRendererFormat decides on a color space based on the image. Since template images are meant to be black and transparent, this means they are assigned a grayscale color space. This is not ideal, because a template image should be able to be tinted to any color, not just grayscale. In order to allow this, we can simply use the default UIGraphicsImageRendererFormat if the image is a template image.

@CLAassistant
Copy link

CLAassistant commented Aug 21, 2019

CLA assistant check
All committers have signed the CLA.

Source/ASImageNode.mm Outdated Show resolved Hide resolved
Source/Details/ASGraphicsContext.mm Show resolved Hide resolved
@rahul-malik
Copy link
Contributor

@jessietea - Can we add a grayscale template image in the test resources directory? https://github.com/TextureGroup/Texture/tree/master/Tests/TestResources

Then we can have a new snapshot test that tints that asset with the ASExperimentalDrawingGlobal feature enabled

Copy link
Contributor

@rahul-malik rahul-malik left a comment

Choose a reason for hiding this comment

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

Thanks for adding the test! This looks good to merge.

@Adlai-Holler - If you have any feedback on things we should change here please let us know and we'll put up a follow-up diff

@rahul-malik
Copy link
Contributor

@nguyenhuy - it seems like this is stuck on waiting for Danger to report back. is there any way to get past this?

@nguyenhuy
Copy link
Member

@rahul-malik Danger stopped working because we removed the BuildKite integration. I’m trying to fix it by running Danger with GitHub Actions (#1635).

@nguyenhuy
Copy link
Member

@rahul-malik Danger is back up now.
@jessietea Can you please rebase with master to pick up the new GitHub Actions workflow? Thanks.

Merge remote-tracking branch 'tensor/master' into template-image-tint-fix
@rahul-malik rahul-malik merged commit ccee566 into TextureGroup:master Aug 22, 2019
matthewd1234 pushed a commit to matthewd1234/Texture that referenced this pull request Aug 25, 2019
…1629)

* Allow full color tinting on grayscale template images.

* Signing a commit with the correct email address.

* Add snapshot test for a grayscale image with ASExperimentalDrawingGlobal enabled.
rahul-malik added a commit that referenced this pull request Aug 27, 2019
As part of #1629, we use the
preferred or default UIGraphicsRendererFormat. This was pointing to a
static variable which content scale was mutated across several graphic
render passes and lead to pixelated views.
rahul-malik added a commit that referenced this pull request Aug 27, 2019
* Fix issue where UIGraphicsRendererFormat is mutated

As part of #1629, we use the
preferred or default UIGraphicsRendererFormat. This was pointing to a
static variable which content scale was mutated across several graphic
render passes and lead to pixelated views.

* Update reference images with iOS 10.3
bolsinga pushed a commit that referenced this pull request Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants