Commit ae993e6
Fix RenderTexture PMA setting (#20143)
* 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.
* Corrects the PMA setting on the internal Texture2D instance created by RenderTexture.1 parent 4356cda commit ae993e6
File tree
3 files changed
+20
-29
lines changed- cocos
- 2d
- renderer
3 files changed
+20
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
| 256 | + | |
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
307 | 311 | | |
308 | 312 | | |
309 | 313 | | |
| |||
664 | 668 | | |
665 | 669 | | |
666 | 670 | | |
667 | | - | |
| 671 | + | |
668 | 672 | | |
669 | 673 | | |
670 | 674 | | |
671 | | - | |
| 675 | + | |
672 | 676 | | |
673 | 677 | | |
674 | 678 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
557 | | - | |
| 557 | + | |
558 | 558 | | |
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
563 | 563 | | |
564 | 564 | | |
565 | | - | |
| 565 | + | |
566 | 566 | | |
567 | 567 | | |
568 | | - | |
| 568 | + | |
569 | 569 | | |
570 | | - | |
571 | | - | |
572 | 570 | | |
573 | 571 | | |
574 | 572 | | |
| |||
579 | 577 | | |
580 | 578 | | |
581 | 579 | | |
582 | | - | |
583 | 580 | | |
584 | 581 | | |
585 | 582 | | |
| |||
706 | 703 | | |
707 | 704 | | |
708 | 705 | | |
709 | | - | |
| 706 | + | |
710 | 707 | | |
711 | 708 | | |
712 | 709 | | |
| |||
764 | 761 | | |
765 | 762 | | |
766 | 763 | | |
767 | | - | |
768 | 764 | | |
769 | 765 | | |
770 | 766 | | |
771 | 767 | | |
772 | 768 | | |
773 | 769 | | |
774 | 770 | | |
775 | | - | |
776 | | - | |
777 | | - | |
778 | | - | |
| 771 | + | |
779 | 772 | | |
780 | 773 | | |
781 | 774 | | |
| |||
786 | 779 | | |
787 | 780 | | |
788 | 781 | | |
789 | | - | |
790 | | - | |
791 | | - | |
792 | | - | |
| 782 | + | |
793 | 783 | | |
794 | 784 | | |
795 | 785 | | |
| |||
800 | 790 | | |
801 | 791 | | |
802 | 792 | | |
803 | | - | |
804 | | - | |
| 793 | + | |
805 | 794 | | |
806 | 795 | | |
807 | 796 | | |
808 | | - | |
809 | 797 | | |
810 | 798 | | |
811 | 799 | | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | 800 | | |
816 | 801 | | |
817 | 802 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| 229 | + | |
229 | 230 | | |
230 | 231 | | |
231 | 232 | | |
232 | | - | |
| 233 | + | |
233 | 234 | | |
234 | 235 | | |
235 | 236 | | |
| |||
238 | 239 | | |
239 | 240 | | |
240 | 241 | | |
| 242 | + | |
241 | 243 | | |
242 | | - | |
| 244 | + | |
243 | 245 | | |
244 | 246 | | |
245 | 247 | | |
| |||
0 commit comments