From fe83c985be5b16b2f1ef51c4c6ac173117580489 Mon Sep 17 00:00:00 2001 From: Lothar Serra Mari Date: Sun, 10 Mar 2019 15:56:17 +0100 Subject: GUI: Allow GUI background colors other than black in Classic Theme (#1526) GUI: Allow GUI background colors other than black in Classic Theme--- graphics/VectorRendererSpec.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'graphics/VectorRendererSpec.cpp') diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp index e308dde821..2f7164cc9b 100644 --- a/graphics/VectorRendererSpec.cpp +++ b/graphics/VectorRendererSpec.cpp @@ -2352,12 +2352,17 @@ drawBevelSquareAlg(int x, int y, int w, int h, int bevel, PixelType top_color, P // Fill Background ptr_left = (PixelType *)_activeSurface->getBasePtr(x, y); i = h; - if (fill) { - assert((_bgColor & ~_alphaMask) == 0); // only support black + // Optimize rendering in case the background color is black + if ((_bgColor & ~_alphaMask) == 0) { while (i--) { darkenFill(ptr_left, ptr_left + w); ptr_left += pitch; } + } else { + while (i--) { + blendFill(ptr_left, ptr_left + w, _bgColor, 200); + ptr_left += pitch; + } } x = MAX(x - bevel, 0); @@ -2409,13 +2414,18 @@ drawBevelSquareAlgClip(int x, int y, int w, int h, int bevel, PixelType top_colo ptr_left = (PixelType *)_activeSurface->getBasePtr(x, y); ptr_x = x; ptr_y = y; i = h; - if (fill) { - assert((_bgColor & ~_alphaMask) == 0); // only support black + // Optimize rendering in case the background color is black + if ((_bgColor & ~_alphaMask) == 0) { while (i--) { darkenFillClip(ptr_left, ptr_left + w, ptr_x, ptr_y); ptr_left += pitch; ++ptr_y; } + } else { + while (i-- ) { + blendFillClip(ptr_left, ptr_left + w, ptr_x, ptr_y, _bgColor, 200); + ptr_left += pitch; + } } x = MAX(x - bevel, 0); -- cgit v1.2.3