-
Notifications
You must be signed in to change notification settings - Fork 806
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CGD2D] Render buffer-shared G8 images as A8. (#1804)
This is riddled with caveats, many of which are documented in the code. A first pass attempt was made to implement a format converter that would run per-primitive. It's expensive, but it did get the job done. Unfortunately, asking WIC to convert a PRGBA buffer to a G8 buffer causes it to discard all alpha data -- even if premultiplied, the luminance of partially-transparent pixels is not appropriately reduced in the final G8 image. This impacts alpha-heavy uses such as grayscale font rendering. The A8 implementation was chosen for maximal compatibiltiy with Cocos2D. Cocos2D renders white (!) text into a "grayscale" buffer that it then passes off to OpenGLES as a `GL_ALPHA8` buffer. Hah. The A8 "hack" also represents what we currently have on the develop branch. Fixes #1747.
- Loading branch information
Showing
1 changed file
with
69 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters