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

v3 fix to stop iOS from converting an image into non-premultiplied alpha on save #20615

Open
wants to merge 15 commits into
base: v3
Choose a base branch
from

Conversation

rh101
Copy link
Contributor

@rh101 rh101 commented Nov 24, 2020

RenderTexture has explicit methods to save an image with pre-multiplied alpha (PMA) or without PMA. Saving with PMA is forcefully converted to non-PMA by the current implementation on iOS, which is not the correct functionality.

Refer to #20613

rh101 added 15 commits May 30, 2019 03:15
Sync with master branch
Set the PMA parameter to true when calling initWithRawData() inside RenderTexture::newImage(), since textures are PMA.
Renamed Image::premultipliedAlpha() to Image::premultiplyAlpha() to better reflect it's action, and made it public.
Added Image::reversePremultipliedAlpha() to allow the reversing of the PMA.
Updated CCImage-ios.mm to set the correct bitmapInfo for PMA and non-PMA images before saving a file.
Updated RenderTextureTest::RenderTextureSave() to cater for non-PMA file saving.
Sync with master branch
Synced with master branch
Sync with master branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant