diff --git a/src/servers/app/drawing/Painter/drawing_modes/DrawingModeAlphaCC.h b/src/servers/app/drawing/Painter/drawing_modes/DrawingModeAlphaCC.h index bbe0755045..f4af29eb9b 100644 --- a/src/servers/app/drawing/Painter/drawing_modes/DrawingModeAlphaCC.h +++ b/src/servers/app/drawing/Painter/drawing_modes/DrawingModeAlphaCC.h @@ -148,10 +148,8 @@ blend_color_hspan_alpha_cc(int x, int y, unsigned len, if (covers) { // non-solid opacity do { - uint16 alpha = hAlpha * *covers; -// if (alpha) { -if (alpha && (colors->a & 0xff)) { - // support for transparent magic + uint16 alpha = hAlpha * colors->a * *covers / 255; + if (alpha) { if (alpha == 255 * 255) { ASSIGN_ALPHA_CC(p, colors->r, colors->g, colors->b); } else { @@ -164,23 +162,17 @@ if (alpha && (colors->a & 0xff)) { } while(--len); } else { // solid full opcacity - uint16 alpha = hAlpha * cover; + uint16 alpha = hAlpha * colors->a * cover / 255; if (alpha == 255 * 255) { do { -if (colors->a & 0xff) { - // support for transparent magic ASSIGN_ALPHA_CC(p, colors->r, colors->g, colors->b); -} p += 4; ++colors; } while(--len); // solid partial opacity } else if (alpha) { do { -if (colors->a & 0xff) { - // support for transparent magic BLEND_ALPHA_CC(p, colors->r, colors->g, colors->b, alpha); -} p += 4; ++colors; } while(--len); diff --git a/src/servers/app/drawing/Painter/drawing_modes/DrawingModeAlphaCO.h b/src/servers/app/drawing/Painter/drawing_modes/DrawingModeAlphaCO.h index 5e4af1518c..237b14e309 100644 --- a/src/servers/app/drawing/Painter/drawing_modes/DrawingModeAlphaCO.h +++ b/src/servers/app/drawing/Painter/drawing_modes/DrawingModeAlphaCO.h @@ -150,7 +150,7 @@ blend_color_hspan_alpha_co(int x, int y, unsigned len, if (covers) { // non-solid opacity do { - uint16 alpha = hAlpha * *covers; + uint16 alpha = hAlpha * colors->a * *covers / 255; if (alpha) { if (alpha == 255*255) { ASSIGN_ALPHA_CO(p, colors->r, colors->g, colors->b); @@ -164,7 +164,7 @@ blend_color_hspan_alpha_co(int x, int y, unsigned len, } while(--len); } else { // solid full opcacity - uint16 alpha = hAlpha * cover; + uint16 alpha = hAlpha * colors->a * cover / 255; if (alpha == 255 * 255) { do { ASSIGN_ALPHA_CO(p, colors->r, colors->g, colors->b); diff --git a/src/servers/app/drawing/Painter/drawing_modes/DrawingModeOverSolid.h b/src/servers/app/drawing/Painter/drawing_modes/DrawingModeOverSolid.h index 2b9f6e4877..47e3747d5d 100644 --- a/src/servers/app/drawing/Painter/drawing_modes/DrawingModeOverSolid.h +++ b/src/servers/app/drawing/Painter/drawing_modes/DrawingModeOverSolid.h @@ -83,8 +83,6 @@ blend_solid_hspan_over_solid(int x, int y, unsigned len, } while(--len); } - - // blend_solid_vspan_over_solid void blend_solid_vspan_over_solid(int x, int y, unsigned len, @@ -109,50 +107,5 @@ blend_solid_vspan_over_solid(int x, int y, unsigned len, } while(--len); } - -// blend_color_hspan_over_solid -void -blend_color_hspan_over_solid(int x, int y, unsigned len, - const color_type* colors, - const uint8* covers, uint8 cover, - agg_buffer* buffer, const PatternHandler* pattern) -{ - uint8* p = buffer->row_ptr(y) + (x << 2); - if (covers) { - // non-solid opacity - do { -// if (*covers) { -if (*covers && (colors->a & 0xff)) { - if (*covers == 255) { - ASSIGN_OVER(p, colors->r, colors->g, colors->b); - } else { - BLEND_OVER(p, colors->r, colors->g, colors->b, *covers); - } - } - covers++; - p += 4; - ++colors; - } while(--len); - } else { - // solid full opcacity - if (cover == 255) { - do { -if (colors->a & 0xff) { - ASSIGN_OVER(p, colors->r, colors->g, colors->b); -} - p += 4; - ++colors; - } while(--len); - // solid partial opacity - } else if (cover) { - do { - BLEND_OVER(p, colors->r, colors->g, colors->b, cover); - p += 4; - ++colors; - } while(--len); - } - } -} - #endif // DRAWING_MODE_OVER_H diff --git a/src/servers/app/drawing/Painter/drawing_modes/PixelFormat.cpp b/src/servers/app/drawing/Painter/drawing_modes/PixelFormat.cpp index 7b5cd60940..6051bbb11a 100644 --- a/src/servers/app/drawing/Painter/drawing_modes/PixelFormat.cpp +++ b/src/servers/app/drawing/Painter/drawing_modes/PixelFormat.cpp @@ -140,14 +140,13 @@ PixelFormat::SetDrawingMode(drawing_mode mode, source_alpha alphaSrcMode, fBlendHLine = blend_hline_over; fBlendSolidHSpan = blend_solid_hspan_over; fBlendSolidVSpan = blend_solid_vspan_over; - fBlendColorHSpan = blend_color_hspan_over; } else { fBlendPixel = blend_pixel_over_solid; fBlendHLine = blend_hline_over_solid; fBlendSolidHSpan = blend_solid_hspan_over_solid; fBlendSolidVSpan = blend_solid_vspan_over_solid; - fBlendColorHSpan = blend_color_hspan_over_solid; } + fBlendColorHSpan = blend_color_hspan_over; break; case B_OP_ERASE: fBlendPixel = blend_pixel_erase;