Commit cff518ac authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Fix background blending sometimes setting alpha to zero in 32bpp modes

Detail:
  s/Blending - blend_putdata_32bpp contains an optimisation to avoid reading the screen pixel if the text pixel is fully opaque. However this means that the source alpha can't be preserved, going against the rules set out in the comment preceeding setblendingdata (and in reality, the alpha channel would be set to zero). Fix this by introducing a new blend_putdata_32bppA variant which always reads from the screen, ensuring the alpha channel can be preserved.
Admin:
  Tested on Raspberry Pi 3B
  Hardware overlays underneath the desktop are no longer visible through the zero-alpha font pixels


Version 3.80. Tagged as 'Manager-3_80'
parent 4fb6d1d2
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "3.79"
Module_Version SETA 379
Module_MajorVersion SETS "3.80"
Module_Version SETA 380
Module_MinorVersion SETS ""
Module_Date SETS "04 Feb 2018"
Module_ApplicationDate SETS "04-Feb-18"
Module_Date SETS "13 Aug 2018"
Module_ApplicationDate SETS "13-Aug-18"
Module_ComponentName SETS "Manager"
Module_ComponentPath SETS "castle/RiscOS/Sources/Video/Render/Fonts/Manager"
Module_FullVersion SETS "3.79"
Module_HelpVersion SETS "3.79 (04 Feb 2018)"
Module_FullVersion SETS "3.80"
Module_HelpVersion SETS "3.80 (13 Aug 2018)"
END
/* (3.79)
/* (3.80)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 3.79
#define Module_MajorVersion_CMHG 3.80
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 04 Feb 2018
#define Module_Date_CMHG 13 Aug 2018
#define Module_MajorVersion "3.79"
#define Module_Version 379
#define Module_MajorVersion "3.80"
#define Module_Version 380
#define Module_MinorVersion ""
#define Module_Date "04 Feb 2018"
#define Module_Date "13 Aug 2018"
#define Module_ApplicationDate "04-Feb-18"
#define Module_ApplicationDate "13-Aug-18"
#define Module_ComponentName "Manager"
#define Module_ComponentPath "castle/RiscOS/Sources/Video/Render/Fonts/Manager"
#define Module_FullVersion "3.79"
#define Module_HelpVersion "3.79 (04 Feb 2018)"
#define Module_LibraryVersionInfo "3:79"
#define Module_FullVersion "3.80"
#define Module_HelpVersion "3.80 (13 Aug 2018)"
#define Module_LibraryVersionInfo "3:80"
......@@ -165,6 +165,12 @@ setblendingdata EntryS "R0-R3,R10"
LDMIA R1, {R0, R1} ; get blending functions
CMP R0, #0
BEQ %FT96
; Use the right variant for 32bpp with alpha
CMP R0, #blend_convert_32bpp - blend_table
BNE %FT20
TST R2, #ModeFlag_DataFormatSub_Alpha
ADDNE R0, R0, #blend_putdata_32bppA - blend_putdata_32bpp
20
ADD R0, R0, R3
ADD R1, R1, R3
ADRL R3, blend_putdata
......@@ -539,6 +545,24 @@ blend_putdata_32bpp_common
Pull "R1-R3, PC"
; Variant of blend_putdata_32bpp for alpha channel destination - always pixel up destination word, so that alpha channel is preserved
blend_putdata_32bppA
ANDS outdata, outdata, outmask ; ensure only relevant bits are set
BEQ blend_nodata
Push "R1-R3, LR"
LDR R1, blend_fgvalue ; get the foreground painting colour
; outdata = &00000000-&00001000 (clear->solid)
MOV outdata, outdata, LSR # 8 ; amount of foreground to blend
; outdata = 0-16 (clear-solid)
RSB LR, outdata, # 16 ; and the amount of background
LDR pchar, [ outptr ] ; and pick up the current background pixel data
B blend_putdata_32bpp_common
blend_putdataM_32bpp
ANDS outdata, outdata, outmask
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment