File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,18 @@ static gr_surface fbdev_init(minui_backend* backend) {
179179
180180static gr_surface fbdev_flip (minui_backend * backend __unused ) {
181181 if (double_buffered ) {
182+ #if defined(RECOVERY_BGRA )
183+ // In case of BGRA, do some byte swapping
184+ unsigned int idx ;
185+ unsigned char tmp ;
186+ unsigned char * ucfb_vaddr = (unsigned char * )gr_draw -> data ;
187+ for (idx = 0 ; idx < (gr_draw -> height * gr_draw -> row_bytes );
188+ idx += 4 ) {
189+ tmp = ucfb_vaddr [idx ];
190+ ucfb_vaddr [idx ] = ucfb_vaddr [idx + 2 ];
191+ ucfb_vaddr [idx + 2 ] = tmp ;
192+ }
193+ #endif
182194 // Change gr_draw to point to the buffer currently displayed,
183195 // then flip the driver so we're displaying the other buffer
184196 // instead.
You can’t perform that action at this time.
0 commit comments