From f90e4545c27fa92cc6ba835f80551556929df43d Mon Sep 17 00:00:00 2001 From: Marcus Comstedt Date: Sun, 1 Feb 2009 14:56:19 +0000 Subject: Merged r36175 from branch-0-13-0: Fixed alpha blending in the UI dialogs by adding alpha computation to the blendPixelPtr() function. To minimize impact, pre-multiplied alpha is assumed, meaning that the blending of the R, G and B components is the same both with and without hardware alpha. svn-id: r36177 --- graphics/VectorRendererSpec.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'graphics/VectorRendererSpec.cpp') diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp index 37281839cb..ac21203da1 100644 --- a/graphics/VectorRendererSpec.cpp +++ b/graphics/VectorRendererSpec.cpp @@ -403,7 +403,10 @@ blendPixelPtr(PixelType *ptr, PixelType color, uint8 alpha) { (int)(idst & PixelFormat::kGreenMask)) * alpha) >> 8))) | (PixelFormat::kBlueMask & ((idst & PixelFormat::kBlueMask) + ((int)(((int)(isrc & PixelFormat::kBlueMask) - - (int)(idst & PixelFormat::kBlueMask)) * alpha) >> 8))) ); + (int)(idst & PixelFormat::kBlueMask)) * alpha) >> 8))) | + (PixelFormat::kAlphaMask & ((idst & PixelFormat::kAlphaMask) + + ((alpha >> (8 - PixelFormat::kAlphaBits)) << PixelFormat::kAlphaShift) - + (((int)(idst & PixelFormat::kAlphaMask) * alpha) >> 8)))); } template -- cgit v1.2.3