Commit 068c0f0
Sprite and RenderTexture blending mode set based off texture premultiplied alpha setting (#20154)
* Added RenderTexture::saveToFileAsNonPMA() to save images without PMA.
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.
* [CCImage-ios.mm] Fixed indentation.
* [CCSprite.cpp] Sprite:initWithTexture() should set the blend mode depending on the texture premultiplied alpha setting.
[CCRenderTexture.cpp] Sprite::setOpacityModifyRGB() is set based on the premultiplied alpha setting.
* Fix for incorrect _opacityModifyRGB on non-PMA.
* [CCSprite.cpp] Removed redundant code related to blending mode and opacityModifyRGB when creating a sprite with a texture.1 parent 8f454b4 commit 068c0f0
2 files changed
+2
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
| 308 | + | |
308 | 309 | | |
309 | 310 | | |
| 311 | + | |
310 | 312 | | |
311 | | - | |
312 | 313 | | |
313 | 314 | | |
314 | 315 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | 272 | | |
277 | 273 | | |
278 | 274 | | |
| |||
0 commit comments